10.01.2013, 04:16
PHP код:
CMD:ask(playerid, params[])
{
new text[128]; //Variable text
new string[256];
new Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
//You need sscanf2 include, sscanf plugin.
if(sscanf(params, "s[128]", text)) return SendClientMessage(playerid, -1, "USAGE: /ask [text]");
for(new i=0;i<MAX_PLAYERS;i++)
{
if(PlayerInfo[i][pAdmin] >= 1 || IsPlayerAdmin(i))
{
format(string, sizeof(string),"Player %s asks %s", Name, text);
SendClientMessage(i, -1, string);
}
}
return 1;
}