[Ajuda]nitro
#5

Quote:
Originally Posted by ApolloRJ
Посмотреть сообщение
pawn Код:
// topo
#define PRESSED(%0) (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))




public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_FIRE))
{
new VehicleID = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid)) return 1;
{
AddVehicleComponent(VehicleID ,1010);
RepairVehicle(VehicleID);
return 1;
}
}
return 1;
}
OMG!

pawn Код:
if(!IsPlayerInAnyVehicle(playerid)) return 1;
{
AddVehicleComponent(VehicleID ,1010);
RepairVehicle(VehicleID);
return 1;
}
WTF!?

Idente seus cуdigos para obter melhores resultados.

@Topic

Ativando

Topo:
pawn Код:
#define HOLDING(%0) \
    ((newkeys & (%0)) == (%0))
#define RELEASED(%0) \
    (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
OnPlayerKeyStateChange:
pawn Код:
if(HOLDING(KEY_FIRE))
{
    if(IsPlayerInAnyVehicle(playerid))    
    {
         new Veiculo = GetPlayerVehicleID(playerid);
         AddVehicleComponent(Veiculo, 1010);
         return 1;
    }
}
Desativando

OnPlayerKeyStateChange:
pawn Код:
if(RELEASED(KEY_FIRE))
{
    if(IsPlayerInAnyVehicle(playerid))    
    {
         new Veiculo = GetPlayerVehicleID(playerid);
         RemoveVehicleComponent(Veiculo, 1010);
         return 1;
    }
}
Reply


Messages In This Thread
[Ajuda]nitro - by viniciusmcf - 17.11.2011, 22:38
Re: [Ajuda]nitro - by ViniBorn - 18.11.2011, 00:00
Re: [Ajuda]nitro - by ApolloRJ - 18.11.2011, 00:01
Re: [Ajuda]nitro - by viniciusmcf - 18.11.2011, 01:11
Re: [Ajuda]nitro - by Lуs - 18.11.2011, 02:40
Re: [Ajuda]nitro - by ApolloRJ - 18.11.2011, 02:40
Re: [Ajuda]nitro - by viniciusmcf - 18.11.2011, 11:24
Re: [Ajuda]nitro - by Lуs - 18.11.2011, 13:56

Forum Jump:


Users browsing this thread: 3 Guest(s)