adding reason to kick & ban? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: adding reason to kick & ban? (
/showthread.php?tid=230359)
adding reason to kick & ban? -
Lethaal - 23.02.2011
how do i add a reason to these commands
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;
}
Re: adding reason to kick & ban? -
HyperZ - 23.02.2011
pawn Код:
COMMAND:kick(playerid,params[])
{
new playerid2,PlayerName[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
new tmp[256], Index, str[49], reason[106];
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, "uS(No Reason Given)[128]", playerid2, reason)) return SendClientMessage(playerid, Yellow, "Usage: /kick id reason");
if(!IsPlayerConnected(playerid2))return SendClientMessage(playerid,Yellow,"Player is not connected!");
format(str,sizeof(str),"%s has kicked %s Reason: %s",PlayerName,on, reason);
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], reason[106];
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, "uS(No Reason Given)[128]", playerid2, reason)) return SendClientMessage(playerid, Yellow, "Usage: /ban id reason");
if(!IsPlayerConnected(playerid2))return SendClientMessage(playerid,Yellow,"Player is not connected!");
format(string,sizeof(string),"Admin %s has banned %s Reason: %s",PlayerName,on, reason);
SendClientMessageToAll(Yellow,string);
Ban(playerid2);
return 1;
}