Warning in script - 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 in script (
/showthread.php?tid=331758)
Warning in script -
Tomer!.$ - 05.04.2012
PHP код:
warning 202: number of arguments does not match definition
The specific line of the warning is the line of the { after I set the if function.
The whole public:
PHP код:
public OnPlayerUpdate(playerid)
{
if(GetPlayerPing(playerid) > 200)
{
new string[128];
format(string, sizeof(string), "AdmCmd: %s was Kicked by the server, Reason: High Ping(200+)", GetName(playerid));
SendClientMessageToAll(COLOR_RED, string);
Kick(playerid);
}
return 1;
}
Re: Warning in script -
Kindred - 05.04.2012
Probably due to the fact you did this:
pawn Код:
if(GetPlayerPing(playerid) > 200)
other then
pawn Код:
if(GetPlayerPing(playerid) >= 200)
Not sure if that is needed, just try it. Good Luck.
EDIT: Tested, compiled fine.
EDIT2: Alright, This is just the way I do it, wasn't quite sure whether it is needed or not. I also tested it with just the >, and it seemed to work fine, but I had another gamemode error other then that, so I wasn't sue whether or not that was it.
Re: Warning in script -
Tomer!.$ - 05.04.2012
Doesn't work either but I tested the same script I first used on another gamemode and it worked fine.. probably gamemode related.
Re: Warning in script -
Toreno - 05.04.2012
@KurtBag, you're wrong. It doesn't matter at all, you can either do the you did it or the way he did. I just copied his code, and it compiled fine. Ehm, there might be something else which interrupts, or he might gave us a wrong line...