PDA

View Full Version : Warning in script


Tomer!.$
05/04/2012, 09:55 PM
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:
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;
}

Kindred
05/04/2012, 09:59 PM
Probably due to the fact you did this:

if(GetPlayerPing(playerid) > 200)

other then

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.

Tomer!.$
05/04/2012, 10:04 PM
Doesn't work either but I tested the same script I first used on another gamemode and it worked fine.. probably gamemode related.

Toreno
05/04/2012, 10:04 PM
@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...