SA-MP Forums Archive
/Lock command - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: /Lock command (/showthread.php?tid=190480)



/Lock command - juuleman - 15.11.2010

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.


Re: /Lock command - The_Moddler - 15.11.2010

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];
}



Re: /Lock command - juuleman - 15.11.2010

Doesn't work..


Re: /Lock command - The_Moddler - 15.11.2010

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.


Re: /Lock command - juuleman - 15.11.2010

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.


Re: /Lock command - The_Moddler - 15.11.2010

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.


FIXED - juuleman - 15.11.2010

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.