public GMChange() { switch(random(4)) { case 0: SendRconCommand("changemode gmone"); case 1: SendRconCommand("changemode gmtwo"); case 2: SendRconCommand("changemode gmthree"); case 3: SendRconCommand("changemode gmfour"); } new modestring[128], ircs[128]; format(modestring,sizeof(modestring),">> Your next mission will be: {F2C80C}%s {FFFFFF}...please wait.",random(4)); SendClientMessageToAll(-1,modestring); format(ircs,sizeof(ircs),">> Changing mission, next will be: %s", random(4)); IRC_GroupSay(groupID, IRC_CHANNEL, ircs); return 1; }
public GMChange()
{
new str[128], rnd = random(4);
format(str,sizeof(str),">> Your next mission will be: {F2C80C}%d {FFFFFF}...please wait.",rnd);
SendClientMessageToAll(-1,str);
format(str,sizeof(str),">> Changing mission, next will be: %d", rnd);
IRC_GroupSay(groupID, IRC_CHANNEL, str);
switch(rnd)
{
case 0: SendRconCommand("changemode gmone");
case 1: SendRconCommand("changemode gmtwo");
case 2: SendRconCommand("changemode gmthree");
default: SendRconCommand("changemode gmfour");
}
return 1;
}
static const GameModes[][] = { {"Gamemode0"}, {"Gamemode1"}, {"Gamemode2"}, {"Gamemode3"} } public GMChange() { new rand = random(sizeof (GameModes)), string[128] ; format(string, sizeof(string), "changemode %s", GameModes[rand]); SendRconCommand(string); new ; format(string,sizeof(string), ">> Your next mission will be: {F2C80C}%s {FFFFFF}...please wait.", GameModes[rand]); SendClientMessageToAll(-1,string); format(string,sizeof(string), ">> Changing mission, next will be: %s", GameModes[rand]); IRC_GroupSay(groupID, IRC_CHANNEL, string); return 1; }
new GMChange[][] =
{
"gmone",
"gmtwo",
"gmthree",
"gmfour"
};
forward GMChange1();
public GMChange1() {
new modestring[128],ircs[128];
new randmode = random(sizeof(GMChange));
format(modestring,sizeof(modestring),">> Your next mission will be: {F2C80C}%s {FFFFFF}...please wait.",GMChange[randmode]);
SendClientMessageToAll(-1,modestring);
format(ircs,sizeof(ircs),">> Changing mission, next will be: %s", GMChange[randmode]);
IRC_GroupSay(groupID, IRC_CHANNEL, ircs);
format(modestring,sizeof(modestring),"changemode %s",GMChange[randmode]);
SendRconCommand(modestring);
return 1;
}
public GMChange(){
new rand = random(4), buffer[128];
format(buffer,sizeof(buffer),">> Your next mission will be: {F2C80C}%d {FFFFFF}...please wait.",rand);
SendClientMessageToAll(-1,buffer);
format(buffer,sizeof(buffer),">> Changing mission, next will be: %d", rand);
IRC_GroupSay(groupID, IRC_CHANNEL, buffer);
switch(rand)
{
case 0: SendRconCommand("changemode gmone");
case 1: SendRconCommand("changemode gmtwo");
case 2: SendRconCommand("changemode gmthree");
case 3: SendRconCommand("changemode gmfour");
}
return 1;
}
PHP код:
|
format(buffer,sizeof(buffer),">> Your next mission will be: {F2C80C}%d {FFFFFF}...please wait.",rand+1);
SendClientMessageToAll(-1,buffer);
format(buffer,sizeof(buffer),">> Changing mission, next will be: %d", rand+1);
IRC_GroupSay(groupID, IRC_CHANNEL, buffer);