What's wrong with this code?
#1

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
Reply
#2

Код:
 == <
Should be :
Код:
 <=
Reply
#3

That doesn't work, but

[pawn] if(blabl) < 15.0)

works

But anyway, thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)