Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* # # ###### ###### ##### ###### # # # # ##### #####
- # # # # # # # # # # # # # # # # # #
- # # # # # # # # # # # # ###### # # # #
- # # # # # # ## # # # # # ## ##
- # # # # # # # # # # # # # # # # # #
- # # # ###### ###### # # ###### # # ###### # # # #
- ________________________________________________________________
- | Super Jump v2.0 by MicroKyrr |
- | Credits to: |
- | MicroKyrr for creating this script |
- | SecretBoss for optimizing this script |
- | SAMP for the include a_samp/Keys and GetPlayername |
- | Zeex for his ZCMD |
- | |
- |________________________________________________________________| */
- /*|__________[Includes]__________|*/
- #include <a_samp>
- #include <zcmd>
- /*|__________[Defines]___________|*/
- #define FILTERSCRIPT
- #define RED 0xff0000FF
- #define GREEN 0x00ff33FF
- #define ORANGE 0xFF9900AA
- #define CORAL 0xEFC286FF
- #define GOLD 0xB8860BAA
- #define BLUE 0x4400ffFF
- /*|__________[forwards]__________|*/
- forward JumpTimer(playerid);
- /*|__________[Function new]__________|*/
- new Text:Shifton;
- new Text:Shiftoff;
- new Jumping[MAX_PLAYERS];
- new sjEnabled[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n ______________________________________");
- print("| Super Jump v1.0 by MicroKyrr |");
- print("| Successfully loaded |");
- print("|______________________________________|\n");
- Shifton = TextDrawCreate(480.000000, 431.000000, "Super Jump is currently enabled");
- TextDrawFont(Shifton , 1);
- TextDrawLetterSize(Shifton , 0.300000, 1.300000);
- TextDrawColor(Shifton, GREEN);
- TextDrawSetOutline(Shifton , false);
- TextDrawSetProportional(Shifton , true);
- TextDrawSetShadow(Shifton , 1);
- Shiftoff = TextDrawCreate(480.000000, 431.000000, "Super Jump is currently disabled");
- TextDrawFont(Shiftoff , 1);
- TextDrawLetterSize(Shiftoff , 0.300000, 1.300000);
- TextDrawColor(Shiftoff, RED);
- TextDrawSetOutline(Shiftoff , false);
- TextDrawSetProportional(Shiftoff , true);
- TextDrawSetShadow(Shiftoff , 1);
- return 1;
- }
- public OnFilterScriptExit()
- {
- print("\n ______________________________________");
- print("| Super Jump v1.0 by MicroKyrr |");
- print("| Successfully unloaded |");
- print("|______________________________________|\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- sjEnabled[playerid] = 0;
- if(sjEnabled[playerid] == 0)
- {
- TextDrawHideForAll(Shifton);
- TextDrawShowForAll(Shiftoff);
- }
- else if(sjEnabled[playerid] == 1)
- {
- TextDrawHideForAll(Shiftoff);
- TextDrawShowForAll(Shifton);
- }
- return 1;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- Jumping[playerid] = 0;
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(sjEnabled[playerid] == 1)
- {
- if(newkeys == KEY_JUMP && Jumping[playerid] == 0)
- {
- Jumping[playerid] = 1;
- new Float:superJump[3];
- GetPlayerVelocity(playerid, superJump[0], superJump[1], superJump[2]);
- SetPlayerVelocity(playerid, superJump[0], superJump[1], superJump[2]+5);
- SetTimerEx("JumpTimer", 15000, 0, "i", playerid);
- SendClientMessage(playerid, BLUE, "You have used your Super Jump! Wait 15 seconds to use Super Jump again to prevent abuse.");
- PlayerPlaySound(playerid, 1190, 0.0, 0.0, 0.0);
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 2)
- {
- if(response)
- {
- if(listitem == 0 && (sjEnabled[playerid] == 0))
- {
- sjEnabled[playerid] = 1;
- new message[280], Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, sizeof(Name));
- TextDrawShowForAll(Shifton);
- TextDrawHideForAll(Shiftoff);
- format(message, sizeof(message), "Super Jump has been enabled by Administrator {DBED15}%s{37DB45} , you can jump higher than normal!", Name);
- SendClientMessage(playerid, GREEN, message);
- }
- if(listitem == 1 && (sjEnabled[playerid] == 1))
- {
- sjEnabled[playerid] = 0;
- new message[280], Name[MAX_PLAYER_NAME];
- GetPlayerName(playerid, Name, sizeof(Name));
- TextDrawHideForAll(Shifton);
- TextDrawShowForAll(Shiftoff);
- format(message, sizeof(message), "Super Jump has been disabled by Administrator {DBED15}%s{FF0000} , Super Jump has been reset!", Name);
- SendClientMessageToAll(RED, message);
- return 1;
- }
- }
- }
- return 1;
- }
- public JumpTimer(playerid)
- {
- Jumping[playerid] = 0;
- SendClientMessage(playerid, ORANGE, "15 Seconds has been passed! You can use Super Jump again");
- return 1;
- }
- CMD:superjump(playerid, params[])
- {
- if(!IsPlayerAdmin(playerid)) /*Change this to your admin variable*/ return SendClientMessage(playerid, RED, "You don't have the authority to use this command!");
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Super Jump Panel by MicroKyrr", "Enable Super Jump\nDisable Super Jump", "Ok", "Cancel");
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement