(HELP) /v lock
#1

Hey, when I lock my car is locked and logout and login back my car is opened, i dont know why?
Someone know?

You can look on this
pawn Код:
else if(strcmp(x_nr,"lock1",true) == 0)
            {
                new keycar = PlayerInfo[playerid][pPcarkey];
                if(keycar != 999)
                {
                    new locked[256];
                    locked = strtok(cmdtext, idx);
                    if(CarInfo[keycar][cLock] == 1)
                    {
                        for(new i = 0; i < MAX_PLAYERS; i++)
                        {
                            if (IsPlayerConnected(i))
                            {
                                SetVehicleParamsForPlayer(keycar,i,0,0);
                            }
                        }
                        format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked");
                        GameTextForPlayer(playerid, string, 4000, 3);
                        CarInfo[keycar][cLock] = 0;
                        OnPropUpdate();
                        return 1;
                    }
                    else if(CarInfo[keycar][cLock] == 0)
                    {
                        for(new i = 0; i < MAX_PLAYERS; i++)
                        {
                            if (IsPlayerConnected(i))
                            {
                                SetVehicleParamsForPlayer(keycar,i,0,1);
                            }
                        }
                        format(string, sizeof(string), "~w~Vehicle~n~~r~Locked");
                        GameTextForPlayer(playerid, string, 4000, 3);
                        CarInfo[keycar][cLock] = 1;
                        OnPropUpdate();
                        return 1;
                    }
Reply
#2

You have to check again the car ( if it's locked or not ), at OnVehicleStreamIn ...
Reply
#3

You could also set a vehicle lock timer if you want the car to automatically unlock itself after lets say 30 minutes, 60 minutes, etc.
Reply
#4

I don't want, I want them lock for always
Reply
#5

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
    if(CarInfo[vehicleid][cLock] == 1)
    {
        SetVehicleParamsForPlayer(vehicleid,forplayerid,0,1);
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)