Help /kick Problem - 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)
+--- Thread: Help /kick Problem (
/showthread.php?tid=284355)
Help /kick Problem -
ServerScripter - 18.09.2011
this is Kick Command (zcmd+sscanf2)
PHP код:
COMMAND:kick(playerid,params[])
{
new playerid2,PlayerName[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
new tmp[256], Index, str[49], reason[32];
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", 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),"Admin %s has kicked %s [Reason: %s]",PlayerName,on,reason);
SendClientMessageToAll(Blue,str);
Kick(playerid2);
return 1;
}
My Problem is whene i kick someone , for an example i kick id 2 for Lag , the reason shown is : La , so we can't see all the word,also for spawnkill , Reason :Sp (we can't see spawnkill) THANX FOR HELPING
Re: Help /kick Problem -
=WoR=G4M3Ov3r - 18.09.2011
PHP код:
COMMAND:kick(playerid,params[])
{
new playerid2,PlayerName[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
new tmp[256], Index, string[128], reason[32];
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[64]", playerid2,reason)) return SendClientMessage(playerid, Yellow, "Usage: /kick id reason");
if(!IsPlayerConnected(playerid2))return SendClientMessage(playerid,Yellow,"Player is not connected!");
format(string, sizeof(string),"Admin %s has kicked %s [Reason: %s]",PlayerName, on, reason);
SendClientMessageToAll(Blue, string);
Kick(playerid2);
return 1;
}
try this
Re: Help /kick Problem -
ServerScripter - 18.09.2011
Perfect Working for me

thanx a lot man .