26.12.2010, 19:07
ProgressiveRconText(const command[], const text[]);
Again, untested.
pawn Код:
new timer1, timer2;
stock ProgressiveRconText(const command[], const text[]) {
if(strcmp(command, "gamemode", true, 8) == 0) {
if(strlen(text) > 0) {
timer1 = SetTimer(ProgressiveGameModeChange, 1000, true, "s", text);
}
}
if(strcmp(command, "mapname", true 7) == 0) {
if(strlen(text) > 0) {
timer2 = SetTimer(ProgressiveMapNameChange, 1000, true, "s", text);
}
}
}
public ProgressiveGameModeChange(name[]) {
new count;
strdel(name, count, sizeof(name));
if(count > strlen(name)) {
new string[128];
format(string, sizeof(string), "gamemode %s", name);
SendRconCommand(string);
count++;
} else {
KillTimer(timer1);
}
}
public ProgressiveMapNameChange(name[]) {
new count2;
strdel(name, count, sizeof(name));
if(count2 > strlen(name)) {
new string[128];
format(string, sizeof(string), "mapname %s", name);
SendRconCommand(string);
count2++;
} else {
KillTimer(timer2);
}
}