not working :x
#3

The IsPlayerInAnyVehicle function will only ever return 0 or 1. You are comparing it to 571, which it will never be. This is why your != statement always passes and goes on to show the client message.

I believe the correct usage of the IsPlayerInAnyVehicle function in this case would be:
pawn Код:
if(IsPlayerInAnyVehicle(playerid)) // if this is true(1), it will pass. if this is false(0), it will fail.
{
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 571) // check to see if the vehicle is a kart
    {
        RemovePlayerFromVehicle(playerid);
        SendClientMessage(playerid,orange,"You cant be near kart circuit here with a vehicle");
    }
}
GetPlayerVehicleID will return the in-game vehicle ID that a player is in.
GetVehicleModel will return the model ID of a vehicle

Remember that vehicle ID and model ID are different things!
Reply


Messages In This Thread
not working :x - by MestreKiller - 20.12.2010, 15:00
Re: not working :x - by Alex_Valde - 20.12.2010, 15:14
Re: not working :x - by Benjo - 20.12.2010, 15:16

Forum Jump:


Users browsing this thread: 2 Guest(s)