18.05.2012, 22:47
Hello,
I have created this code:
and I defined this "PRESSED"
DEFINE:
but why Im receiving this error?:
any explanation?
I have created this code:
Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { switch(PRESSED)//ERROR HERE { case KEY_HANDBRAKE: { if(IsPlayerInRangeOfPoint(playerid, 2.0, 245.10000610,72.30000305,1004.20001221)) { if(PlayerInfo[playerid][pAdmin] >= SCRIPTER) { switch(Open{0})//Check whether the gate opened or closed { case true://If the gate opened { MoveObject(LSPDdoor, 2245.50000000,72.59999847,1002.59997559, 5); Open{0} = false; } case false://If the gate closed { MoveObject(LSPDdoor, 244.00000000,72.59999847,1002.59997559, 5); SetTimerEx("LSPDClose", 3500, false, "i", playerid); Open{0} = true; } } } else return SendClientMessage(playerid, COLOR_GREY, "Access Denied"); } } }
DEFINE:
Код:
#define PRESSED(%0) \ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Код:
error 017: undefined symbol "PRESSED"
Thank you! : )