OnPlayerEnterVehicle help
#6

Hmm.. If you wan't to make them unable to enter the vehicle, you could do it by one way, is to clearing animations.

PHP код:
public OnPlayerEnterVehicle(playeridvehicleid)
{
    new 
vmodel GetVehicleModel(vehicleid);
    new 
Float:xFloat:yFloat:z;
    
GetPlayerPos(playeridxyz);
    if(
pInfo[playerid][pLic1] == 1)
    {
        if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
        {
            if(
pInfo[playerid][pGroup] == && cInfo[vehicleid][cGroup] > 0)
            {
                
SetPlayerPos(playeridxyz+3);
                if(
cInfo[vehicleid][cGroup] == 1)
                {
                    
SendClientMessage(playerid, -1"You are not part of Los Santos Police Department.");
                }
            }
            else if(
pInfo[playerid][pGroupRank] < cInfo[vehicleid][cRank])
            {
                new 
rank cInfo[vehicleid][cRank];
                new 
string[256];
                
format(stringsizeof(string), "You must be a rank %d police officer to drive this car."rank);
                
SendClientMessage(playerid, -1string);
            }
        }
        else return 
0;
    }
    else
    {
        if(
vmodel == 481 || vmodel == 510 || vmodel == 509)
        {
            new 
enginelightsalarmdoorsbonnetbootobjective;
            
GetVehicleParamsEx(vehicleidenginelightsalarmdoorsbonnetbootobjective);
            
SetVehicleParamsEx(vehicleidVEHICLE_PARAMS_ONlightsalarmdoorsbonnetbootobjective);
        }
        else if(
vmodel == 462)
        {
            return 
0;
        }
        else
        {
            if(
GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
            {
                
SetPlayerPos(playeridxyz+3);
                  
ClearAnimations(playerid); // Edited
                        
SendClientMessage(playerid, -1"You don't have a drivings license, a checkpoint has been set on your map.");
                
SetPlayerCheckpoint(playerid1219.1997,-1811.9343,16.59385);
                return 
1;
            }
            else return 
0;
        }
    }
    return 
1;

Reply


Messages In This Thread
OnPlayerEnterVehicle help - by danielpalade - 02.02.2016, 21:47
Re: OnPlayerEnterVehicle help - by Rufio - 02.02.2016, 21:50
Re: OnPlayerEnterVehicle help - by Jefff - 02.02.2016, 21:51
Re: OnPlayerEnterVehicle help - by danielpalade - 02.02.2016, 22:11
Re: OnPlayerEnterVehicle help - by Rufio - 02.02.2016, 22:21
Re: OnPlayerEnterVehicle help - by KillerDVX - 02.02.2016, 22:38
Re: OnPlayerEnterVehicle help - by DarkClone - 03.02.2016, 02:28

Forum Jump:


Users browsing this thread: 1 Guest(s)