Autofix...
#1

Just having attempt to create autofix, but failed.

pawn Код:
if(oldstate == 2)
    {
        if(newstate == 2)
        {
            GetVehicleHealth(GetPlayerVehicleID(playerid), < 999);
            RepairVehicle(GetPlayerVehicleID(playerid));
        }
    }
Errors:
Код:
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(5612) : error 029: invalid expression, assumed zero
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(5612) : warning 215: expression has no effect
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(5612) : error 001: expected token: ";", but found ")"
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(5612) : error 029: invalid expression, assumed zero
C:\Users\Kelvin\Desktop\Scripting\gamemodes\racerevolution.pwn(5612) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Reply
#2

Which line is 5612?
Reply
#3

GetVehicleHealth(GetPlayerVehicleID(playerid), < 999);
Reply
#4

pawn Код:
if(oldstate == 2)
    {
        if(newstate == 2)
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            if(GetVehicleHealth(vehicleid) < 999)
{
            RepairVehicle(vehicleid);
}
        }
    }
Try this and dont forget to indent the code or u will tell i got warning for loose indentation :P
Reply
#5

It runs normal when compiled it, but when I tried it on my test server, it's not working! D:
Reply
#6

that's not how auto repair works.
You need timer to do it.
Reply
#7

pawn Код:
if(oldstate == 2)
    {
        if(newstate == 2)
Yeah, that makes perfect sense. This will never come true. I don't even think that it'll work if you move a player from one vehicle to another by means of scripting. Also please use PLAYER_STATE_DRIVER. Those definitions are there for a reason. Use them.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)