SA-MP Forums Archive
LMB for Nos - 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: LMB for Nos (/showthread.php?tid=313574)



LMB for Nos - Twix[KDZ] - 26.01.2012

Here is the Code. But it show error when i compile it. The error is: error 017: undefined symbol "PRESSED"

public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_FIRE))
{
if (IsPlayerInAnyVehicle(playerid))
{
AddVehicleComponent(GetPlayerVehicleID(playerid), 1010);
}
}
return 1;
}


I tried to #define PRESSED but it comes alot more errors? I need help ,please


Re: LMB for Nos - [XST]O_x - 26.01.2012

Add this then:
pawn Код:
#define PRESSED(%0) \
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))



Re: LMB for Nos - Twix[KDZ] - 26.01.2012

Thanks! It worked TYVM man !