Vehicle still locked.
#1

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", false, 6) || Vehicles[vehicleid][carteam] != NO_TEAM_CAR)
    {
        
UnlockVehicle(Vehicles[vehicleid][vrID]);
    }
    else
    {
        
LockVehicle(-1,Vehicles[vehicleid][vrID]);
    } 
Reply
#2

Show us your LockVehicle function?
Reply
#3

PHP Code:
stock LockVehicle(playerid, vehicleid)
{
    for(new 
i; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && i != playerid) SetVehicleParamsForPlayer(vehicleid, i, 0, 1);
    
Vehicles[FindVehicleID(vehicleid)][tmplocked] = 1;
    
Vehicles[FindVehicleID(vehicleid)][tmplockedby] = playerid;
}
stock UnlockVehicle(vehicleid)
{
    for(new 
i; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i)) SetVehicleParamsForPlayer(vehicleid, i, 0, 0);
    
Vehicles[FindVehicleID(vehicleid)][tmplocked] = 0;
    
Vehicles[FindVehicleID(vehicleid)][tmplockedby] = -1;
} 
Reply


Forum Jump:


Users browsing this thread: