CreateVehicle
#1

Hey guys just wondering is it possible when using the command:

CreateVehicle(541, X+4, Y+4, Z + 3.0, Angle + 90.0, -1, -1, -1);

So you dont respawn the vehicle once it has blown as i was planning on using this
to create a vehicle shop which is useless if your paying for a car that respawns non stop lol
Reply
#2

pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
    return 1;
}
Add some if statements to it like If(rentcar == 1) then under that
create the vehicle again at the players position.
Reply
#3

Ahh okay ill have a look at doing this now thanks although instead of recreating the vehicle at players pos i will be able to remove it completely if its been blown once?
I dont want it so when you buy one car you can keep using it even if blown once or twice
Reply
#4

Check out the DestroyVehicle command:
https://sampwiki.blast.hk/wiki/DestroyVehicle

Pseudo-code:
Код:
public OnVehicleDeath(vehicleid, killerid)
{
    if (rentcar == 1)
    {
        DestroyVehicle(vehicleid);
    }

    return 1;
}
Reply
#5

Hmm i really dont get how to do that though lol as im using Garsino Car Menu just changing it so that there is less cars and a checkpoint to get the cars instead of command.
Reply
#6

Okay so i managed to get vehicles to stop spawning but it stopped every vehicle from spawning i tried using
AddStaticVehicle/Ex/CreateVehicle Still wouldnt spawn i added this also

for(new i = 0; i < MAX_VEHICLES; i++)
{
SetVehicleToRespawn(i);
}

Still nothing, here is the code i was using to create vehicles

http://pastebin.com/WxfLHsPv

I added DestroyVehicle(vehicleid); under OnVehicleDeath but well idk how to add if statements unders OnVehicleDeath as everything i was trying would give me similar results to this

function heading differs from prototype

Any help would be Awsome!
Reply
#7

Bumpy bump
Reply
#8

Barney, read stickies:
Quote:

b) Do not bump
Some people apparently think they are important enough to bump their own topic after 10 minutes.
You can bump topics when the last reply is at least 48 hours old, and it needs to have useful information about your problem.

At your question, I have no idea what you mean.
Reply
#9

Lol why bother posting that its not like i bumped it 10 minutes later... and ive read on other posts 12 hours/24 hours now 48..
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)