14.08.2012, 00:50
Ok, so i didn't understand the define things in the tutorial on sa-mp wiki...so..here is what i got
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
#define PRESSED(%0) \
if (PRESSED(KEY_JUMP))
{
new
Float:X5,
Float:Y5,
Float:Z5;
GetPlayerPos(playerid, X5, Y5, Z5);
SetPlayerPos(playerid, X5, Y5, Z5 + 10.0);
}
return 1;
}
and i get this warning: warning 201: redefinition of constant/macro (symbol "PRESSED(%0)")
on the if (pressed line
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
#define PRESSED(%0) \
if (PRESSED(KEY_JUMP))
{
new
Float:X5,
Float:Y5,
Float:Z5;
GetPlayerPos(playerid, X5, Y5, Z5);
SetPlayerPos(playerid, X5, Y5, Z5 + 10.0);
}
return 1;
}
and i get this warning: warning 201: redefinition of constant/macro (symbol "PRESSED(%0)")
on the if (pressed line