problem with car script
#1

****
Reply
#2

If you could narrow the source of the problem a little more, I'd help you out...

Start with trying to find where the vehicle is added to the server maybe?
This being RP, I would leave it not respawning after being destroyed though (But thats just my opnion)

Anyways, this is too much code for me to shift through, try to narrow it down a bit more
Reply
#3

the problem is when i do /vpark the coordinates of the car are saved
but the function " SetVehicleToRespawn(i);" don't allow to respawn the vehicle to the parked position.
Reply
#4

Ah... Okay

You'll have to store those vehicle cordinates in varibles and when that vehicle respawns, teleport it back to those saved cordinates, that should fix the problem then. Or it might actually be better to just remove the vehicle, then add the vehicle again teleporting it to the driver, then putting the driver inside. That way you wont have to worry about it again cuz you spawn the vehicle with the new saved cordinates

Which ever method you choose should work though
Reply
#5

i already made that
Код:
public OnVehicleSpawn(vehicleid)
{
	new playerid;
	for(new i = 0; i < MAX_VEHICLES; i++)
	if(dini_Exists(VFile(i)))
	{
	    SetVehicleNumberPlate(i, dini_Get(VFile(i), "Plate"));
     	if(VehicleInfoCarOwn[i][Parkedcarown] == 1)
	    {
    		 SetVehiclePos(i, dini_Float(VFile(GetPlayerVehicleID(playerid)), "X"), dini_Float(VFile(GetPlayerVehicleID(playerid)), "Y"), dini_Float(VFile(GetPlayerVehicleID(playerid)), "Z"));
		}
	}
    return 1;
}
but the vehicle don't spawn to the saved position
Reply
#6

bump
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)