//Top of script:
pawn Код:
public RandomMsg()
{
switch(CurrentMessage)
{
case 0: { SendClientMessageToAll(COLOR_SERVERMSG, "message 1"); CurrentMessage++; }
case 1: { SendClientMessageToAll(COLOR_SERVERMSG, "message 2"); CurrentMessage++; }
case 2: { SendClientMessageToAll(COLOR_SERVERMSG, "message 3"); CurrentMessage++; }
case 3: { SendClientMessageToAll(COLOR_SERVERMSG, "message 4"); CurrentMessage++; }
case 4: { SendClientMessageToAll(COLOR_SERVERMSG, "message 5"); CurrentMessage++; }
case 5: { SendClientMessageToAll(COLOR_SERVERMSG, "message 6"); CurrentMessage=0; }
}
}
Edit:...or you could define all the messages on top of your script:
pawn Код:
new CurrentMessage;
new ServerMessages[6][128] = {
"Message 1",
"Message 2",
"Message 3",
"Message 4",
"Message 5",
"Message 6"
};
pawn Код:
public RandomMsg()
{
SendClientMessageToAll(COLOR_SERVERMSG, ServerMessages[CurrentMessage]);
CurrentMessage++;
if(CurrentMessage == sizeof(ServerMessages)) CurrentMessage=0;
}