/Lock command
#1

Hey Guys,

I'm currently trying to fix the lock command for my server but it doesn't seem to work...

When i lock i also have this line:

pawn Код:
SetVehicleParamsForPlayer(carid, playerid, 0, 1);
And it's also called in OnVehicleStreamIn but still i'm able to enter while it's locked, i don't understand it anymore.

Please help someone.
Thanks.
Reply
#2

pawn Код:
stock LockVehicle(vehicleid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConencted(i))
        {
            SetVehicleParamsForPlayer(vehicleid, i, 0, 1);
            VehicleLocked[vehicleid] = true;
        }
    }
    return 1;
}

stock UnlockVehicle(vehicleid)
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConencted(i))
        {
            SetVehicleParamsForPlayer(vehicleid, i, 0, 0);
            VehicleLocked[vehicleid] = false;
        }
    }
    return 1;
}

stock IsVehicleLocked(vehicleid)
{
    return VehicleLocked[vehicleid];
}
Reply
#3

Doesn't work..
Reply
#4

Of course it won't if you don't use them.. their are stocks, use your skill to apply them to your script, it's easy, or at least try, if you can't, just ask here.
Reply
#5

Quote:
Originally Posted by The_Moddler
Посмотреть сообщение
Of course it won't if you don't use them.. their are stocks, use your skill to apply them to your script, it's easy, or at least try, if you can't, just ask here.
Like i said, it doesn't work and yes i did try -.-

I think it has something to do with the car row so ill test that now.
Reply
#6

Quote:
Originally Posted by juuleman
Посмотреть сообщение
Like i said, it doesn't work and yes i did try -.-

I think it has something to do with the car row so ill test that now.
Show me the code, you did it wrong then, it work fine for me.
Reply
#7

Quote:
Originally Posted by The_Moddler
Посмотреть сообщение
Show me the code, you did it wrong then, it work fine for me.
I fixed it, and as i expected it was a problem with the car row. (So your script probably was fine)

Thanks for the help anyway.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)