SA-MP Forums Archive
Kick - 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 (/showthread.php?tid=345612)



Kick - MechaTech - 25.05.2012

I have 1 error this one:

Код:
W:\Users\Magdy\Desktop\Server 3.0e\filterscripts\MyAdmin.pwn(323) : warning 213: tag mismatch
Script:

pawn Код:
CMD:kick(playerid,params[])
{
    new id,reason;
Line 323 if(PlayerInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid,COLOR_RED,"[ERROR] You've to be an level 1 admin to use this command.");
    else if(sscanf(params,"us",id,reason)) return SendClientMessage(playerid,COLOR_WHITE,"[SYNTAX] Usage: /kick [playerid] [Reason]");
    else if(id == playerid)SendClientMessage(playerid,COLOR_WHITE,"[ERROR] You cannot kick yourself!");
    else if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"[ERROR] That player isn't connected.");
    else
    {
    new string[124];
    new name[MAX_PLAYER_NAME];
    new nname[MAX_PLAYER_NAME];
    GetPlayerName(id,name,MAX_PLAYER_NAME);
    GetPlayerName(playerid,nname,MAX_PLAYER_NAME);
    format(string,sizeof(string),"[KICK] %s has been kicked by %s [Reason: %s]",name,nname,string);
    SendClientMessageToAll(COLOR_RED,string);
    Kick(id);
    }
    return 1;
}
Also can you check if this kick command will work.


Re: Kick - [MG]Dimi - 25.05.2012

pawn Код:
new id,reason[50];
Reason has to be a string, not an integer.


Re: Kick - MechaTech - 25.05.2012

I already fixed it, but thanks for your respond.