19.02.2016, 14:14
Im create restricted vehicles for police car.
then onplayerstate
that code not work, when im use this code
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 ^_^
PHP код:
new polisi[10];
//OnGameModeInit
polisi[0]=createvehicle(policecar)
polisi[1] = bla bla bla
PHP код:
if(newstate == 2)
{
new CarCheck = GetPlayerVehicleID(playerid);for (new c = 0; c < MAX_PLAYERS; c++)
if(CarCheck == Polisi[c])
{
new playerState = GetPlayerState(playerid);
if(playerState == PLAYER_STATE_DRIVER && PlayerInfo[playerid][pFaction] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "Kendaraan khusus Polisi");
return 1;
}
}
}
}
PHP код:
if(newstate == 2)
{
new CarCheck = GetPlayerVehicleID(playerid);for (new c = 0; c < MAX_PLAYERS; c++)
if(CarCheck == Polisi[c])
{
if( PlayerInfo[playerid][pFaction] != 1)
{
RemovePlayerFromVehicle(playerid);
SendClientMessage(playerid, COLOR_RED, "Kendaraan khusus Polisi");
return 1;
}
}
}
}
sory for my bad english ^_^