SA-MP Forums Archive
Vehicle still locked. - 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 still locked. (/showthread.php?tid=657847)



Vehicle still locked. - AzaMx - 16.08.2018

Hi, I got a problem with this system, still locked even tho I already set it to unlocked when car respawned.

PHP Code:
    if(strcmp(Vehicles[vehicleid][carowner],"NoBodY"false6) || Vehicles[vehicleid][carteam] != NO_TEAM_CAR)
    {
        
UnlockVehicle(Vehicles[vehicleid][vrID]);
    }
    else
    {
        
LockVehicle(-1,Vehicles[vehicleid][vrID]);
    } 



Re: Vehicle still locked. - Shockey HD - 16.08.2018

Show us your LockVehicle function?


Re: Vehicle still locked. - AzaMx - 16.08.2018

PHP Code:
stock LockVehicle(playeridvehicleid)
{
    for(new 
iMAX_PLAYERSi++) if(IsPlayerConnected(i) && != playeridSetVehicleParamsForPlayer(vehicleidi01);
    
Vehicles[FindVehicleID(vehicleid)][tmplocked] = 1;
    
Vehicles[FindVehicleID(vehicleid)][tmplockedby] = playerid;
}
stock UnlockVehicle(vehicleid)
{
    for(new 
iMAX_PLAYERSi++) if(IsPlayerConnected(i)) SetVehicleParamsForPlayer(vehicleidi00);
    
Vehicles[FindVehicleID(vehicleid)][tmplocked] = 0;
    
Vehicles[FindVehicleID(vehicleid)][tmplockedby] = -1;