-
-
Save anonymous/81b132445e35df3a4681 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <a_samp> | |
main(){print("loaded...");} | |
enum { | |
PICK, | |
LEAVE, | |
} | |
new bool:jetpackDetected[MAX_PLAYERS char] = {false, ...}; | |
public OnPlayerUpdate(playerid) { | |
if (GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK) { | |
if(!jetpackDetected{playerid}) { | |
jetpackDetected{playerid} = !jetpackDetected{playerid}; | |
onJetpack(PICK, playerid); | |
} | |
} | |
else if (jetpackDetected{playerid}) { | |
jetpackDetected{playerid} = !jetpackDetected{playerid}; | |
onJetpack(LEAVE, playerid); | |
} | |
} | |
forward onJetpack(action, playerid); | |
public onJetpack(action, playerid) { | |
SendClientMessage(playerid, -1, action == PICK ?("you've picked up the jetpack") : ("you've left your jetpack")); | |
} | |
public OnPlayerCommandText(playerid, cmdtext[]) { | |
if (!strcmp(cmdtext, "/jp")) { | |
SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK); | |
return true; | |
} | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment