Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define FILTERSCRIPT
- forward JumpTimer(playerid);
- new MegaJump[MAX_PLAYERS],
- Jumping[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- Jumping[playerid] = 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/megajump", cmdtext, true, 10) == 0)
- {
- if (MegaJump[playerid] == 1)
- {
- MegaJump[playerid] = 0;
- GameTextForPlayer(playerid,"~g~MegaJump ~w~Off",4500,3);
- return 1;
- }
- else if (MegaJump[playerid] == 0)
- {
- MegaJump[playerid] = 1;
- GameTextForPlayer(playerid,"~g~MegaJump ~w~On",4500,3);
- return 1;
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(newkeys & KEY_JUMP)
- {
- if(MegaJump[playerid] == 1)
- {
- if(Jumping[playerid] == 0)
- {
- new Float:Jump[3];
- GetPlayerVelocity(playerid, Jump[0], Jump[1], Jump[2]);
- SetPlayerVelocity(playerid, Jump[0], Jump[1], Jump[2]+5);
- SetTimerEx("JumpTimer", 2500, false, "i", playerid);
- Jumping[playerid] = 1;
- }
- }
- }
- return 1;
- }
- public JumpTimer(playerid)
- {
- Jumping[playerid] = 0;
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement