SA-MP Forums Archive
Error in superjump - 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: Error in superjump (/showthread.php?tid=359261)



Error in superjump - Morkano - 13.07.2012

Quote:

if (PRESSED(KEY_JUMP))
{
new
Float,
Float:y,
Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, x, y, z + 10.0);
}
return 1;
}

undefined symbol "PRESSED"
then i will defined him
Quote:

#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))

again error help plz


Re: Error in superjump - clarencecuzz - 13.07.2012

Make sure you put #define PRESSED... under your includes. (#include)


Re: Error in superjump - Dan. - 13.07.2012

Make sure you put the define line before the superjump (near includes), and copy it exactly as it is.

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



Re: Error in superjump - Morkano - 13.07.2012

which include


Re: Error in superjump - Dan. - 13.07.2012

Includes.. example:

pawn Код:
#include a_samp
Make sure you put the define line below the includes.


Re: Error in superjump - Vince - 13.07.2012

You can define and undefine things anywhere you like, as long as they're defined before they're used (obviously). Definitions are not limited to any one scope.


Respuesta: Error in superjump - Marricio - 13.07.2012

Place that code under OnPlayerKeyStateChange, like Vince said, you need to define the parameters or the code before you use it.