PHP код:
CMD:eventbankhost(playerid, params[])
{
if(PlayerData[playerid][playerLevel] >= 5 || playerid != EventData[EventHostID] || IsPlayerAdmin(playerid))
{
new id,string[126];
if(sscanf(params, "r", id)) return SendClientMessage(playerid, -1, "USAGE: /eventbankhost <id/name>");
if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "ERROR: The user does not exist!");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, -1, "The player is not connected!");
format(string, sizeof(string), "[EVENT]: Administrator %s has made %s the event bank host.", GetName(playerid), GetName(id));
SendClientMessageToAll(-1, string);
EventData[EventHostID] = id;
}
else
{
SendClientMessage(playerid, -1,"ERROR: Only administrators can use this command!");
}
return 1;
}