SA-MP Forums Archive
Kick command stopped working after 0.3x update? - 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: Kick command stopped working after 0.3x update? (/showthread.php?tid=412981)



Kick command stopped working after 0.3x update? - Dokins - 03.02.2013

pawn Код:
CMD:kick(playerid, params[])
{
    if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
   
    new reason[128], giveplayerid;
    if(AdminLevel[playerid] < 1) return SendClientMessage(playerid, COLOUR_GREY, "You are not authorized to use this command.");
    if(sscanf(params, "us[128]", giveplayerid, reason)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /kick [player id] [reason]");
    if(!IsPlayerConnected(giveplayerid)) return SendClientMessage(playerid, COLOUR_GREY, "That player is not connected.");
   
    format(reason, sizeof(reason), "Admin %s Kicked %s [Reason: %s ]", GetNameEx(playerid), GetNameEx(giveplayerid), reason);
    SendClientMessageToAll(COLOUR_REALRED, reason);
    Kick(giveplayerid);
    return 1;
}
Can someone please explain why? Every command that I use the Kick(); Function in, doesn't display any of the client messages I'm trying to send, worked before I updated and suddenly they don't.


Re: Kick command stopped working after 0.3x update? - T0pAz - 03.02.2013

The code above should work fine. Did you update your plugins?


Re: Kick command stopped working after 0.3x update? - Dokins - 03.02.2013

Apparently, the Kick() needs a timer to delay, something to do with security issues.


Re: Kick command stopped working after 0.3x update? - SKAzini - 03.02.2013

Caused by 0.3x security improvements.. Kick() being related to security is another story.