SA-MP Forums Archive
How to replace random car id with the locked car id ? - 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: How to replace random car id with the locked car id ? (/showthread.php?tid=191413)



How to replace random car id with the locked car id ? - <Weponz> - 19.11.2010

How to replace random car id with the locked car id ?

pawn Код:
//Top
[B]new myMarkedCar;[/B]
 
public OnGameModeInit() //Or another callback
{
[B]myMarkedCar = CreateVehicle(400, 0.0, 0.0, 5.0, 0.0, 0,0, -1); //For example: Black Landstalker near Blueberry Acres[/B]
return 1;
}
 
//Whatever your want
public OnVehicleStreamIn(vehicleid, forplayerid)
{
[B]if(vehicleid == myMarkedCar)[/B]
{
SetVehicleParamsForPlayer(TmyMarkedCar, forplayerid, 1, 0); // marker can be visible only if the vehicle streamed for player
}
return 1;
}
Am im i trippn? Or is only going to save a Black Landstalker near Blueberry Acres??

If so how can i make it the exact car thats locked by the player?

:S

EDIT: lol i tried to BOLD where i think needs changing in the code xD

/fail


Re: How to replace random car id with the locked car id ? - PowerPC603 - 19.11.2010

In the OnVehicleStreamIn callback, at the line:

Код:
SetVehicleParamsForPlayer(TmyMarkedCar, forplayerid, 1, 0);
There seems to be an extra "T" in front of "myMarkedCar".
I'm new to scripting, but it seems that this can be the problem, as there is no TmyMarkedCar (and will be 0).