need help with car wanted level - 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: need help with car wanted level (
/showthread.php?tid=612115)
need help with car wanted level -
CarRamper - 14.07.2016
Hello Guys i Want to give each car on my server a number/ID and want that if a player enters car on some of the ids he get's wanted only some cars not all and also that if the player had recently entered the car them if he again enter the wanted car he will not get wanted.how i can go that
Re: need help with car wanted level -
Freaksken - 14.07.2016
Vehicles on your server already have an ID, to get this ID you need to use
CreateVehicle. Use this instead of AddStaticVehicle(Ex).
Код:
//Top of your script
new WantedCar = INVALID_VEHICLE_ID;
//Where you create your vehicle (could be OnGameModeInit)
WantedCar = CreateVehicle(...);
//OnPlayerStateChange
if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_ONFOOT) {
if(GetPlayerVehicleID(playerid) == WantedCar) {
SetPlayerWantedLevel(...);
}
}