PLAYER_STATE_DRIVER
#1

Im create restricted vehicles for police car.
PHP код:
new polisi[10];
//OnGameModeInit
polisi[0]=createvehicle(policecar)
polisi[1] = bla bla bla 
then onplayerstate
PHP код:
if(newstate == 2)
        {
              new 
CarCheck GetPlayerVehicleID(playerid);for (new 0MAX_PLAYERSc++)
            if(
CarCheck == Polisi[c])
            {
                   new 
playerState GetPlayerState(playerid);
                if(
playerState == PLAYER_STATE_DRIVER && PlayerInfo[playerid][pFaction] != 1)
                {
                    
                    
RemovePlayerFromVehicle(playerid);
                    
SendClientMessage(playeridCOLOR_RED"Kendaraan khusus Polisi");
                     return 
1;
                }
            }
}

that code not work, when im use this code
PHP код:
if(newstate == 2)
        {
              new 
CarCheck GetPlayerVehicleID(playerid);for (new 0MAX_PLAYERSc++)
            if(
CarCheck == Polisi[c])
            {
                   
                if( 
PlayerInfo[playerid][pFaction] != 1)
                {
                    
                    
RemovePlayerFromVehicle(playerid);
                    
SendClientMessage(playeridCOLOR_RED"Kendaraan khusus Polisi");
                     return 
1;
                }
            }
}

this work , but when passanger get in to car eject from car. i want eject just driver when not at faction. any solution??

sory for my bad english ^_^
Reply
#2

You are creating / comparing vehicles in a very poor way to start with but if it helps https://sampwiki.blast.hk/wiki/GetPlayerVehicleSeat
Reply
#3

owh thank for link dude
Reply
#4

code work now but just fagio not work. i create 4 fagio with aray but just fagio[0] eject driver , other fagio cannot eject driver and same case with pizza bike . IDK where my mistake i use same code like code for police .

police car work but fagio and pizza bike not work
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)