vehicle lock
#1

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
Reply
#2

Maybe that will clear this case (second Note)
Reply
#3

Show me the whole code.

Quote:
Originally Posted by Nero_3D
View Post
What if he uses ZCMD ?
Reply
#4

Why don't you use https://sampwiki.blast.hk/wiki/SetVehicleParamsEx

Quote:
Originally Posted by G4M3Ov3r
View Post
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!

Reply
#5

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)