Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerGiveDamage(playerid, damagedid, Float: amount, weaponid)
- {
- if(damagedid != INVALID_PLAYER_ID)
- {
- // Both players should see each other
- if (!IsPlayerStreamedIn(damagedid, playerid)) {
- return 0;
- }
- if(PlayerInfo[damagedid][pSleeping] == 1) return 0;
- if(PlayerCuffed[damagedid]) return 0;
- if(InWar[PlayerInfo[playerid][pMember]] == InWar[PlayerInfo[damagedid][pMember]] && PlayerInfo[playerid][pMember] != 0 && PlayerInfo[playerid][pMember] == PlayerInfo[damagedid][pMember] && InWar[PlayerInfo[playerid][pMember]] != 0) return 0;
- switch(weaponid) { // anti aimka
- case 24: { // deagle
- if(amount < 46.2 && (GetDistanceBetweenPlayers(playerid, damagedid) > 2) && IsPlayerPaused2(damagedid)) {
- format(gString, sizeof(gString), "%s was kicked by AdmBot, reason: Possible Aimka", GetName(playerid), wName(weaponid));
- if(gPlayerLogged[playerid]) SendClientMessageToAll(COLOR_LIGHTRED, gString);
- KickEx(playerid);
- PlayerInfo[playerid][pKicked] = true;
- return 0;
- }
- }
- case 30, 31: { // ak, m4
- if(amount < 9.9 && (GetDistanceBetweenPlayers(playerid, damagedid) > 2) && IsPlayerPaused2(damagedid)) {
- format(gString, sizeof(gString), "%s was kicked by AdmBot, reason: Possible Aimka", GetName(playerid), wName(weaponid));
- if(gPlayerLogged[playerid]) SendClientMessageToAll(COLOR_LIGHTRED, gString);
- KickEx(playerid);
- PlayerInfo[playerid][pKicked] = true;
- return 0;
- }
- } case 33: { // rifle
- if(amount < 24.75 && (GetDistanceBetweenPlayers(playerid, damagedid) > 3) && IsPlayerPaused2(damagedid)) {
- format(gString, sizeof(gString), "%s was kicked by AdmBot, reason: Possible Aimka", GetName(playerid), wName(weaponid));
- if(gPlayerLogged[playerid]) SendClientMessageToAll(COLOR_LIGHTRED, gString);
- KickEx(playerid);
- PlayerInfo[playerid][pKicked] = true;
- return 0;
- }
- } case 29: { // mp5
- if(amount < 8.25 && (GetDistanceBetweenPlayers(playerid, damagedid) > 3) && IsPlayerPaused2(damagedid)) {
- format(gString, sizeof(gString), "%s was kicked by AdmBot, reason: Possible Aimka", GetName(playerid), wName(weaponid));
- if(gPlayerLogged[playerid]) SendClientMessageToAll(COLOR_LIGHTRED, gString);
- KickEx(playerid);
- PlayerInfo[playerid][pKicked] = true;
- return 0;
- }
- } case 25: { // gauge shotgun
- if(amount == 10.00 && (GetDistanceBetweenPlayers(playerid, damagedid) > 3) && IsPlayerPaused2(damagedid)) {
- format(gString, sizeof(gString), "%s was kicked by AdmBot, reason: Possible Aimka", GetName(playerid), wName(weaponid));
- if(gPlayerLogged[playerid]) SendClientMessageToAll(COLOR_LIGHTRED, gString);
- KickEx(playerid);
- PlayerInfo[playerid][pKicked] = true;
- return 0;
- }
- }
- }
- /*if(weaponid == 31 && amount < 9.9) {
- format(gString, sizeof(gString), "%s was kicked by AdmBot, reason: Possible Aimka", GetName(playerid), wName(weaponid));
- if(gPlayerLogged[playerid]) SendClientMessageToAll(COLOR_LIGHTRED, gString);
- Kick(playerid);
- PlayerInfo[playerid][pKicked] = true;
- }*/
- if(weaponid && weaponid != 40 && weaponid != 46 && PlayerInfo[playerid][pKicked] == false && (PlayerInfo[playerid][pPaintBallG] == 0 || PlayerInfo[playerid][pPaintBallG] && weaponid != 24 && weaponid != 31 && weaponid != 16 && weaponid != 41 && weaponid != 5 && weaponid != 9)) {
- if(PlayerInfo[playerid][pWeapons][GetWeaponSlot(weaponid)] != weaponid) {
- format(gString, sizeof(gString), "%s was kicked by AdmBot, reason: Weapon Hack(%s)", GetName(playerid), wName(weaponid));
- if(gPlayerLogged[playerid]) SendClientMessageToAll(COLOR_LIGHTRED, gString);
- Kick(playerid);
- PlayerInfo[playerid][pKicked] = true;
- }
- }
- /*if(!IsPlayerPaused2(damagedid) && (weaponid == WEAPON_DEAGLE || weaponid == WEAPON_M4 || weaponid == WEAPON_MP5 || weaponid == WEAPON_AK47))
- {
- new surf = GetPlayerSurfingVehicleID(playerid), tsurf = GetPlayerSurfingVehicleID(damagedid);
- if(surf == INVALID_VEHICLE_ID && tsurf == INVALID_VEHICLE_ID && !IsPlayerInAnyVehicle(damagedid))
- {
- new Float:fOriginX, Float:fOriginY, Float:fOriginZ, Float:fHitPosX, Float:fHitPosY, Float:fHitPosZ;
- GetPlayerLastShotVectors(playerid, fOriginX, fOriginY, fOriginZ, fHitPosX, fHitPosY, fHitPosZ);
- if(!IsPlayerInRangeOfPoint(damagedid, 3.0, fHitPosX, fHitPosY, fHitPosZ)) {
- PlayerInfo[playerid][pPoorAim]++;
- if(PlayerInfo[playerid][pPoorAim] >= 2) {
- PlayerInfo[playerid][pPoorAim] = 0;
- if(PlayerInfo[playerid][pKicked] == false) {
- format(gString, sizeof gString, "%s was kicked by AdmBot, reason: Poor Aimbot(3/3 Warnings)", GetName(playerid));
- SendClientMessageToAll(COLOR_LIGHTRED, gString);
- KickEx(playerid);
- }
- }
- }
- }
- new Float:HitPosX, Float:HitPosY, Float:HitPosZ, Float:Temp;
- GetPlayerLastShotVectors(playerid, Temp, Temp, Temp, HitPosX, HitPosY, HitPosZ);
- if(!IsPlayerInRangeOfPoint(playerid, 5.0, HitPosX, HitPosY, HitPosZ) && !IsPlayerFacingCoords(playerid, HitPosX, HitPosY, 8)) {
- PlayerInfo[playerid][pAIMKA] ++;
- if(PlayerInfo[playerid][pAIMKA] >= 2) {
- PlayerInfo[playerid][pAIMKA] = 0;
- if(PlayerInfo[playerid][pKicked] == false) {
- format(gString, sizeof gString, "%s was kicked by AdmBot, reason: Silent Aimbot(3/3 Warnings)", GetName(playerid));
- SendClientMessageToAll(COLOR_LIGHTRED, gString);
- KickEx(playerid);
- }
- }
- }
- }*/
- if(weaponid == 0) {
- amount = 1 + PlayerInfo[playerid][pMuscleLevel] * 0.5;
- if(amount > 5) amount = 5;
- }
- if(weaponid == 34) amount = 300;
- if(weaponid == 34 && PlayerInfo[playerid][pMember] == 11 && GoChase[playerid] != damagedid) amount = 0;
- if(amount < 0 && !PlayerInfo[playerid][pKicked]) {
- SetPlayerVirtualWorld(playerid, playerid+1);
- SCM(playerid, COLOR_RED, "You were kicked by AdmBot, reason: fake damage cheats.");
- KickEx(playerid);
- format(gString, sizeof gString, "%s[%d] was kicked by AdmBot, reason: fake damage (%0.2f) with %s", GetName(playerid), playerid, amount, wName(weaponid));
- ABroadCast(COLOR_RED, gString,1);
- }
- if(amount > 10.0 && weaponid == 0 && !PlayerInfo[playerid][pKicked]) {
- SetPlayerVirtualWorld(playerid, playerid+1);
- SCM(playerid, COLOR_RED, "You were kicked by AdmBot, reason: fake damage cheats.");
- KickEx(playerid);
- format(gString, sizeof gString, "%s[%d] was kicked by AdmBot, reason: fake damage (%0.2f) with %s", GetName(playerid), playerid, amount, wName(weaponid));
- ABroadCast(COLOR_RED, gString,1);
- }
- //if(IsAMember(playerid) && IsAMember(damagedid) && InWar[PlayerInfo[playerid][pMember]] == InWar[PlayerInfo[playerid][pMember]]) PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
- /*
- if(IsAMember(playerid) && IsAMember(damagedid) && antiaimka == 1)
- {
- if((InWar[PlayerInfo[playerid][pMember]] == InWar[PlayerInfo[damagedid][pMember]]) && InWar[PlayerInfo[playerid][pMember]] > 0)
- {
- new Float:pGiver[3];
- new Float:pTaker[3];
- new Float:pObj[3];
- new obj;
- GetPlayerPos(playerid, pGiver[0], pGiver[1], pGiver[2]);
- GetPlayerPos(damagedid, pTaker[0], pTaker[1], pTaker[2]);
- obj = CA_RayCastLine(pTaker[0],pTaker[1],pTaker[2], pGiver[0],pGiver[1],pGiver[2], pObj[0], pObj[1], pObj[2]);
- if(obj != 0 && obj != 20000) {
- amount = 0;
- return 0;
- }
- else {
- PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
- }
- }
- }*/
- PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
- /*if(PlayerCuffed[damagedid] == 1)
- {
- SetPlayerHealthEx(damagedid,100);
- }*/
- if(tazer[playerid] == 1 && IsACop(playerid) && weaponid == 23)
- {
- if(IsACop(damagedid)) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}You can't taze Cops/FBI/National Guard.");
- if(PlayerCuffed[damagedid] == 1) return SendClientMessage(playerid, COLOR_WHITE, "{FFFFFF}ERROR: This player is already tazed.");
- if(PlayerInfo[damagedid][pSleeping] == 1) return SendClientMessage(playerid, COLOR_WHITE, "ERROR: You can't taze this player because he/she is on sleep.");
- if(GetDistanceBetweenPlayers(playerid,damagedid) < 50.0)
- {
- format(gString, sizeof(gString), "* You were Tazed by %s for 8 seconds.", GetName(playerid));
- SendClientMessage(damagedid, COLOR_LIGHTBLUE, gString);
- format(gString, sizeof(gString), "* You Tazed %s for 8 seconds.", GetName(damagedid));
- SendClientMessage(playerid, COLOR_LIGHTBLUE, gString);
- format(gString, sizeof(gString), "* %s shoots with his Tazer at %s, and tazed him.", GetName(playerid) ,GetName(damagedid));
- ProxDetector(30.0, playerid, gString, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- GameTextForPlayer(damagedid, "~r~~h~Tazed", 2500, 3);
- TogglePlayerControllableEx(damagedid, 0);
- PlayerCuffed[damagedid] = 1;
- PlayerCuffedTime[damagedid] = 8;
- amount = 0;
- return 0;
- }
- }
- /*
- if(PlayerInfo[playerid][pPaintBallG] == PlayerInfo[damagedid][pPaintBallG] && PlayerInfo[damagedid][pPaintBallG] == 3) {
- if(Iter_Contains(team_1, playerid) && Iter_Contains(team_1, damagedid)) {
- amount = 0;
- return 0;
- }
- if(Iter_Contains(team_2, playerid) && Iter_Contains(team_2, damagedid)) {
- amount = 0;
- return 0;
- }
- }*/
- if(PlayerInfo[playerid][pPaintBallG]) PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
- /* Hit Calculates - Ksenon damage system v2.0*/
- if(PlayerIsDead[damagedid] == false)
- {
- new Float:fOriginX, Float:fOriginY, Float:fOriginZ,
- Float:fHitPosX, Float:fHitPosY, Float:fHitPosZ;
- GetPlayerLastShotVectors(playerid, fOriginX, fOriginY, fOriginZ, fHitPosX, fHitPosY, fHitPosZ);
- foreachex(Admins,i) {
- if(Spectate[i] == playerid)
- {
- SCMF(i, 0xff8080FF, "DMG: %s did %f damage to %s using weapon %s [hit: %f %f %f]", PlayerInfo[playerid][pNormalName], amount, PlayerInfo[damagedid][pNormalName], wName(weaponid), fHitPosX, fHitPosY, fHitPosZ );
- }
- }
- if(GoChase[playerid] != damagedid) {
- DamageFeedAddHitTaken(damagedid, playerid, amount, weaponid);
- }
- DamageFeedAddHitGiven(playerid, damagedid, amount, weaponid);
- new Float:armour; GetPlayerArmourEx(damagedid,armour);
- if(armour < 1)
- {
- new Float:health;
- GetPlayerHealthEx(damagedid, health);
- SetPlayerHealthEx(damagedid, health-amount);
- if(IsPlayerPaused2(damagedid) && (health-amount) < 1) OnPlayerDeath(damagedid, playerid, weaponid);
- lasthit[damagedid] = playerid;
- lastreason[damagedid] = weaponid;
- lasthittime[damagedid] = gettime();
- return 0;
- }
- if(armour > 0)
- {
- if(armour < amount)
- {
- new Float:health; GetPlayerHealthEx(damagedid, health);
- new Float:value = amount-armour;
- SetPlayerArmourEx(damagedid,0);
- SetPlayerHealthEx(damagedid,health-value);
- if(IsPlayerPaused2(damagedid) && (health-value) < 1) OnPlayerDeath(damagedid, playerid, weaponid);
- lasthit[damagedid] = playerid;
- lastreason[damagedid] = weaponid;
- lasthittime[damagedid] = gettime();
- return 0;
- }
- if(armour > amount)
- {
- SetPlayerArmourEx(damagedid,armour-amount);
- lasthit[damagedid] = playerid;
- lastreason[damagedid] = weaponid;
- lasthittime[damagedid] = gettime();
- return 0;
- }
- return 0;
- }
- }
- return 0;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement