22.07.2011, 01:51
Quote:
Assim й bem mais fбcil, repare:
pawn Код:
|
PHP код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd,"/ac",true)==0)
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
new length = strlen(string);
while ((index < length) && (string[index] <= ' '))
{
index++;
}
new offset = index;
new result[20];
while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
{
result[index - offset] = string[index];
index++;
}
result[index - offset] = EOS;
if(5 < pAdmin[playerid] < 1) return SendClientMessage(playerid,Vermelho,"(ERRO) Vocк nгo tem permissгo para usar este comando!");
if(!strlen(result)) return SendClientMessage(playerid,Vermelho, "(ERRO) Digite: /ac [texto]");
format(string, sizeof(string), "(»)Chat-Admin(«) %s(%d) diz:%s", aname, playerid, result);
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(5 < pAdmin[i] < 1) continue;
SendClientMessage(i, Verde, string);
}
return 1;
}
return 0;
}