Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnPlayerDeath( playerid, killerid, reason ){
- ResetPlayerDamages( playerid ) ;
- return 1 ;
- }
- SetBrutallyWounded( playerid ){
- new
- stringinfo[ 128 ] ;
- GameTextForPlayer(playerid, "~b~Brutally Wounded", 7000, 3);
- ApplyAnimation( playerid, "WUZI", "CS_Dead_Guy", 4.1, 0, 1, 1, 1, 0, 1 ) ;
- SetIntVar( playerid, "BrutallyWounded", 1 ) ;
- format( stringinfo, sizeof( stringinfo ), "(( Has been injured %d times,\n /damages %d for more information.\n ))", injuredtimes[ playerid ], playerid ) ;
- dmginfo[ playerid ] = Create3DTextLabel( stringinfo, 0xFF6347FF, 30.0, 40.0, 0.0, 20.0, 0, 0 ) ;
- Attach3DTextLabelToPlayer( dmginfo[ playerid ], playerid, 0.0, 0.0, 0.0 ) ;
- SCM( playerid, COLOR_LIGHTRED, "You were brutally wounded, now if a medic or anyone else doesn't save you, you will die." ) ;
- SCM( playerid, COLOR_LIGHTRED, "To accept death type /acceptdeath" ) ;
- SCMEx( playerid, COLOR_LIGHTRED, "(( Has been injured %d times, /damages %d for more information. )) ", injuredtimes[ playerid ], playerid ) ;
- SCM( playerid, LSFD_COLOR, "EMT: Your medical bills are $1550" ) ;
- GiveCash( playerid, -1550 ) ;
- return 1 ;
- }
- SetDead( playerid ){
- SetIntVar( playerid, "BrutallyWounded", 3 ) ;
- Update3DTextLabelText( dmginfo[ playerid ], 0xFF6347FF, "(( THIS PLAYER IS DEAD ))" ) ;
- SCM( playerid, COLOR_YELLOWG, "-> You're now dead. You need to wait 60 seconds and then you'll get the ability to /respawnme." ) ;
- return 1 ;
- }
- timer oneSecdmg[ 1000 ]( playerid, count ){
- _weapon_damage_player[ playerid ][ count ][ SinceDMG ] ++ ;
- #if defined SVDEBUG
- SCMEx( playerid, -1, "damage %d: made %d seconds ago", count, _weapon_damage_player[ playerid ][ count ][ SinceDMG ] ) ;
- #endif
- }
- AddKevlarHit( playerid, damageid, weaponid ){
- _weapon_damage_player[ playerid ][ damageid ][ KevlarHit ] = _weapon_damage_data[ weaponid ][ ArmorPen ] ;
- return 1 ;
- }
- InsertDamage( playerid, weaponid, bodypart ){
- new
- Float: armour ;
- _weapon_damage_player[ playerid ][ injuredtimes[ playerid ] ][ Weapon ] = weaponid ;
- _weapon_damage_player[ playerid ][ injuredtimes[ playerid ] ][ Bodypart ] = bodypart ;
- _weapon_damage_player[ playerid ][ injuredtimes[ playerid ] ][ Amount ] = _weapon_damage_data[ weaponid ][ DamageHP ] ;
- _weapon_damage_player[ playerid ][ injuredtimes[ playerid ] ][ Time ] = repeat oneSecdmg( playerid, injuredtimes[ playerid ] ) ;
- GetPlayerArmour( playerid, armour ) ;
- if( armour > 1 ){
- SetPlayerArmour( playerid, armour-_weapon_damage_data[ weaponid ][ ArmorPen ] ) ;
- AddKevlarHit( playerid, injuredtimes[ playerid ], weaponid ) ;
- }
- #if defined SVDEBUG
- SCMEx( playerid, -1, "damage %d: weaponid: %d, bodypart: %d, amount: %f", injuredtimes[ playerid ], weaponid, bodypart, _weapon_damage_player[ playerid ][ injuredtimes[ playerid ] ][ Amount ] ) ;
- #endif
- injuredtimes[ playerid ] ++ ;
- return 1 ;
- }
- ResetPlayerDamages( playerid ){
- SetIntVar( playerid, "BrutallyWounded", 0 ) ;
- Delete3DTextLabel( dmginfo[ playerid ] );
- SetIntVar( playerid, "LegShot", 0 ) ;
- SetPlayerHealth( playerid, 100 ) ;
- ClearAnimations( playerid ) ;
- for( new i; i <= injuredtimes[ playerid ]; i++ ){
- _weapon_damage_player[ playerid ][ i ][ SinceDMG ] = 0 ;
- _weapon_damage_player[ playerid ][ i ][ Weapon ] = 0 ;
- _weapon_damage_player[ playerid ][ i ][ Bodypart ] = 0 ;
- _weapon_damage_player[ playerid ][ i ][ Amount ] = 0 ;
- _weapon_damage_player[ playerid ][ i ][ KevlarHit ] = 0 ;
- stop _weapon_damage_player[ playerid ][ i ][ Time ] ;
- #if defined SVDEBUG
- SCMEx( playerid, -1, "damage %d cleared!", i ) ;
- #endif
- }
- injuredtimes[ playerid ] = 0 ;
- playerdead[ playerid ] = 0 ;
- return 1 ;
- }
- DisplayDamages( playerid, pid ){
- new
- damagesmsg[ 1024 ],
- dialogname[ 32 ] ;
- for( new i; i <= injuredtimes[ pid ]; i++ ){
- if( _weapon_damage_player[ pid ][ i ][ Bodypart ] != 0 ){
- format( damagesmsg, sizeof( damagesmsg ), "%s%d.0000 dmg from %s to %s (KEVLARHIT: %d) %d s ago\n", damagesmsg, _weapon_damage_player[ pid ][ i ][ Amount ], GetWeaponNameEx( _weapon_damage_player[ pid ][ i ][ Weapon ] ), GetBodyPartName( _weapon_damage_player[ pid ][ i ][ Bodypart ] ), _weapon_damage_player[ pid ][ i ][ KevlarHit ], _weapon_damage_player[ pid ][ i ][ SinceDMG ] ) ;
- }
- else if( i == 0 && _weapon_damage_player[ pid ][ i ][ Bodypart ] == 0 ){ format( damagesmsg, sizeof( damagesmsg ), "There's no damage to be shown..." ) ; }
- }
- format( dialogname, sizeof( dialogname ), "%s", GetPlayersName( pid ) ) ;
- ShowDialog( playerid, Show:<PlayerDamages>, DIALOG_STYLE_LIST, dialogname, damagesmsg, "Close", "" ) ;
- format( damagesmsg, sizeof( damagesmsg ), "" ) ;
- return 1 ;
- }
- public OnPlayerGiveDamage( playerid, damagedid, Float: amount, weaponid, bodypart ){
- return 1 ;
- }
- public OnPlayerTakeDamage( playerid, issuerid, Float: amount, weaponid, bodypart ){
- new
- Float: health,
- Float: armour,
- wepid = GetPlayerWeapon( issuerid ) ;
- GetPlayerHealth( playerid, health ) ;
- GetPlayerArmour( playerid, armour ) ;
- if( GetIntVar( playerid, "gLogged" ) == 1 ){
- if( IsValidCRPWeapon( weaponid ) ){
- if( health > 25 ){
- if( GetIntVar( playerid, "BrutallyWounded" ) == 0 ){
- if( _weapon_damage_data[ wepid ][ DamageHP ] > health ){
- SetPlayerHealth( playerid, health-( _weapon_damage_data[ wepid ][ DamageHP ] / 3 ) ) ;
- InsertDamage( playerid, weaponid, bodypart ) ;
- }else{
- InsertDamage( playerid, weaponid, bodypart ) ;
- SetPlayerHealth( playerid, health-_weapon_damage_data[ wepid ][ DamageHP ] ) ;
- }
- }if( bodypart == BODY_PART_RIGHT_LEG || bodypart == BODY_PART_LEFT_LEG ){
- SetIntVar( playerid, "LegShot", 1 ) ;
- }
- }else if( health <= 25 ){
- if( GetIntVar( playerid, "BrutallyWounded" ) == 0 ){
- SetBrutallyWounded( playerid ) ;
- }else if( GetIntVar( playerid, "BrutallyWounded" ) == 1 ){
- SetIntVar( playerid, "BrutallyWounded", 2 ) ;
- }
- }
- }else{
- AntiWeaponCheats( issuerid ) ;
- }
- }
- return 1;
- }
- public OnPlayerWeaponShot( playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ ) {
- if( hittype == BULLET_HIT_TYPE_PLAYER ){
- new
- Float: health,
- Float: armour ;
- GetPlayerHealth( hitid, health ) ;
- GetPlayerArmour( hitid, armour ) ;
- if( health <= 25 && GetIntVar( hitid, "BrutallyWounded" ) == 2 ) {
- SetDead( hitid ) ;
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement