problem with car script - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: problem with car script (
/showthread.php?tid=275861)
problem with car script -
jasonnw666 - 11.08.2011
****
Re: problem with car script -
XGh0stz - 11.08.2011
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
Re : problem with car script -
jasonnw666 - 11.08.2011
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.
Re: problem with car script -
XGh0stz - 11.08.2011
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
Re : problem with car script -
jasonnw666 - 11.08.2011
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
Re : problem with car script -
jasonnw666 - 11.08.2011
bump