SA-MP Forums Archive
What's wrong with this code? - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: What's wrong with this code? (/showthread.php?tid=145837)



What's wrong with this code? - Jochemd - 04.05.2010

Hey,

I got a weird problem. I show you the code

pawn Код:
public OnGetVehicleHealth(vehicleid)
{
    new Float:health;
    if(GetVehicleHealth(vehicleid,health) == < 15.0)
    {
    SendClientMessageToAll(COLOR_YELLOW,"failed");
    }
    return 1;
}
= errors

pawn Код:
public OnGetVehicleHealth(vehicleid)
{
    new Float:health;
    if(GetVehicleHealth(vehicleid,health) == 15.0)
    {
    SendClientMessageToAll(COLOR_YELLOW,"failed");
    }
    return 1;
}
= no errors

It gives these errors

pawn Код:
C:\Users\Jochem\Documents\Roleplay\filterscripts\JobScript.pwn(4658) : error 029: invalid expression, assumed zero
C:\Users\Jochem\Documents\Roleplay\filterscripts\JobScript.pwn(4658) : warning 215: expression has no effect
C:\Users\Jochem\Documents\Roleplay\filterscripts\JobScript.pwn(4658) : error 001: expected token: ";", but found ")"
C:\Users\Jochem\Documents\Roleplay\filterscripts\JobScript.pwn(4658) : error 029: invalid expression, assumed zero
C:\Users\Jochem\Documents\Roleplay\filterscripts\JobScript.pwn(4658) : fatal error 107: too many error messages on one line
The most weird error of those is the error 001. There's no need to set a ; there.

Regards, Jochem


Re: What's wrong with this code? - Rac3r - 04.05.2010

Код:
 == <
Should be :
Код:
 <=



Re: What's wrong with this code? - Jochemd - 04.05.2010

That doesn't work, but

[pawn] if(blabl) < 15.0)

works

But anyway, thanks