[Ajuda] Verificar veiculo
#1

Entгo galera eu procurei no Search e encontrei oque eu queria, a resposta estava na Wiki mais eu tentei fazer mais nгo deu certo, tipo, meu servidor tem 8 carros civis contando com o 0, ai como verifico se o player entro em algum desses 8 carros? eu fiz assim CivilCar[0], CivilCar[1]... e assim vai

Code:
if(IsPlayerInVehicle(playerid,CivilCar))
Mais como verifico todos nesse codigo ai?
Reply
#2

PHP Code:
//topo//
new vCivilCar[3];
//veiculo//
    
vCivilCar[0] = AddStaticVehicleEx(525,2116.8000000,-2075.8999000,13.5000000,133.9950000,255,1,300); //Tow Truck
    
vCivilCar[1] = AddStaticVehicleEx(525,2110.3999000,-2068.8999000,13.5000000,133.9950000,255,1,300); //Tow Truck
    
vCivilCar[2] = AddStaticVehicleEx(525,2113.4004000,-2072.3994000,13.5000000,133.9950000,255,1,300); //Tow Truck
public OnPlayerStateChange(playeridnewstateoldstate)
{
    new
       
veiculo GetPlayerVehicleID(playerid)
    ;
        if(
veiculo == vCivilCar[0] || veiculo == vCivilCar[1] || veiculo == vCivilCar[2])
        {
            if(
PlayerInfo[playerid][pProfissao] != CivilCar)
            {
                
RemovePlayerFromVehicle(playerid); 
                
SendClientMessage(playeridC_CivilCar"[ x ] Este veнculo й reservado para os CivilCar");
                
PlayerPlaySound(playerid11470.00.00.0);
                return 
1;
            }
        }
    }
    return 
1;

Assim??
Reply
#3

Quote:
Originally Posted by zDark
View Post
PHP Code:
//topo//
new vCivilCar[3];
//veiculo//
    
vCivilCar[0] = AddStaticVehicleEx(525,2116.8000000,-2075.8999000,13.5000000,133.9950000,255,1,300); //Tow Truck
    
vCivilCar[1] = AddStaticVehicleEx(525,2110.3999000,-2068.8999000,13.5000000,133.9950000,255,1,300); //Tow Truck
    
vCivilCar[2] = AddStaticVehicleEx(525,2113.4004000,-2072.3994000,13.5000000,133.9950000,255,1,300); //Tow Truck
public OnPlayerStateChange(playeridnewstateoldstate)
{
    new
       
veiculo GetPlayerVehicleID(playerid)
    ;
        if(
veiculo == vCivilCar[0] || veiculo == vCivilCar[1] || veiculo == vCivilCar[2])
        {
            if(
PlayerInfo[playerid][pProfissao] != CivilCar)
            {
                
RemovePlayerFromVehicle(playerid); 
                
SendClientMessage(playeridC_CivilCar"[ x ] Este veнculo й reservado para os CivilCar");
                
PlayerPlaySound(playerid11470.00.00.0);
                return 
1;
            }
        }
    }
    return 
1;

Assim??
Muito Obrigado mano, acabei de adaptar agora, vou lб testar, alguns tempo atrбs eu sofria desse mesmo problema tb =) agora jб aprendi a fazer graзas a tu, vlw mesmo +rep
Reply
#4

https://sampforum.blast.hk/showthread.php?tid=547159

Fica a dica , vocкs de hoje tem muito conteudo bom , e so deixar a preguiзa de lado .
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)