09.01.2018, 15:50
You can use this method to check what model the car is.
we know that a pizzaboy is the id: 448 (https://sampwiki.blast.hk/wiki/Vehicle_Model_ID_List)
Then we can check if the model the player sits in, is equal to 448 by doing the following:
https://sampwiki.blast.hk/wiki/GetVehicleModel
https://sampwiki.blast.hk/wiki/GetPlayerVehicleID
You may also want to check if the player is in a vehicle before doing this. That can be done by using "IsPlayerInVehicle(playerid)" (https://sampwiki.blast.hk/wiki/IsPlayerInVehicle)
we know that a pizzaboy is the id: 448 (https://sampwiki.blast.hk/wiki/Vehicle_Model_ID_List)
Then we can check if the model the player sits in, is equal to 448 by doing the following:
PHP код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 448)
return SendClientMessage(playerid, -1, "You need to be in the pizzaboy!");
https://sampwiki.blast.hk/wiki/GetPlayerVehicleID
You may also want to check if the player is in a vehicle before doing this. That can be done by using "IsPlayerInVehicle(playerid)" (https://sampwiki.blast.hk/wiki/IsPlayerInVehicle)