06.08.2016, 10:23
On top of script:
Now:
Hope you understand.
Код:
#define PRESSED(%0) \ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
Код:
public OnPlayerConnect(playerid) { SetPVarInt(playerid,"Carrying",0); return 1; } public OnPlayerDisconnect(playerid, reason) { if(GetPVarInt(playerid,"Carrying")==1) { SetPVarInt(playerid,"Carrying",0); } return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { if(PRESSED(KEY_YES)) // ' Y ' Key { if(GetPVarInt(playerid,"Carrying")==0) { SetPlayerSpecialAction(playerid, 25); SetPVarInt(playerid,"Carrying",1); } } else if(PRESSED(KEY_NO)) // ' N ' Key { if(GetPVarInt(playerid,"Carrying")==1) { SetPlayerSpecialAction(playerid, 0); SetPVarInt(playerid,"Carrying",0); } } return 1; }