// PRESSED(keys)
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0))*!= (%0))
if (PRESSED( newkeys, KEY_JUMP )) // error line
{
if(DB[playerid][SuperJumpLevel] == 1)
{
GetPlayerVelocity(playerid, F[0], F[1], F[2]);
SetPlayerVelocity(playerid, F[0]*1.3, F[1]*2, F[2]+0.1);
Message(playerid, TYPE_SERVER, "Jump recognized.");
}
}
error 001: expected token: ")", but found "*"
error 029: invalid expression, assumed zero
if(PRESSED(KEY_JUMP))
error 001: expected token: ")", but found "*"
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
replace
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0))*!= (%0))
to
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))
PHP код:
|
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
PHP код:
|
Код:
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) |
error 029: invalid expression, assumed zero
if(PRESSED(KEY_JUMP))
Did you use
Код:
if(PRESSED(KEY_JUMP)) or the old code? The macro just accepts one argument (the key), not two. |
public OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) { if ( newkeys & KEY_JUMP ) { if ( DB[playerid][SuperJumpLevel] == 1 ) { GetPlayerVelocity( playerid, F[0], F[1], F[2] ); SetPlayerVelocity( playerid, F[0] * 1.3, F[1] * 2, F[2] + 0.1 ); SendClientMessage( playerid, -1, "Super Jump Established." ); } } return 1; }
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase [Finished in 0.1s]
This should work.
Note: I just reworked your "Message" function so I could see if it would spit any errors when compiling. Simply replace this with your message function or test it with it, I don't care. :P Код:
public OnPlayerKeyStateChange( playerid, newkeys, oldkeys ) { if ( newkeys & KEY_JUMP ) { if ( DB[playerid][SuperJumpLevel] == 1 ) { GetPlayerVelocity( playerid, F[0], F[1], F[2] ); SetPlayerVelocity( playerid, F[0] * 1.3, F[1] * 2, F[2] + 0.1 ); SendClientMessage( playerid, -1, "Super Jump Established." ); } } return 1; } Код:
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase [Finished in 0.1s] |