13.12.2010, 04:25
pawn Код:
if(strcmp("/ban", cmd, true) == 0)
{
if(PlayerInfo[playerid][pAdminLevel] > 0)
{
tmp = strtok(cmdtext,idx);
if(!strlen(tmp)) SendClientMessage(playerid,COLOR_GRAY,"[SERVER]: /ban [id]");
new id = strval(tmp);
new pid = playerid;
if(!IsPlayerConnected(id))
{
return SendClientMessage(playerid,COLOR_GRAY,"[SERVER]: This player is not online!");
}
if (id == pid) SendClientMessage(playerid,COLOR_GRAY,"[ADMIN]: You can not do this on yourself!");
new globalmsg[100];
new adminid[MAX_PLAYERS], victimid[MAX_PLAYERS];
GetPlayerName(pid, adminid, sizeof(victimid));
GetPlayerName(id, victimid, sizeof(victimid));
format(globalmsg,sizeof(globalmsg),"[ADMIN]: Administrator %s has banned player %s for breaking the server rules.",adminid,victimid);
SendClientMessageToAll(COLOR_LIGHTBLUE,globalmsg);
PlayerInfo[id][pAccountLocked] = 1;
Ban(id);
return 1;
}
else
{
SendClientMessage(playerid,COLOR_GRAY,"You don't have authorization.");
return 1;
}
}
P.S: I'm thankful if you dont make it messy and bad identation.
Thanks to everyone.