GetPlayerVehicleID Help
#4

That specified vehicle may or may not have vehicle ID 81 so you have to store its vehicle ID in a global variable when creating the vehicle. After that, all have left is to compare it and you actually have the vehicle ID as parameter:
pawn Код:
// global:
new gDodo;

// creating the vehicle:
gDodo = CreateVehicle(..); // or by AddStaticVehicle(Ex)

// OnPlayerEnterVehicle:
if (vehicleid == gDodo)
{
    // send message..
}
@Above users: The model ID of "Dodo" is 593.

EDIT: Just to clarify the problem, the player is NOT in vehicle yet so GetPlayerVehicleID returns 0.
OnPlayerEnterVehicle is called when the player is starting the animation to enter the vehicle. You might use OnPlayerStateChange if you prefer.
Reply


Messages In This Thread
GetPlayerVehicleID Help - by KingOfStarfox - 11.08.2016, 16:22
Re: GetPlayerVehicleID Help - by Luicy. - 11.08.2016, 16:27
Re: GetPlayerVehicleID Help - by WhiteGhost - 11.08.2016, 16:27
Re: GetPlayerVehicleID Help - by Konstantinos - 11.08.2016, 16:28
Re: GetPlayerVehicleID Help - by Luicy. - 11.08.2016, 16:30
Re: GetPlayerVehicleID Help - by KingOfStarfox - 11.08.2016, 17:04

Forum Jump:


Users browsing this thread: 1 Guest(s)