OnPlayerEnterVehicle - 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: OnPlayerEnterVehicle (
/showthread.php?tid=413696)
OnPlayerEnterVehicle -
Luit - 06.02.2013
Hey, I've been trying to make it so you can't drive around in DMV vehicles unless you're doing the driving test. Now, I've attempted to edit the /engine command so if you attempt to do /engine while in the DMV vehicle it'll give you and error and kick you out, but I couldn't get that to work.
Is there any way to make it so it's impossible to start the engine of the vehicle unless you're doing /takedrivingtest
/takedrivingtest
Код:
CMD:takedrivingtest(playerid, params[]) {
new veh;
veh = GetPlayerVehicleID(playerid);
if(playerVariables[playerid][pLicense] == 0) {
if(veh == 1 || veh == 2 || veh == 3 || veh == 4 || veh == 5) {
DrivingTest[playerid] = 1;
SetPlayerCheckpoint(playerid, 2083.7573,-1878.4850,13.4358, 3.0);
SendClientMessage(playerid, COLOR_GREEN, "You have started your driving test! Follow the intructers orders!");
playerVariables[playerid][pMoney] -=250;
}else{
SendClientMessage(playerid, COLOR_RED, "You must be in a DMV vehicle to start your test!");
RemovePlayerFromVehicle(playerid);
}
}else{
SendClientMessage(playerid, COLOR_RED, "You already have a license, you do not need to take the test!");
RemovePlayerFromVehicle(playerid);
}
return 1;
}
Re: OnPlayerEnterVehicle -
Luit - 06.02.2013
Yeah, I realized the title was way off after I posted the thread. I managed to get it to work in the end
Ah, didn't realize the static vehicle IDs would cause so much problems with just the 5 given vehicles. Will change this.
Thanks!