Vehicle Spawn Command
#1

Okay, I'm having a problem with a vehicle spawn command.
I was using FSDEBUG v0.5d by Simon Campbell, the /v command.
Now I have converted most of the important commands like /t, /v, /s, /w to my gamemode, so I can make them compatible with it, everything works, including the /v command.. except one little thing.
with fsdebug loaded: /v lspd spawns a black-white LSPD vehicle(always that colour).
with fsdebug unloaded, using same command but then from my gamemode: /v lspd spawns a random coloured LSPD vehicle.. never black and white.. how is that possible?

FSDEBUG createvehicle line.

pawn Код:
curPlayerVehI[playerid] = CreateVehicle(idx, x, y, z + 2.0, a + 90.0, -1, -1, 5000);
and my GM

pawn Код:
car = CreateVehicle(idx, x, y, z + 2.0, a + 90.0, -1, -1,-1);
and no, in both scripts theres nothing with changevehiclecolor except /changecolour in my gamemode..
My friends thought this was a hilarious glitch, it's bugging me though.

edit: I might have an idea why this isn't working, i have GetVehicleColor included in my script, as i remember it re-creates the vehicle with a random vehicle colour, stores it in a variable so u can save it. i'll check it right now.

edit 30 seconds after the previous edit:
if(color1 < 0 || color2 < 0)
{
color1 = random(127);
color2 = random(127);
}
obviously thats the bug. i'll edit it, and check if it works.

Ok, I made a little stock function inside the include, checking if the modelid has a default colour, if it does, don't randomize the colour. and it worked. SOLVED
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)