Strange problem with OnPlayerEnterVehicle
#1

This script works when its under OnPlayerStateChange:
PHP код:
    if(newstate == 2)
    {
        new 
CarCheck GetPlayerVehicleID(playerid);
        if(
CarCheck == Cars[Taxi1] || CarCheck == Cars[Taxi2] || CarCheck == Cars[Taxi3] || CarCheck == Cars[Taxi4] || CarCheck == Cars[Taxi5] || CarCheck == Cars[Taxi6] || CarCheck == Cars[Taxi7] || CarCheck == Cars[Taxi8] || CarCheck == Cars[Taxi8] || CarCheck == Cars[Taxi9] || CarCheck == Cars[Taxi10] || CarCheck == Cars[Taxi11] || CarCheck == Cars[Taxi12] || CarCheck == Cars[Taxi13] || CarCheck == Cars[Taxi14] || CarCheck == Cars[Taxi15] || CarCheck == Cars[Taxi16] || CarCheck == Cars[Taxi17] )
        {
            if(
PlayerInfo[playerid][pJob] != JOB_TAXIDRIVER)
            {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_ORANGE" You can't start the engine as it belongs to the Taxi Drivers.");
            return 
1;
            }
        }
        new 
CarCheck2 GetPlayerVehicleID(playerid);
        if(
CarCheck2 == Cars2[Mech1] || CarCheck2 == Cars2[Mech2] || CarCheck2 == Cars2[Mech3] || CarCheck2 == Cars2[Mech4] || CarCheck2 == Cars2[Mech5] )
        {
            if(
PlayerInfo[playerid][pJob] != JOB_MECHANIC)
            {
            
RemovePlayerFromVehicle(playerid);
            
SendClientMessage(playeridCOLOR_ORANGE" You can't start the engine as it belongs to the Mechanics.");
            return 
1;
            }
        }
    } 
But when i put it under OnPlayerEnterVehicle it dont work(I remove the line if(newstate == 2))
Reply


Messages In This Thread
Strange problem with OnPlayerEnterVehicle - by barts - 29.01.2014, 09:18
Re: Strange problem with OnPlayerEnterVehicle - by Scottas - 29.01.2014, 09:56
Re: Strange problem with OnPlayerEnterVehicle - by barts - 29.01.2014, 10:00
Re: Strange problem with OnPlayerEnterVehicle - by Threshold - 29.01.2014, 10:58

Forum Jump:


Users browsing this thread: 1 Guest(s)