What's wrong with IsPlayerInVehicle(playerid,vehicleid);
#1

pawn Код:
public OnPlayerStateChange(playerid, newstate, oldstate)
{
    if(oldstate == PLAYER_STATE_ONFOOT && newstate == PLAYER_STATE_DRIVER){
        if(IsPlayerInVehicle(playerid,482)){
            print("player in burrito");
            TogglePlayerDynamicCP(playerid,businesscp_id,1);
        }
    }
    return 1;
}
I don't understand why the instruction if with this function doesn't works, is very strange, if i remove it, all works fine, the CP toggle on for player, but when i add this instruction, it considers as if im not in this vehicle id.. why?
Reply
#2

You need to use GetVehicleModel instead. Pay close attention to the name of the parameters. If it says "vehicleid" it means the unique id of the vehicle, ranging from 1 to 2000. If it says "modelid" it refers to the vehicle's non-unique model, ranging from 400 to 611.
Reply
#3

Quote:
Originally Posted by Vince
Посмотреть сообщение
You need to use GetVehicleModel instead. Pay close attention to the name of the parameters. If it says "vehicleid" it means the unique id of the vehicle, ranging from 1 to 2000. If it says "modelid" it refers to the vehicle's non-unique model, ranging from 400 to 611.
Hell yeah, i have look right now in Wiki samp and i have understand the same of you have explain me, anyways, thanks for the help, buddy.. +repped.
Reply


Forum Jump:


Users browsing this thread: