22.07.2012, 22:18
Need an example for a command announcing all players on the server about it. (/announce "Message" Then it sends to all. Waiting for your help guys.) By strcmp/Scanf/ZCMD.
CMD:announce(playerid, params[]) {
new Announce[129], Time, Style;
if(sscanf(params, "s[129]dd", Announce, Time, Style)) return SendClientMessage(playerid, COLOR, "/Announce <Text> <Time> <Style>");
else
{
if(Style > 6 || Style < 0) return SendClientMessage(playerid, COLOR, "Style | 0 - 6");
if (Time > 20*1000) return SendClientMessage(playerid, COLOR, "[ERROR]: Cannot send ads longer than 20 seconds.");
if(Style == 2) return SendClientMessage(playerid, COLOR, "[ERROR]: Unable to use the style 2, this style is bugged.");
GameTextForAll(Announce, Time, Style );
}
return 1;
}
CMD:announce(playerid, params[]) {
new Announce[129];
if(sscanf(params, "s[129]", Announce)) return SendClientMessage(playerid, COLOR, "/Announce <Text>");
else
{
GameTextForAll(Announce, 8000, 3 );
}
return 1;
}