SA-MP Forums Archive
Locking vehicles - 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: Locking vehicles (/showthread.php?tid=121879)



Locking vehicles - ihatetn931 - 18.01.2010

Ok, I have my scirpt set up so if you're not taking a drivers test the driving test cars should be locked, And same with planes if you don't have a license they're locked but for some reason they're not locking like they're suppose to, So when you're taking a driver test the driver license cars becomes unlocked then after you're done it becomes locked and you can never enter it again unless you have to take the driving test. Then with planes, they are locked till you take the test and pass it, Then once you pass it all planes become unlocked but if you don't pass it all planes remain locked

pawn Код:
if(IsADLicensecar(i))
{
if(drivertest[playerid] >= 1)
{
SetVehicleParamsForPlayer(i,playerid,0,0);
}
else
{
SetVehicleParamsForPlayer(i,playerid,1,1);
}
}
It's pretty much the same with my plane system. I'm getting no errors, Just the cars/planes aren't locking at all.


Re: Locking vehicles - Josh! - 18.01.2010

pawn Код:
public OnVehicleStreamIn(vehicleid, forplayerid)
{
if(IsADLicensecar(vehicleid))
{
if(drivertest[forplayerid] >= 1)
{
SetVehicleParamsForPlayer(vehicleid,forplayerid,0,0);
}
else
{
SetVehicleParamsForPlayer(vehicleid,forplayerid,1,1);
}
}
}
0.3 will reset the locked car when it streams out, therefore you will need to use this function above.


Re: Locking vehicles - ihatetn931 - 18.01.2010

Thank you for the reply, Will give this a try