SA-MP Forums Archive
[Ajuda] Como vejo o tipo de carro que o player entrou? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: Non-English (https://sampforum.blast.hk/forumdisplay.php?fid=9)
+--- Forum: Languages (https://sampforum.blast.hk/forumdisplay.php?fid=33)
+---- Forum: Português/Portuguese (https://sampforum.blast.hk/forumdisplay.php?fid=34)
+---- Thread: [Ajuda] Como vejo o tipo de carro que o player entrou? (/showthread.php?tid=648989)



Como vejo o tipo de carro que o player entrou? - SamuelMatheus05 - 31.01.2018

Olб quero fazer sistema de habilitaзгo mas quero descobrir um jeito de ver se o player entro em um carro, moto, helicoptero etc, se alguem puder me ajudar agradeзo


Re: Como vejo o tipo de carro que o player entrou? - Nizarh - 31.01.2018

Olб, estгo aqui umas Functions do Sa-mp

IsPlayerInAnyVehicle - Verifica se o player estб em algum Veiculo.
IsPlayerInVehicle - Verifica se o player estб em Veiculo Indicado.
IsTrailerAttachedToVehicle - Check if a vehicle has a trailer attached
IsVehicleStreamedIn - Check if a vehicle is streamed in for a certain player
LinkVehicleToInterior - Link a vehicle into an interior
PlayerSpectateVehicle - Make a player spectate a vehicle
PutPlayerInVehicle - Put a player in a vehicle
RemovePlayerFromVehicle - Remove a player from their vehicle
RemoveVehicleComponent - Remove a component from a vehicle
RepairVehicle - Repair a vehicle (visual damage + engine)
SetVehicleHealth - Set a vehicle's health (engine)
SetVehicleParamsForPlayer - Set the parameters of a vehicle for a player (locked, objective)


Re: Como vejo o tipo de carro que o player entrou? - SpikeCompiler - 31.01.2018

Quando o player sentar no banco: https://sampwiki.blast.hk/wiki/OnPlayerStateChange

Quando apertar 'F' para entrar: https://sampwiki.blast.hk/wiki/OnPlayerEnterVehicle

Espero ter ajudado.


Re: Como vejo o tipo de carro que o player entrou? - Lуs - 31.01.2018

Vocк vai usar uma funзгo chamada GetVehicleModel que retorna o modelo do veнculo, depois vai verificar qual o tipo do veнculo, como o exemplo de bicicletas abaixo:

PHP код:
IsBike(carid) {
    new 
Bikes[] = { 509481510 };
    for(new 
0sizeof(Bikes); i++)  {
        if(
GetVehicleModel(carid) == Bikes[i]) return 1;
    }
    return 
0;