vehicle lock - 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)
+--- Thread: vehicle lock (
/showthread.php?tid=278927)
vehicle lock -
jaksimaksi - 24.08.2011
okay ive got vehicle ownership system, there is a callback who loadsvehicles, everything loads exceps vehicle lock
pawn Code:
SetVehicleParamsForPlayer(veh1[playerid], playerid, 0, VehicleInfo[veh1[playerid]][vLock]);
why vehicle is not locking? Variable vLock saves as 1 when i type /lock
AW: vehicle lock -
Nero_3D - 24.08.2011
Maybe that will clear this case (second Note)
Re: vehicle lock -
=WoR=G4M3Ov3r - 24.08.2011
Show me the whole code.
Quote:
Originally Posted by Nero_3D
|
What if he uses ZCMD ?
Re: vehicle lock -
=WoR=Varth - 24.08.2011
Why don't you use
https://sampwiki.blast.hk/wiki/SetVehicleParamsEx
Quote:
Originally Posted by G4M3Ov3r
What if he uses ZCMD ?
|
What are you talking about?
Quote:
Note: From 0.3 you will have to re-apply this function when OnVehicleStreamIn is called!
|
Re: vehicle lock -
iggy1 - 24.08.2011
There is a bug with locking doors, if the vehicle is locked for a player and then the vehicle is streamed out- it will then be unlocked (when streamed in). There is a workaround by locking the vehicle inside the "OnVehicleStreamIn" callback.
EG,
pawn Code:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
if(gVehicleLocked[vehicleid]) //swap this for the var you use to check if the vehicle is locked
SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
return 1;
}
EDIT: Sorry i used playerid instead of forplayerid.