SA-MP Forums Archive
[HELP] event's cars - 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)
+--- Thread: [HELP] event's cars (/showthread.php?tid=486238)



[HELP] event's cars - Luca12 - 07.01.2014

Hello I wonder how to make that with command I only reset/respawn event cars? And how can I make to respawn just trailers? Thanks


Re: [HELP] event's cars - Loot - 07.01.2014

How did you defined the vent vehicles at first?
(it's a rough example)

pawn Код:
new vehicles[10];

// on event creation assign array to vehicleids
for(..) {
     vehicles[x] = ++a;
}

// on respawn cmd
for(..) {
     SetVehicleToRespawn(vehicles[x]);
}



Re: [HELP] event's cars - Luca12 - 07.01.2014

I don't understand you?


Re: [HELP] event's cars - Loot - 07.01.2014

Did you created the event system already? If no, look for event scripts on how-to.


Re: [HELP] event's cars - Luca12 - 07.01.2014

yes I already have that I just need code for respawn that vehicles? Thanks


Re: [HELP] event's cars - erminpr0 - 08.01.2014

Trailers are also vehicles so you can use DestroyVehicles/SetVehicleToRespawn.

Assigning vehicle ids to an array is nice idea.

pawn Код:
new EventCars[10];
EventCars[0] = CreateVehicle(..);
EventCars[1] = CreateVehicle(..);
..
So if you want to destroy all event vehicles do this\
pawn Код:
for(new e; e != sizeof EventCars; ++e)
{
    DestroyVehicle(EventCars[e]);
}
And yes, for respawning all trailers:
pawn Код:
for(new t; t != MAX_VEHICLES; t++)
{
    new model = GetVehicleModel(t);
    switch(model)
    {
        case 435,450,569,570,584,590,591,606,607,608,610,611:
        SetVehicleToRespawn(t);
    }
}



Re: [HELP] event's cars - Luca12 - 08.01.2014

How can I make for respawn all job's vehicles beacuse I have plenty job's vehicles.Thanks