SA-MP Forums Archive
warning 202: number of arguments does not match definition - 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: warning 202: number of arguments does not match definition (/showthread.php?tid=571726)



warning 202: number of arguments does not match definition - d0nTtoucH - 21.04.2015

Can someone help me solve this out .. This is the line..
Код:
				Kick(playerid,"Car Swing");
		}



Re: warning 202: number of arguments does not match definition - MP2 - 21.04.2015

The Kick() function doesn't have a 'reason' parameter. You have to use SendClientMessage to show a message before kicking the player.

HOWEVER, be warned: If you send a message then immediately Kick() the player, the message likely won't be seen (sent after they are kicked). To circumvent this, set a timer and kick them after 500ms or so.


Re: warning 202: number of arguments does not match definition - d0nTtoucH - 21.04.2015

yh i did this but the player cant see the message is just saying Server closed the connection ..
edit: i also tried to do something with timer like
Код:
SetTimerEx("DelayedKick", 1000, false, "i", playerid);
Код:
forward DelayedKick(playerid);
public DelayedKick(playerid)
{
    Kick(playerid);
    return 1;
}
but it sends the message 5 times..


Re: warning 202: number of arguments does not match definition - Azula - 21.04.2015

PHP код:
forward KickPublic(playerid);
public 
KickPublic(playeridKick(playerid);
stock KickWithMessage(playeridcolormessage[])
{
    
SendClientMessage(playeridcolormessage);
    
SetTimerEx("KickPublic"1000false"i"playerid);     
}
 
KickWithMessage(playerid, -1"text"); 
from wiki samp


Re: warning 202: number of arguments does not match definition - d0nTtoucH - 21.04.2015

yh its working thank you !