Stuck on error making boat missions
#1

Hi all,

Im making some boat missions but now im stuck with the vehicle id. I cannot get the vehicle-model of a player.
look:
pawn Код:
forward boat(playerid);
// This callback gets called whenever a player enters a checkpoint
public OnPlayerEnterCheckpoint(playerid)
{
    new vehicleid[10];
    GetPlayerVehicleID(playerid, vehicleid, sizeof (vehiceid));

    if(GetVehicleModel(vehicleid) == 472) // 472 is the Coastguard model
    {
        TogglePlayerControllable(playerid,0);
        SetTimer("boat", 4000, false);
    }
// .....etc.....
Now how can I get the vehicle ID, to get the vehicleId to get the vehicle model?

Hope you understand what I mean, otherwise I will explain more...

what I need:
The vehicleID of the player, to get the vehicle model

let me know,

thnx
Reply
#2

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    new vehicleid;
    if(IsPlayerInAnyVehicle(playerid))
    {
        vehicleid = GetPlayerVehicleID(playerid);
        if(GetVehicleModel(vehicleid) == 472) // 472 is the Coastguard model
        {
            //your code
        }
    }
    //---or---
    if(IsPlayerInVehicle(playerid, 472/*<<vehicleid*/))
    {
        //your code
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)