Joa ichh ab das plugin ein wenig verändert aber im grossen nur übersetzt...
Was mir aber nich in kramm passt ist das wenn cm anzeit die nächste map ist azze und 2 min vor ende der vote kommt keiner die map verlägrn wil lalso die map gewechselt wird aufeinmal dust2 kommt...
Das doch bestimmt nen prob zwischen cm und am oder ????
und ich weis nich wirklich ob es so ist aber ich glaube er verlängert die zeit nicht um 1 also bei timelimit 25 min sondern um 2 nämlich um 50 min und das wollen wir ja so auch nich nech *g* normal verlängert er doch nur um eins oder nich...
plugin schaut so aus :
Code:
/* $Id $ */
#include <core>
#include <console>
#include <string>
#include <admin>
#include <adminlib>
#define ACCESS_NEXTMAP_VOTE 1
#define ACCESS_CONTROL_VOTE 2
#define MAP_INVALID -1
#define MAX_MAPS 64
new STRING_VERSION[MAX_DATA_LENGTH] = "2.50.0";
new ExtendCount = 0;
new ExtendMapTime = 0;
public StartNextMapVote() {
new Text[MAX_TEXT_LENGTH];
new sNextMap[MAX_TEXT_LENGTH];
if (vote_allowed()!=1) {
selfmessage( "NextMap vote not allowed at this time.");
return PLUGIN_HANDLED;
}
new iMaxExtend = getvar("admin_vote_maxextend");
if(ExtendCount < iMaxExtend || iMaxExtend == 0) {
nextmap(sNextMap,30)
if (valid_map(sNextMap) == 1) {
snprintf(Text, MAX_TEXT_LENGTH, "Aktuelle Map verlaengern ?^n", sNextMap);
log(Text);
vote(Text,"Nein","Ja","HandleNextMapVote",sNextMap);
} else {
say("Map Vote fehlgeschlagen !");
}
}
return PLUGIN_HANDLED;
}
public ChangeNextMap(Timer,Repeat,HLUser,HLParam) {
new NewMap[MAX_NAME_LENGTH];
convert_string(HLParam,NewMap,MAX_NAME_LENGTH);
if(strlen(NewMap) != 0) {
changelevel(NewMap);
}
}
public ExtendNextMap(Timer,Repeat,HLUser,HLParam) {
new iFreq = getvar("admin_vote_freq");
new ExecCommand[MAX_DATA_LENGTH];
new Timelimit = 0;
new VaultData[MAX_DATA_LENGTH];
new intTime = timeleft(0);
ExtendCount++;
Timelimit = getvar("mp_timelimit");
Timelimit += GetExtendTime();
snprintf(ExecCommand, MAX_DATA_LENGTH, "mp_timelimit %i", Timelimit);
exec(ExecCommand);
if (iFreq > 0) {
set_timer("AllowMapVote",iFreq,1);
}
get_vaultdata("NEXTMAP_AUTOSTART",VaultData, MAX_DATA_LENGTH);
if(VaultData[0] == '1') {
/* Call for a vote two minutes before map ends */
set_timer("StartNextMapVote", intTime + ((ExtendMapTime - 2) * 60),1);
}
}
/* Handle a map vote's results. */
public HandleNextMapVote(WinningOption,HLMap,VoteCount,UserCount) {
new strNumber[MAX_NUMBER_LENGTH];
new Text[MAX_TEXT_LENGTH];
new VoteMap[MAX_DATA_LENGTH];
convert_string(HLMap,VoteMap,MAX_DATA_LENGTH);
if (WinningOption == 1) {
new Ratio = getvar("map_ratio");
if (VoteCount >= Ratio*UserCount/100) {
snprintf(Text, MAX_TEXT_LENGTH, "Mapwechsel. Es folgt: %s ", VoteMap);
say(Text);
exec("mp_timelimit 1");
set_timer("ChangeNextMap",2,1,VoteMap);
} else {
numtostr(Ratio*UserCount/100,strNumber);
snprintf(Text, MAX_TEXT_LENGTH, "Map Vote war erfolgreich, aber es fehlten %s Stimmen zum Wechsel", strNumber);
say(Text);
}
} else {
if(WinningOption == 2) {
new iExtend = GetExtendTime();
snprintf(Text, MAX_TEXT_LENGTH, "Map Vote beendet. Aktuelle Map wird um %i Minuten verlaengert. ", iExtend);
say(Text);
set_timer("ExtendNextMap",2,1);
} else {
say("Map vote failed.");
}
}
}
/* Return the amount of time (in minutes) to extend a map for if an extend vote wins. */
GetExtendTime() {
/* If this is the first time we're extending the map, we want to extend it
by the length of mp_timelimit. Second and subsequent times through, we want
to keep extending it by the original timelimit...not the new one (eg, if we
start at 30 mins...on the second time through, mp_timelimit will say 60. We
want to jump to 90, not 120. */
if (ExtendMapTime == 0) {
ExtendMapTime = getvar("mp_timelimit");
}
return ExtendMapTime;
}
public admin_map_maxextend(HLCommand,HLData,HLUserName,UserIndex) {
new Command[MAX_COMMAND_LENGTH];
new Data[MAX_DATA_LENGTH];
new User[MAX_NAME_LENGTH];
convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,User,MAX_NAME_LENGTH);
execute_command(User,Command,"admin_vote_maxextend",Data);
return PLUGIN_HANDLED;
}
public admin_vote_nextmap(HLCommand,HLData,HLUserName,UserIndex) {
new Command[MAX_COMMAND_LENGTH];
new Data[MAX_DATA_LENGTH];
new Text[MAX_TEXT_LENGTH];
new User[MAX_NAME_LENGTH];
new sNextMap[MAX_TEXT_LENGTH];
if (vote_allowed()!=1) {
selfmessage( "Vote nicht erlaubt zur jetzigen Zeit.");
return PLUGIN_HANDLED;
}
convert_string(HLCommand,Command,MAX_COMMAND_LENGTH);
convert_string(HLData,Data,MAX_DATA_LENGTH);
convert_string(HLUserName,User,MAX_NAME_LENGTH);
nextmap(sNextMap,30);
if (valid_map(sNextMap) == 1) {
snprintf(Text, MAX_TEXT_LENGTH, "Aktuelle Map verlaengern ?^n", sNextMap);
log(Text);
vote(Text,"Nein","Ja","HandleNextMapVote",sNextMap);
} else {
say("Map Vote fehlgeschlagen !");
}
return PLUGIN_HANDLED;
}
public plugin_init() {
plugin_registerinfo("NextMap voting plugin by stetze","Enables Voting for Nextmap or extend - visit www.adminmod.de 4 more!",STRING_VERSION);
plugin_registercmd("admin_vote_nextmap","admin_vote_nextmap",ACCESS_NEXTMAP_VOTE,"admin_vote_nextmap: Starts Voting for NextMap or extend the current map.");
plugin_registercmd("admin_map_maxextend","admin_map_maxextend",ACCESS_CONTROL_VOTE,"admin_map_maxextend <nr>: Sets how often a map can be extended.");
new intTime = timeleft(0);
new VaultData[MAX_DATA_LENGTH];
/*
new sVaultData[MAX_DATA_LENGTH];
get_vaultdata("NEXTMAP_AUTOSTART", sVaultData, MAX_DATA_LENGTH);
VaultData = strtonum(sVaultData);
if(VaultData == '1' || VaultData == 1) { */
get_vaultdata("NEXTMAP_AUTOSTART",VaultData, MAX_DATA_LENGTH);
if(VaultData[0] == '1') {
/* Call for a vote two minutes before map ends */
set_timer("StartNextMapVote", intTime - 120, 1);
}
return PLUGIN_CONTINUE;
}
naja hoffe jmd kann helfen
thx im voraus...
_________________
<werbung>
www.teamarab.de
62.4.81.251:27085 #teamarab.de | Doenerbude
62.4.74.200:27020 #teamarab.de | Muckibude
80.239.224.29:27700 - #teamarab.de ][ Muckibude | bY quado.net -
#teamarab.de @ Q - Net
</werbung>