23.03.2014, 09:12
pawn Код:
CMD:ban(playerid, params[])
{
new id, reason[128];
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, ""COL_RED"ERROR: You do not have the privilege to access this command!");
if(sscanf(params, "us", id, reason)) SendClientMessage(playerid, -1, ""COL_RED"USAGE: /ban [id] [reason]");
else if(id==playerid) SendClientMessage(playerid, -1, ""COL_RED"ERROR: You cannot ban yourself!");
else if(id==INVALID_PLAYER_ID) SendClientMessage(playerid, -1, ""COL_RED"ERROR: Player is not connected!");
else {
new name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], kickmes[128];
GetPlayerName(playerid, name1, sizeof(name1));
GetPlayerName(id, name2, sizeof(name2));
format(kickmes, sizeof(kickmes), "%s[%d] has banned player %s[%d]. Reason: %s", name1, playerid, name2, id);
SendClientMessageToAll(-1, kickmes);
PlayerInfo[id][pBanned] = 1;
}
return 1;
}
Код:
PlayerInfo[id][pBanned] = 1; }
Q#2: It will be automatically banned for all IP's from that computer or not?