[Help] ZCMD Kick Command - 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: [Help] ZCMD Kick Command (
/showthread.php?tid=159866)
[Help] ZCMD Kick Command -
Dudits - 14.07.2010
I don't really know what's wrong with the code, it seems to be fine for me.
Anyways it doesn't accept more than 1 character as the reason, and it kicks me if I enter any ID.
Edit: Resolved.
Re: [Help] ZCMD Kick Command -
Whizion - 14.07.2010
It dosen't accept more than one character because it isn't an array, just replace new reason; with new reason[32]; and it should work.
Re: [Help] ZCMD Kick Command -
Dudits - 14.07.2010
You're the man, it even fixed that random ID kicking. Rep++ if I could
Re: [Help] ZCMD Kick Command -
Carlton - 14.07.2010
PHP код:
CMD:kick(playerid, params[])
{
if(IsPlayerConnected(playerid))
{
new kicked, reason[50];
if(sscanf(params, "us[50]", kicked, reason)) return SendClientMessage(playerid, 0x00FF00AA, "USAGE: /kick [ID] [Reason]");
if(kicked == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0x00FF00AA, "Invalid ID");
new message[128];
format(message, sizeof(message), "AdmCMD: %s was kicked by %s, reason: %s", ReturnPlayerName(kicked), ReturnPlayerName(playerid), reason);
SendClientMessageToAll(0x00FF00AA, message);
Kick(kicked);
}
return 1;
}