22.02.2011, 20:56
pawn Код:
if(strcmp(cmd, "/avisar", true) == 0 || strcmp(cmd, "/av", true) == 0)
{
new string[256];
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][PlayerAdmin] == 0)
{
SendClientMessage(playerid, COLOR_RED, "Vocк nгo й Administrador!");
return 1;
}
GetPlayerName(playerid, Pname, sizeof(Pname));
new length = strlen(cmdtext);
while ((idx < length) && (cmdtext[idx] <= ' '))
{
idx++;
}
new offset = idx;
new result[64];
while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
{
result[idx - offset] = cmdtext[idx];
idx++;
}
result[idx - offset] = EOS;
if(!strlen(result))
{
SendClientMessage(playerid, COLOR_RED, "USE: /av [texto]");
return 1;
}
SendClientMessageToAll(COLOR_RED, "|| Aviso da Administraзгo ||");
format(string, sizeof(string), "Administrador %s: {FF9A00}%s", sendername, result);
SendClientMessageToAll(COLOR_WHITE, string);
}
return 1;
}
topo tб assim
pawn Код:
new sendername[MAX_PLAYER_NAME];