[Ajuda] Verificar se jб tem motorista no carro
#3

PHP код:
public OnPlayerEnterVehicle(playeridvehicleidispassenger)
{
    if (
VeiculoOcupado(vehicleid)) {

        new 
Float:Pos[4];

        
GetPlayerPos(playeridPos[0], Pos[1], Pos[2]);
        
SetPlayerPos(playeridPos[0], Pos[1], Pos[2]);

        return 
SendClientMessage(playerid, -1"Este veнculo estб ocupado.");
    }
    return 
1;
}

stock VeiculoOcupado(vehicleid)
{
    for(new 
i!= MAX_PLAYERS; ++i) {
        if (
GetPlayerVehicleID(i) == vehicleid && GetPlayerState(i) == PLAYER_STATE_DRIVER) return true;
    }
    return 
false;

Uma base par vocк, usando dessa forma vai evitar do player entrar no veнculo caso tenha um motorista.
Reply


Messages In This Thread
Verificar se jб tem motorista no carro - by SmokeKiLL - 16.02.2019, 23:37
Re: Verificar se jб tem motorista no carro - by willttoonn - 16.02.2019, 23:45
Re: Verificar se jб tem motorista no carro - by wearLy - 17.02.2019, 06:25
Re: Verificar se jб tem motorista no carro - by SmokeKiLL - 18.02.2019, 15:28
Re: Verificar se jб tem motorista no carro - by ipsLuan - 18.02.2019, 15:43
Re: Verificar se jб tem motorista no carro - by SmokeKiLL - 18.02.2019, 16:06
Re: Verificar se jб tem motorista no carro - by ipsLuan - 18.02.2019, 16:10
Re: Verificar se jб tem motorista no carro - by SmokeKiLL - 18.02.2019, 16:14

Forum Jump:


Users browsing this thread: 1 Guest(s)