[Pedido] Ligar Veiculo Para Andar !!
#1

Opa, como eu faзo pra que quando o player entre no veiculo ele tenha qe digitar o comando /veiculo e tenha qe ligar o veiculo para poder andar...

TIPO: entra veiculo = veiculo desligado

MEU DIALOG:
pawn Код:
if(listitem==3)
{
if(Engine[playerid]==0)
 {
new veh = GetPlayerVehicleID(playerid);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
Engine[playerid]=1;
}
else if(Engine[playerid]==1)
{
new veh = GetPlayerVehicleID(playerid);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
Engine[playerid]=0;
}
}
Reply
#2

Tem uma FS com base nisso se nгo me engano, vou ver aqui se eu acho.
Reply
#3

ta certo, mas tipo, com base
nao teria qe tipo colocar em

OnPlayerEnterVehicle

tipo algo

Engine[playerid]=0;

seila algo assim
Reply
#4

Se o cara tivesse ligado o carro, colocaria na dialog: Engine[playerid]=1;
E no OnPlayerEnterVehicle colocaria: Engine[playerid]=0;
Entendeu?
Reply
#5

tipo:

pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
new veh = GetPlayerVehicleID(playerid);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,VEHICLE_PARAMS_OFF,lights,alarm,doors,bonnet,boot,objective);
Engine[playerid]=0;
pawn Код:
public OnPlayerCommandText(playerid,cmdtext[])
{
if(strcmp(cmdtext, "/virarchave", true) == 0)
{
new veh = GetPlayerVehicleID(playerid);
new engine,lights,alarm,doors,bonnet,boot,objective;
GetVehicleParamsEx(veh,engine,lights,alarm,doors,bonnet,boot,objective);
SetVehicleParamsEx(veh,VEHICLE_PARAMS_ON,lights,alarm,doors,bonnet,boot,objective);
Engine[playerid]=1;
return 1;
}
Estaria Certo??
Reply
#6

Estб, mais agora quando o cara sair do veнculo OnPlayerExitVehicle(playerid, vehicleid) Vocк terб que colocar:
Engine[playerid] = 0;
Ou pegue estб FS criada por Mateus_X e RedBull e Upada por Mim: http://www.4shared.com/rar/3QC4ZxWM/Tuning.html
Reply
#7

Mano, usar o fs que estб na minha assinatura
Reply
#8

Isto й uma outra opзгo.
Reply
#9

hum, mas nao esta funcionando

quando entra veiculo nao acontece nada
Reply
#10

Coloque no OnPlayerStateChange
pawn Код:
if(newstate == PLAYER_STATE_DRIVER)
    {
        new newcar = GetPlayerVehicleID(playerid);
         if(IsAVariavel Sua(newcar))
        {
            if (HireCar[playerid] != newcar)
            {
Engine[playerid]=0;              
                    }
}
Se for para todos os carros, faзa isso em todas as variбveis.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)