11.11.2012, 07:44
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?
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?