SA-MP Forums Archive
lock cars on spawn. - 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: lock cars on spawn. (/showthread.php?tid=384060)



lock cars on spawn. - ThamburaaN - 10.10.2012

hi, i have created a command script for spawning cars(/veh), which is only for admins. but i dont know how to add lock on spawn system. like when i spawn a car, only admins can use it[which is locked for other players].

and it should only work with that command only.

someone please help me with this.
Thanks.


Re: lock cars on spawn. - ViniBorn - 10.10.2012

Simple example
pawn Код:
//OnPlayerEnterVehicle
if(vehicleid == CAR_SPAWNED) // you need to save the id of the spawned car
{
    if(!IsPlayerAdmin(playerid))
    {
        new VBPos[3];
        GetPlayerPos(playerid,VBPos[0],VBPos[1],VBPos[2]);
        SetPlayerPos(playerid,VBPos[0],VBPos[1],VBPos[2]);
    }
}



Re: lock cars on spawn. - ThamburaaN - 10.10.2012

i want some kind of code like when normal player enter vehicle. they should get ejected with message. 'admin only vehicle'