OnPlayerEnterVehicle bug
#1

Hi,
This code doesn't work. (except IsACopCar and IsTruckerCar) Does it have any problem?
PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    new 
Float:xFloat:yFloat:z;
    if(
GetPlayerSurfingVehicleID(playerid) == vehicleid)
    {
        new 
Float:hp;
        
GetPlayerHealth(playerid,hp);
           
GetPlayerPos(playeridxyz);
        if(!
PlayerInfo[playerid][pMask]) format(stringsizeof(string), "* %s slipped off the top of the vehicle and fell."PlayerRPName(playerid));
        else 
format(stringsizeof(string), "* Gharibe slipped off the top of the vehicle and fell.");
        
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
        
SetPlayerPos(playeridx+3y+3z+1);
        
SetPlayerHealth(playerid,hp-3);
        
PlayerPlaySound(playerid11300.00.00.0);
        
LoopingAnim(playerid,"PED","BIKE_fallR",4.0,0,1,1,1,0);
    }
    if(!
ispassenger)
    {
        if(
IsACopCar(vehicleid))
        {
            if(!
IsACop(playerid))
            {
                
displayCenterHUDInfo(playerid,  "You are not a member of the~n~~b~LSPD/FBI/SAST~w~."8); //display for 8 seconds
                
PlayerPlaySound(playerid10580.00.00.0);
                
ClearAnimations(playerid);
            }
        }
        else if(
IsTruckerCar(vehicleid))
        {
            if(
PlayerInfo[playerid][pJob] != 18)
            {
                
displayCenterHUDInfo(playerid,  "You are not a~n~~r~Trucker Driver~w~."8); //display for 8 seconds
                
PlayerPlaySound(playerid10580.00.00.0);
                
ClearAnimations(playerid);
            }
            else
               {
                
CP[playerid] = CHECKPOINT_TRUCKERLOAD;
                
SetPlayerCheckpoint(playerid,1037.4570,-1105.8281,23.9771,4);
            }
        }
        else if(
IsADLTCar(vehicleid))
        {
            if(
IsPlayerGivingDTest[playerid] == 0)
            {
                
displayCenterHUDInfo(playerid,  "Shoma hazineye Test ra pardakht nakardid!"8); //display for 8 seconds
                
PlayerPlaySound(playerid10580.00.00.0);
                
ClearAnimations(playerid);
            }
            else
            {
                
CP[playerid] = CHECKPOINT_DLTSTART;
                
SetPlayerCheckpoint(playerid,1700.4584,-1589.6927,13.3699,4);
            }
        }
        else if(
IsANGCar(vehicleid))
        {
            if(!
IsANG(playerid))
            {
                
displayCenterHUDInfo(playerid,  "You are not a member of the~n~~g~National Guard~w~."8); //display for 8 seconds
                
PlayerPlaySound(playerid10580.00.00.0);
                
ClearAnimations(playerid);
            }
        }
        else if(
IsAFBICar(vehicleid))
        {
            if(!
IsAFBI(playerid))
            {
                   
displayCenterHUDInfo(playerid,  "You are not a member of the~n~~b~FBI~w~."8); //display for 8 seconds
                
PlayerPlaySound(playerid10580.00.00.0);
                
ClearAnimations(playerid);
            }
        }
        else if(
IsATaxiCar(vehicleid) || IsABus(vehicleid))
        {
            if(
PlayerInfo[playerid][pMember] != 10 && PlayerInfo[playerid][pJob] != 14)
            {
                
displayCenterHUDInfo(playerid,  "You are not a~n~~y~Taxi Driver~w~."8); //display for 8 seconds
                
PlayerPlaySound(playerid10580.00.00.0);
                
GetPlayerPos(playeridxyz);
                
SetPlayerPos(playeridxyz);
            }
        }
        else if(
IsANewsCar(vehicleid))
        {
            if(
PlayerInfo[playerid][pMember] != && !IsAnAgent(playerid))
            {
                
displayCenterHUDInfo(playerid,  "You are not a member of the~n~~b~News Agency~w~."8); //display for 8 seconds
                
PlayerPlaySound(playerid10580.00.00.0);
                
GetPlayerPos(playeridxyz);
                
SetPlayerPos(playeridxyz);
            }
        }
        else if(
IsAnAmbulance(vehicleid))
        {
            if(
PlayerInfo[playerid][pMember] != && !IsAnAgent(playerid))
            {
                   
displayCenterHUDInfo(playerid,  "You are not a member of the~n~~r~LSMFD~w~."8); //display for 8 seconds
                
PlayerPlaySound(playerid10580.00.00.0);
                
GetPlayerPos(playeridxyz);
                
SetPlayerPos(playeridxyz);
            }
        }
        else if(
IsAVipCar(vehicleid))
        {
            if(
IsABronzeCar(vehicleid) && PlayerInfo[playerid][pDonateRank] <= 0)
            {
                   
displayCenterHUDInfo(playerid,  "~w~You are not a~n~~y~Bronze ~p~VIP~w~."8); //display for 8 seconds
                
PlayerPlaySound(playerid10580.00.00.0);
                
GetPlayerPos(playeridxyz);
                
SetPlayerPos(playeridxyz);
            }
            if(
IsASilverCar(vehicleid) && PlayerInfo[playerid][pDonateRank] <= 1)
             {
                
displayCenterHUDInfo(playerid,  "~w~You are not a ~b~~h~~h~~h~Silver ~p~VIP~w~."8); //display for 8 seconds
                
PlayerPlaySound(playerid10580.00.00.0);
                
GetPlayerPos(playeridxyz);
                
SetPlayerPos(playeridxyz);
            }
            if(
IsAGoldCar(vehicleid) && PlayerInfo[playerid][pDonateRank] <= 2)
            {
                      
displayCenterHUDInfo(playerid,  "~w~You are not a~n~~y~Gold ~p~VIP~w~."8); //display for 8 seconds
                
PlayerPlaySound(playerid10580.00.00.0);
                
GetPlayerPos(playeridxyz);
                
SetPlayerPos(playeridxyz);
            }
        }
        else if(
RapidResKitActive[playerid] == 1)
        {
            if(!
ispassenger || ispassenger)
            {
                
SendClientMessage(playeridCOLOR_GREY"You can't enter a vehicle while using a rapid response kit, '/droprrk' in order to drop it.");
                
PlayerPlaySound(playerid10580.00.00.0);
                
GetPlayerPos(playeridxyz);
                
SetPlayerPos(playeridxyz);
            }
        }
        for(new 
04i++)
        {
            if(
FacInfo[6][fCars][i] == vehicleid)
            {
                if(!
IsASenate(playerid) && !IsAnAgent(playerid))
                {
                    
displayCenterHUDInfo(playerid,  "You are not a member of the~n~~r~Senate~w~."8); //display for 8 seconds
                    
PlayerPlaySound(playerid10580.00.00.0);
                    
GetPlayerPos(playeridxyz);
                    
SetPlayerPos(playeridxyz);
                }
            }
        }
    }
      new 
Model GetVehicleModel(vehicleid);
    if(
Model == 427 && !ispassenger)
    {
        
GetPlayerArmour(playeridStoreArmour[playerid]);
    }
    else if(
PlayerTied[playerid] != 0) { ClearAnimations(playerid); }
    else if(
PlayerCuffed[playerid] != 0) { ClearAnimations(playerid); }
    else if(
PlayerFrozen[playerid] != 0) { ClearAnimations(playerid); }
    else if(
RapidResKitActive[playerid] != 0) { ClearAnimations(playerid); }
    else if(
PlayerJustDied[playerid] != 0) { ClearAnimations(playerid); }
    return 
1;

Reply


Messages In This Thread
OnPlayerEnterVehicle bug - by Alpay0098 - 01.05.2015, 08:08
Re: OnPlayerEnterVehicle bug - by Dragony92 - 01.05.2015, 14:09
Re: OnPlayerEnterVehicle bug - by Alpay0098 - 01.05.2015, 14:12
Re: OnPlayerEnterVehicle bug - by Vince - 01.05.2015, 14:43
Re: OnPlayerEnterVehicle bug - by Alpay0098 - 01.05.2015, 16:03
Re: OnPlayerEnterVehicle bug - by Alpay0098 - 01.05.2015, 19:11
Re: OnPlayerEnterVehicle bug - by Alpay0098 - 02.05.2015, 10:53
Re: OnPlayerEnterVehicle bug - by Alpay0098 - 06.05.2015, 16:48
Re: OnPlayerEnterVehicle bug - by Pottus - 06.05.2015, 16:52
Re: OnPlayerEnterVehicle bug - by Alpay0098 - 06.05.2015, 18:52

Forum Jump:


Users browsing this thread: 1 Guest(s)