I need script (Rep +)
#14

Now it works, but when I leave and enter the car the engine starts again. I think adding other variable storing informations about breaking like that:

if car broken set Broken[vehicleid] to true
if Broken[vehicleid]==false start the engine

and I got something like that:
pawn Код:
new bool:Broken[9000];

(...)
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    // Setup local variables
    new engine, lights, alarm, doors, bonnet, boot, objective;
(...)
        if (Broken[vehicleid]==false){
        // Start the engine and turn on the lights
        GetVehicleParamsEx(vehicleid, engine, lights, alarm, doors, bonnet, boot, objective);
        SetVehicleParamsEx(vehicleid, 1, 1, alarm, doors, bonnet, boot, objective);
        }
(...)
    return 1;
}

(...)

public CarCheckTimer(playerid)
{
    for(new i=0; i<MAX_VEHICLES; i++) {
        new Float:vhealth, vehicleid, Float:x = 0.0, Float:y = 0.0, Float:z = 0.0;
        vehicleid = GetPlayerVehicleID(playerid);
(...)
                Broken[vehicleid] = true;
                SendClientMessage(playerid, -1, "Your car is broken.");
                return 1;
            }
   
    }
    return 1;
}
But it shows
Код:
error 033: array must be indexed (variable "Broken")
Reply


Messages In This Thread
I need script (Rep +) - by xGoldenx - 12.12.2011, 16:55
Re: I need script (Rep +) - by English-Conceptz - 12.12.2011, 17:07
Re: I need script (Rep +) - by Speed - 12.12.2011, 17:08
Re: I need script (Rep +) - by xGoldenx - 12.12.2011, 17:52
Re: I need script (Rep +) - by English-Conceptz - 12.12.2011, 18:02
Re: I need script (Rep +) - by xGoldenx - 13.12.2011, 18:19
Re: I need script (Rep +) - by Rob_Maate - 13.12.2011, 20:46
Re: I need script (Rep +) - by xGoldenx - 15.12.2011, 18:52
Re: I need script (Rep +) - by Kostas' - 15.12.2011, 19:15
Re: I need script (Rep +) - by xGoldenx - 15.12.2011, 19:21
AW: I need script (Rep +) - by BigETI - 15.12.2011, 20:01
Re: I need script (Rep +) - by Rob_Maate - 15.12.2011, 20:28
Re: I need script (Rep +) - by Kostas' - 16.12.2011, 12:26
Re: I need script (Rep +) - by xGoldenx - 16.12.2011, 14:48
Re: I need script (Rep +) - by xGoldenx - 16.12.2011, 20:38

Forum Jump:


Users browsing this thread: 3 Guest(s)