19.03.2013, 19:52
I've a tip for you: this code can be written much easier and simpler, without unnecessary includes:
But if it's your first script, then okay, it's good.
pawn Код:
#include <a_samp>
PlayerName(playerid)
{
new N[MAX_PLAYER_NAME];
GetPlayerName(playerid, N, sizeof(N));
return N;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/admins", true, 7))
{
SendClientMessage(playerid, -1, "Admins online:");
for(new i = 0; i <= MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i) && IsPlayerAdmin(i)) return SendClientMessage(playerid, -1, PlayerName(i));
}
return 1;
}
return 0;
}

