23.02.2011, 11:53
how do i add a reason to these commands
thanks
thanks
Код:
COMMAND:kick(playerid,params[])
{
new playerid2,PlayerName[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
new tmp[256], Index, str[49];
tmp = strtok(params,Index), playerid2 = strval(tmp);
GetPlayerName(playerid2,on,sizeof(on));
GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
if(Account[playerid][Level] < 2) return SendClientMessage(playerid,Yellow,"You need to be level 2 to use this command!");
if (sscanf(params, "u", playerid2)) return SendClientMessage(playerid, Yellow, "Usage: /kick id");
if(!IsPlayerConnected(playerid2))return SendClientMessage(playerid,Yellow,"Player is not connected!");
format(str,sizeof(str),"%s has kicked %s",PlayerName,on);
SendClientMessageToAll(Blue,str);
Kick(playerid2);
return 1;
}
COMMAND:ban(playerid,params[])
{
new playerid2, PlayerName[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
new tmp[256], Index, string[49];
tmp = strtok(params,Index), playerid2 = strval(tmp);
GetPlayerName(playerid2,on,sizeof(on));
GetPlayerName(playerid,PlayerName,sizeof(PlayerName));
if(Account[playerid][Level] < 3) return SendClientMessage(playerid,Yellow,"You need to be level 3 to use this command!");
if (sscanf(params, "u", playerid2)) return SendClientMessage(playerid, Yellow, "Usage: /ban id");
if(!IsPlayerConnected(playerid2))return SendClientMessage(playerid,Yellow,"Player is not connected!");
format(string,sizeof(string),"Admin %s has banned %s",PlayerName,on);
SendClientMessageToAll(Yellow,string);
Ban(playerid2);
return 1;
}

