Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // - Louis, add brokenleg[playerid] = 0; under OnPlayerDeath and under the command when someone gets revived, so it removes their broken leg so they aren't stuck with it.
- new brokenleg[MAX_PLAYERS];
- new legtimer[MAX_PLAYERS];
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(brokenleg[playerid] == 1)
- {
- if(newkeys & KEY_JUMP && !(oldkeys & KEY_JUMP) )
- {
- ApplyAnimation(playerid, "GYMNASIUM", "gym_jog_falloff",4.1,0,1,1,0,0);
- }
- if(newkeys & KEY_SPRINT && !(oldkeys & KEY_SPRINT) )
- {
- ApplyAnimation(playerid, "PED", "FALL_collapse", 4.1,0,1,1,0,0);
- }
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float:amount, weaponid, bodypart)
- {
- if(issuerid != INVALID_PLAYER_ID)
- {
- switch(bodypart)
- {
- case 7, 8:
- {
- BreakLeg(playerid);
- }
- }
- }
- stock BreakLeg(playerid)
- {
- SendClientMessage(playerid, COLOR_LIGHTRED, "You have been shot in the leg, you wont be able to run or jump");
- KillTimer(legtimer[playerid]);
- brokenleg[playerid] = 1;
- legtimer[playerid] = SetTimerEx( "BrokenLegFix", 90000, false, "i", playerid );
- return 1;
- }
- stock FixLeg(playerid)
- {
- KillTimer(legtimer[playerid]);
- brokenleg[playerid] = 0;
- return 1;
- }
- forward BrokenLegFix(playerid);
- public BrokenLegFix(playerid)
- {
- FixLeg(playerid);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement