31.12.2012, 23:21
Try using sscanf...
SSCANF Version:
NON-SSCANF Version:
SSCANF Version:
pawn Код:
CMD:adminann(playerid, params[])
{
new message[100];
if(PlayerInfo[playerid][pAdminLevel] < 2) return SendClientMessage(playerid, COLOR_GREY, "You are not an admin");
if(sscanf(params,"s",message)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /adminann [text]");
if(strlen(message) > 100) return SendClientMessage(playerid, COLOR_GREY, "Your message must not exceed 100 characters");
new str[128];
SendClientMessageToAll(COLOR_LIGHTBLUE, "|~~~~~~~~~~ Admin Announcement ~~~~~~~~~~|");
format(str, sizeof(str), "%s", message);
SendClientMessageToAll(COLOR_GREEN, str);
SendClientMessageToAll(COLOR_LIGHTBLUE, "|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|");
return 1;
}
pawn Код:
CMD:adminann(playerid,params[])
{
if(PlayerInfo[playerid][pAdminLevel] < 2) return SendClientMessage(playerid, COLOR_GREY, "You are not an admin");
if(!strlen(params)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /adminann [text]");
if(strlen(params) > 100) return SendClientMessage(playerid, COLOR_GREY, "Your message must not exceed 100 characters");
new str[128];
SendClientMessageToAll(COLOR_LIGHTBLUE, "|~~~~~~~~~~ Admin Announcement ~~~~~~~~~~|");
format(str, sizeof(str), "%s", params);
SendClientMessageToAll(COLOR_GREEN, str);
SendClientMessageToAll(COLOR_LIGHTBLUE, "|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|");
return 1;
}