Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid, bodypart)
- {
- if(damagedid != INVALID_PLAYER_ID)
- {
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) return 1;
- if(GetPlayerSurfingVehicleID(playerid) != INVALID_VEHICLE_ID) return 1;
- if(amount < 0)
- {
- new string[256],sendername[25];
- GetPlayerName(playerid,sendername,sizeof(sendername));
- format(string, sizeof(string), "(N) %s (%d, level %d) can use global kill, damage: %.2f.",sendername, playerid, PlayerInfo[playerid][pLevel], amount);
- ABroadCast(COLOR_RED,string,1);
- return 1;
- }
- if(PlayerInfo[playerid][pPaintBallG] > 0)
- {
- PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
- }
- new fpm,fkm;
- fpm = PlayerInfo[playerid][pMember];
- fkm = PlayerInfo[damagedid][pMember];
- for(new turf = 1; turf < sizeof(TurfInfo); turf++)
- {
- if(IsPlayerInTurf(playerid, turf) && IsPlayerInTurf(damagedid, turf))
- {
- if(IsAMember(playerid) && IsAMember(damagedid))
- {
- if(WarInfo[turf][wFaction] == fpm && WarInfo[turf][wAttacker] == fkm || WarInfo[turf][wFaction] == fkm && WarInfo[turf][wAttacker] == fpm)
- {
- PlayerPlaySound(playerid,17802,0.0,0.0,0.0);
- }
- }
- }
- }
- if(PlayerInfo[damagedid][pPaintBallG] > 0)
- {
- if(paintrs[PlayerInfo[damagedid][pPaintBallG]] > 0)
- {
- SetPlayerHealthEx(damagedid, 100.0);
- }
- }
- if(playerdeath[damagedid] == 0)
- {
- if(weaponid == 34 && PlayerInfo[damagedid][pPaintBallG] < 1)
- {
- SetPlayerHealthEx(damagedid, 0.0);
- SetPlayerArmourEx(damagedid, 0.0);
- OnPlayerDeath(damagedid,playerid,weaponid);
- playerdeath[damagedid] = 1;
- return 1;
- }
- new Float: HP, Float: AP ;
- GetPlayerHealthEx(damagedid,HP);
- GetPlayerArmourEx(damagedid,AP);
- if ( AP >= amount )
- {
- SetPlayerArmourEx ( damagedid, AP - amount );
- }
- else if ( AP <= 0 )
- {
- new Float: remainHP = HP - amount;
- SetPlayerHealthEx ( damagedid, remainHP );
- if ( remainHP <= 1 )
- {
- OnPlayerDeath( damagedid, playerid, weaponid );
- SetPlayerHealthEx ( damagedid, 0.0 );
- playerdeath[damagedid] = 1;
- }
- }
- else
- {
- new Float: remainHP = HP + ( AP - amount );
- SetPlayerArmourEx ( damagedid, 0.0 );
- SetPlayerHealthEx ( damagedid, remainHP );
- if ( remainHP <= 1 )
- {
- OnPlayerDeath( damagedid, playerid, weaponid );
- SetPlayerHealthEx ( damagedid, 0.0 );
- playerdeath[damagedid] = 1;
- }
- }
- if(PlayerCuffed[damagedid] == 1)
- {
- SetPlayerHealthEx(damagedid,100);
- }
- if(PlayerInfo[damagedid][pSleeping] == 1)
- {
- SetPlayerHealthEx(damagedid, 100);
- }
- if(tazer[playerid] == 1 && IsACop(playerid) && weaponid == 23)
- {
- if(IsACop(damagedid)) return SendClientMessage(playerid, COLOR_GREY, "You can't taze a cop.");
- if(PlayerCuffed[damagedid] == 1) return SendClientMessage(playerid, COLOR_GREY, "This player is already tazed.");
- if(PlayerInfo[damagedid][pSleeping] == 1) return SendClientMessage(playerid, COLOR_GREY, "This player is sleeping.");
- if(GetDistanceBetweenPlayers(playerid,damagedid) < 15)
- {
- new string[126],sendername[25],giveplayer[25];
- GetPlayerName(playerid,sendername,sizeof(sendername));
- GetPlayerName(damagedid,giveplayer,sizeof(giveplayer));
- format(string, sizeof(string), "* %s tazed %s for 8 seconds.", sendername ,giveplayer);
- ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
- TogglePlayerControllable(damagedid, 0);
- PlayerCuffed[damagedid] = 1;
- PlayerCuffedTime[damagedid] = 8;
- }
- }
- }
- foreach(new i : Player)
- {
- if(Spectate[i] == playerid)
- {
- if(PlayerInfo[i][pAdmin] >= 1)
- {
- if(ShowDMG[i] == 1)
- {
- new string[256],name[30],wName[64],name2[30];
- GetPlayerName(playerid, name, sizeof(name));
- GetPlayerName(damagedid, name2, sizeof(name2));
- GetWeaponNameEx(weaponid,wName,sizeof(wName));
- format(string, sizeof(string),"DMG: %s did %f damage to %s using weapon %s. [hit: %f %f %f] [bodypart: %d]",name,amount,name2,wName,DMInfo[playerid][0],DMInfo[playerid][1],DMInfo[playerid][2],bodypart);
- SendSplitMessage(i, COLOR_DARKPINK, string);
- }
- }
- }
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement