Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Fell Down System By chuckybabe 3/5/2014
- */
- /* This filterscript "Felldown system" is most use in a roleplay mode :) please don't remove the credits ! +rep if i help!
- */
- #include <a_samp>
- #define FILTERSCRIPT
- #if defined FILTERSCRIPT
- #define COLOR_LIGHTBLUE 0x33CCFFAA
- #define SCM SendClientMessage
- new PlayerPressedJump[MAX_PLAYERS];
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Fell Down System By ChuckyBabe");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- PlayerPressedJump[playerid] = 0; // Sets variable to 0 when they first connect
- return 1;
- }
- forward PressJump(playerid);
- public PressJump(playerid)
- {
- PlayerPressedJump[playerid] = 0; // Reset the variable
- ClearAnimations(playerid);
- return 1;
- }
- forward PressJumpReset(playerid);
- public PressJumpReset(playerid)
- {
- PlayerPressedJump[playerid] = 0; // Reset the variable
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if((newkeys & KEY_JUMP) && !IsPlayerInAnyVehicle(playerid))
- {
- PlayerPressedJump[playerid] ++;
- SetTimerEx("PressJumpReset", 3000, false, "i", playerid); // Makes it where if they dont spam the jump key, they wont fall
- if(PlayerPressedJump[playerid] == 3) // change 3 to how many jump you want before they fall
- {
- ApplyAnimation(playerid, "PED", "BIKE_fall_off", 4.1, 0, 1, 1, 1, 0, 1); // applies the fallover animation
- SCM(playerid, COLOR_LIGHTBLUE, "Don't bunny hop, bitch!"); //the message if fell
- SetTimerEx("PressJump", 9000, false, "i", playerid); // Timer for how long the animation lasts
- }
- }
- return 1;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment