putted 2 hotkeys - one is working and other no! help? - 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: putted 2 hotkeys - one is working and other no! help? (
/showthread.php?tid=391632)
putted 2 hotkeys - one is working and other no! help? -
SilverKiller - 11.11.2012
guys i made two hotkeys on OnPlayerKeyStateChange or idk what it is called
pawno code -
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
if (PRESSED(KEY_FIRE))
{
if (IsPlayerInAnyVehicle(playerid))
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
}
if (PRESSED(KEY_CROUCH))
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
GivePlayerWeapon(playerid, 46, 500);
}
}
return 1;
no error while compiling but keycrouch one isn't working help?
Re: putted 2 hotkeys - one is working and other no! help? -
KomplettMaster - 24.12.2012
This Shit Only Be Bugs....
Re: putted 2 hotkeys - one is working and other no! help? -
SuperViper - 25.12.2012
pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
if(PRESSED(KEY_FIRE))
{
if(IsPlayerInAnyVehicle(playerid))
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
}
}
if(PRESSED(KEY_CROUCH))
{
if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT)
{
GivePlayerWeapon(playerid, 46, 500);
}
}
return 1;
}