what function should i use?
#9

Quote:
Originally Posted by xXitsgodzillaXx
Посмотреть сообщение
should it be like this?

pawn Код:
new VIPCar1 = 520;

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsPlayerVipType(playerid, 0))
    {
        if(IsPlayerInVehicle(playerid, VIPCar1)) // Checking the car is right or not.
        {
        SendClientMessage(playerid, COLOR_RED, "ERROR: This is a VIP only vehicle!");
        RemovePlayerFromVehicle(playerid);
        }
    }
    return 1;
}
Like this:

pawn Код:
new VIPCar1 = CreateVehicle(490,2578.1166,-2431.7924,13.6278,314.8088,0,0,5 * 60  * 1000);
// Add the above line under OnGameModeInIt Callback.

public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
    if(IsPlayerVipType(playerid, 0))
    {
        if(IsPlayerInVehicle(playerid, VIPCar1)) // Checking the car is right or not.
        {
        SendClientMessage(playerid, COLOR_RED, "ERROR: This is a VIP only vehicle!");
        RemovePlayerFromVehicle(playerid);
        }
    }
    return 1;
}
EDIT:

But you should keep this in mind too.

Quote:
Originally Posted by MP2
Посмотреть сообщение
OnPlayerEnterVehicle is called when a player STARTS to enter a vehicle. You should use OnPlayerStateChange, which will pass 'newstate' as 2 if they enter a vehicle as a driver, and if you use GetPlayerVehicleID you can check if it is a VIP vehicle or not, if so use RemovePlayerFromVehicle.
Reply


Messages In This Thread
what function should i use? - by xXitsgodzillaXx - 25.04.2012, 01:18
Re: what function should i use? - by ReneG - 25.04.2012, 01:21
Re: what function should i use? - by xXitsgodzillaXx - 25.04.2012, 01:29
Re: what function should i use? - by Azazelo - 25.04.2012, 03:27
Re: what function should i use? - by SuperViper - 25.04.2012, 03:41
Re: what function should i use? - by Ballu Miaa - 25.04.2012, 05:46
Re: what function should i use? - by MP2 - 25.04.2012, 07:09
Re: what function should i use? - by xXitsgodzillaXx - 25.04.2012, 15:55
Re: what function should i use? - by Ballu Miaa - 25.04.2012, 16:36
Re: what function should i use? - by xXitsgodzillaXx - 25.04.2012, 17:05

Forum Jump:


Users browsing this thread: 2 Guest(s)