Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #include <a_angles>
- #define FILTERSCRIPT
- new Weaps[38][3] =
- {
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {0, 0},
- {WEAPON_COLT45, 2},
- {WEAPON_SILENCED, 1},
- {WEAPON_DEAGLE, 1},
- {WEAPON_SHOTGUN, 1},
- {WEAPON_SAWEDOFF, 2},
- {WEAPON_SHOTGSPA, 1},
- {WEAPON_UZI, 2},
- {WEAPON_MP5, 1},
- {WEAPON_AK47, 1},
- {WEAPON_M4, 1},
- {WEAPON_TEC9, 2},
- {WEAPON_RIFLE, 1},
- {WEAPON_SNIPER, 1},
- {0, 0},
- {0, 0},
- {0, 0},
- {WEAPON_MINIGUN, 1}
- };
- new Float:glHP[MAX_PLAYERS];
- forward OnPlayerAttackPlayer(playerid, targetid);
- public OnPlayerAttackPlayer(playerid, targetid) {}
- public OnPlayerUpdate(playerid)
- {
- new Float:pos[3], keys, updown, leftright;
- new x=0;
- while(x<GetMaxPlayers())
- {
- GetPlayerPos(x, pos[0], pos[1], pos[2]);
- GetPlayerKeys(playerid, keys, updown, leftright);
- if(IsPlayerInRangeOfPoint(playerid, 70.0, pos[0], pos[1], pos[2]))
- {
- if
- (
- (((keys & 4) == (4)) &&
- IsPlayerFacingPlayer(playerid, x, 15.0) &&
- Weaps[GetPlayerWeapon(playerid)][2] == 1)
- ||
- (((keys & 132) == (132)) &&
- IsPlayerFacingPlayer(playerid, x, 180.0) &&
- Weaps[GetPlayerWeapon(playerid)][2] == 2)
- )
- {
- GetPlayerHealth(x, glHP[playerid]);
- SetTimerEx("CheckHP", 250, 0, "ii", playerid, x);
- }
- }
- ++x;
- }
- return 0;
- }
- forward CheckHP(playerid, targetid);
- public CheckHP(playerid, targetid)
- {
- new Float:HP;
- GetPlayerHealth(targetid, HP);
- if(HP < glHP[targetid])
- OnPlayerAttackPlayer(playerid, targetid);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment