How to detect when player gets on pizzaboy bike?
#1

So I am trying to make simple pizzaboy job, but I tried everything I could, I can't understand how to detect if player is in pizzaboy bike and then print something out to player if he is in it.

P.S Pizzaboy model id is 448 so you won't have to look it up.

Example code or any help would be appreciated
Reply
#2

Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) {
    if(GetVehicleModel(vehicleid) == 448) {
        
        SendClientMessage(playerid, -1, "You jumped on a Pizza Boy bike!");
	// do the rest
    }
    return 1;
}
Info: https://sampwiki.blast.hk/wiki/GetVehicleModel
Reply
#3

Quote:
Originally Posted by N0ri
Посмотреть сообщение
Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) {
    if(GetVehicleModel(vehicleid) == 448) {
        
        SendClientMessage(playerid, -1, "You jumped on a Pizza Boy bike!");
	// do the rest
    }
    return 1;
}
Info: https://sampwiki.blast.hk/wiki/GetVehicleModel
It's better to use OnPlayerStateChange because the player could cancel the action by moving.
Reply
#4

Thank you so much, I was trying to get it work for long time xD.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)