Nitro-REALESED - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Nitro-REALESED (
/showthread.php?tid=362688)
Nitro-REALESED -
IvancheBG - 25.07.2012
Hi guyz.I tried to make when i press the KEY_FIRE to start the nitro and when i realese the KEY_FIRE the nitro ends.How to do that ?
Re: Nitro-REALESED -
Rudy_ - 25.07.2012
Can you show what you tried?
Re: Nitro-REALESED -
IvancheBG - 25.07.2012
Код:
if(PRESSED(KEY_FIRE))
{
if(IsPlayerInAnyVehicle(playerid))
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
}
}
else if(RELEASED(KEY_FIRE))
{
if(IsPlayerInAnyVehicle(playerid))
{
RemoveVehicleComponent(0,1010);
}
}
Re: Nitro-REALESED -
Rudy_ - 25.07.2012
pawn Код:
if(PRESSED(KEY_FIRE))
{
if(IsPlayerInAnyVehicle(playerid))
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
}
else if(RELEASED(KEY_FIRE))
{
if(IsPlayerInAnyVehicle(playerid))
{
RemoveVehicleComponent(0,1010);
}
}
}
Re: Nitro-REALESED -
IvancheBG - 25.07.2012
It isnt working
Re: Nitro-REALESED -
IvancheBG - 26.07.2012
Someone ?
Re: Nitro-REALESED -
McCurdy - 26.07.2012
Код:
if(PRESSED(KEY_FIRE))
{
if(IsPlayerInAnyVehicle(playerid))
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
}
}
else if(RELEASED(KEY_FIRE))
{
if(IsPlayerInAnyVehicle(playerid))
{
RemoveVehicleComponent(0,1010);
}
}
Is RemoveVehicleComponent is right?
I see in samp wiki and this RemoveVehicleComponent(
1,1010); // 1 is vehicleid
Re: Nitro-REALESED -
Alexis1999 - 26.07.2012
Here you are
PHP код:
#define HOLDING(%0) \
((newkeys & (%0)) == (%0))
#define RELEASED(%0) \
(((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if(HOLDING(KEY_FIRE))
{
if(IsPlayerInAnyVehicle(playerid))
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
}
}
else if(RELEASED(KEY_FIRE))
{
if(IsPlayerInAnyVehicle(playerid))
{
RemoveVehicleComponent(GetPlayerVehicleID(playerid), 1010);
}
}
return 1;
}
Re: Nitro-REALESED -
IvancheBG - 26.07.2012
Thanks Alexis ! : )