Results 1 to 8 of 8
  1. #1
    jorricks3's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    The netherlands, limburg
    Posts
    199
    Reputation
    10
    Thanks
    49
    My Mood
    Drunk

    What is wrong with my antinoscope mod?

    Code:
    Callback_PlayerDamage_internal( eInflictor, eAttacker, victim, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime )
    {	
     	if(distance(eAttacker.origin, victim.origin) <= 200 && eAttacker playerADS() == 0 && sWeapon == "cheytac_fmj_xmags_mp") {
    		iDamage = 0;
    		eAttacker iPrintlnBold("^2Do ^3NOT ^2Close Range No Scope!");
    	}
    	
    	if(sMeansOfDeath == "MOD_MELEE" && !IsSubStr( sweapon, "riotshield" )) {
    		iDamage = 0.0;
    		} else {
    		iDamage = 9999;
    	}
    
    	if(victim.AoEactive)
    	if ( !isPlayer( eAttacker ) || eAttacker == victim )
    	iDamage = 0;
    	else
    	if(sWeapon != "concussion_grenade_mp")
    	if(eInflictor.doSuperDamage)
    	if(iDamage != 1)
    	if(sWeapon != "none")
    	iDamage = 9999;
    
    	
    	if ( !isReallyAlive( victim ) )
    		return;
    	
    	if ( isDefined( eAttacker ) && eAttacker.classname == "script_origin" && isDefined( eAttacker.type ) && eAttacker.type == "soft_landing" )
    		return;
    	
    	if ( isDefined( level.hostMigrationTimer ) )
    		return;
    	
    	if ( sMeansOfDeath == "MOD_FALLING" )
    		victim thread emitFallDamage( iDamage );
    		
    	if ( sMeansOfDeath == "MOD_EXPLOSIVE_BULLET" && iDamage != 1 )
    	{
    		iDamage *= getDvarFloat( "scr_explBulletMod" );	
    		iDamage = int( iDamage );
    	}
    
    	if ( isDefined( eAttacker ) && eAttacker.classname == "worldspawn" )
    		eAttacker = undefined;
    	
    	if ( isDefined( eAttacker ) && isDefined( eAttacker.gunner ) )
    		eAttacker = eAttacker.gunner;
    	
    	attackerIsNPC = isDefined( eAttacker ) && !isDefined( eAttacker.gunner ) && (eAttacker.classname == "script_vehicle" || eAttacker.classname == "misc_turret" || eAttacker.classname == "script_model");
    	attackerIsHittingTeammate = level.teamBased && isDefined( eAttacker ) && ( victim != eAttacker ) && isDefined( eAttacker.team ) && ( victim.pers[ "team" ] == eAttacker.team );
    
    	stunFraction = 0.0;
    
    	
    	
    	if ( iDFlags & level.iDFLAGS_STUN )
    	{
    		stunFraction = 0.0;
    		//victim StunPlayer( 1.0 );
    		iDamage = 0.0;
    	}
    	else if ( sHitLoc == "shield" )
    	{
    		if ( attackerIsHittingTeammate && level.friendlyfire == 0 )
    			return;
    		
    		if ( sMeansOfDeath == "MOD_PISTOL_BULLET" || sMeansOfDeath == "MOD_RIFLE_BULLET" || sMeansOfDeath == "MOD_EXPLOSIVE_BULLET" && !attackerIsHittingTeammate )
    		{
    			if ( isPlayer( eAttacker ) )
    			{
    				eAttacker.lastAttackedShieldPlayer = victim;
    				eAttacker.lastAttackedShieldTime = getTime();
    			}
    			victim notify ( "shield_blocked" );
    
    			// fix turret + shield challenge exploits
    			if ( sWeapon == "turret_minigun_mp" )
    				shieldDamage = 25;
    			else
    				shieldDamage = maps\mp\perks\_perks::cac_modified_damage( victim, eAttacker, iDamage, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc );
    						
    			victim.shieldDamage += shieldDamage;
    
    			// fix turret + shield challenge exploits
    			if ( sWeapon != "turret_minigun_mp" || cointoss() )
    				victim.shieldBulletHits++;
    
    			if ( victim.shieldBulletHits >= level.riotShieldXPBullets )
    			{
    				if ( self.recentShieldXP > 4 )
    					xpVal = int( 50 / self.recentShieldXP );
    				else
    					xpVal = 50;
    				
    				printLn( xpVal );
    				
    				victim thread maps\mp\gametypes\_rank::giveRankXP( "shield_damage", xpVal );
    				victim thread giveRecentShieldXP();
    				
    				victim thread maps\mp\gametypes\_missions::genericChallenge( "shield_damage", victim.shieldDamage );
    
    				victim thread maps\mp\gametypes\_missions::genericChallenge( "shield_bullet_hits", victim.shieldBulletHits );
    				
    				victim.shieldDamage = 0;
    				victim.shieldBulletHits = 0;
    			}
    		}
    
    		if ( iDFlags & level.iDFLAGS_SHIELD_EXPLOSIVE_IMPACT )
    		{
    			if (  !attackerIsHittingTeammate )
    				victim thread maps\mp\gametypes\_missions::genericChallenge( "shield_explosive_hits", 1 );
    
    			sHitLoc = "none";	// code ignores any damage to a "shield" bodypart.
    			if ( !(iDFlags & level.iDFLAGS_SHIELD_EXPLOSIVE_IMPACT_HUGE) )
    				iDamage *= 0.0;
    		}
    		else if ( iDFlags & level.iDFLAGS_SHIELD_EXPLOSIVE_SPLASH )
    		{
    			if ( isDefined( eInflictor ) && isDefined( eInflictor.stuckEnemyEntity ) && eInflictor.stuckEnemyEntity == victim ) //does enough damage to shield carrier to ensure death
    				iDamage = 101;
    			
    			victim thread maps\mp\gametypes\_missions::genericChallenge( "shield_explosive_hits", 1 );
    			sHitLoc = "none";	// code ignores any damage to a "shield" bodypart.
    		}
    		else
    		{
    			return;
    		}
    	}
    	else if ( (smeansofdeath == "MOD_MELEE") && IsSubStr( sweapon, "riotshield" ) )
    	{
    		if ( !(attackerIsHittingTeammate && (level.friendlyfire == 0)) )
    		{
    			stunFraction = 0.0;
    			victim StunPlayer( 0.0 );
    		}
    	}
    
    	if ( !attackerIsHittingTeammate )
    		iDamage = maps\mp\perks\_perks::cac_modified_damage( victim, eAttacker, iDamage, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc );
    	
    	if ( !iDamage )
    		return false;
    	
    	victim.iDFlags = iDFlags;
    	victim.iDFlagsTime = getTime();
    
    	if ( game[ "state" ] == "postgame" )
    		return;
    	if ( victim.sessionteam == "spectator" )
    		return;
    	if ( isDefined( victim.canDoCombat ) && !victim.canDoCombat )
    		return;
    	if ( isDefined( eAttacker ) && isPlayer( eAttacker ) && isDefined( eAttacker.canDoCombat ) && !eAttacker.canDoCombat )
    		return;
    
    	// handle vehicles/turrets and friendly fire
    	if ( attackerIsNPC && attackerIsHittingTeammate )
    	{
    		if ( sMeansOfDeath == "MOD_CRUSH" )
    		{
    			victim _suicide();
    			return;
    		}
    		
    		if ( !level.friendlyfire )
    			return;
    	}
    
    	prof_begin( "PlayerDamage flags/tweaks" );
    
    	// Don't do knockback if the damage direction was not specified
    	if ( !isDefined( vDir ) )
    		iDFlags |= level.iDFLAGS_NO_KNOCKBACK;
    
    	friendly = false;
    
    	if ( ( victim.health == victim.maxhealth && ( !isDefined( victim.lastStand ) || !victim.lastStand )  ) || !isDefined( victim.attackers ) && !isDefined( victim.lastStand )  )
    	{
    		victim.attackers = [];
    		victim.attackerData = [];
    	}
    
    	if ( isHeadShot( sWeapon, sHitLoc, sMeansOfDeath, eAttacker ) )
    		sMeansOfDeath = "MOD_HEAD_SHOT";
    
    	if ( maps\mp\gametypes\_tweakables::getTweakableValue( "game", "onlyheadshots" ) )
    	{
    		if ( sMeansOfDeath == "MOD_PISTOL_BULLET" || sMeansOfDeath == "MOD_RIFLE_BULLET" || sMeansOfDeath == "MOD_EXPLOSIVE_BULLET" )
    			return;
    		else if ( sMeansOfDeath == "MOD_HEAD_SHOT" )
    			iDamage = 150;
    	}
    
    	// explosive barrel/car detection
    	if ( sWeapon == "none" && isDefined( eInflictor ) )
    	{
    		if ( isDefined( eInflictor.destructible_type ) && isSubStr( eInflictor.destructible_type, "vehicle_" ) )
    			sWeapon = "destructible_car";
    	}
    
    	prof_end( "PlayerDamage flags/tweaks" );
    
    	// check for completely getting out of the damage
    	if ( !(iDFlags & level.iDFLAGS_NO_PROTECTION) )
    	{
    		// items you own don't damage you in FFA
    		if ( !level.teamBased && attackerIsNPC && isDefined( eAttacker.owner ) && eAttacker.owner == victim )
    		{
    			prof_end( "PlayerDamage player" );
    
    			if ( sMeansOfDeath == "MOD_CRUSH" )
    				victim _suicide();
    
    			return;
    		}
    
    		if ( ( isSubStr( sMeansOfDeath, "MOD_GRENADE" ) || isSubStr( sMeansOfDeath, "MOD_EXPLOSIVE" ) || isSubStr( sMeansOfDeath, "MOD_PROJECTILE" ) ) && isDefined( eInflictor ) && isDefined( eAttacker ) )
    		{
    			// protect players from spawnkill grenades
    			if ( eInflictor.classname == "grenade" && ( victim.lastSpawnTime + 3500 ) > getTime() && isDefined( victim.lastSpawnPoint ) && distance( eInflictor.origin, victim.lastSpawnPoint.origin ) < 250 )
    			{
    				prof_end( "PlayerDamage player" );
    				return;
    			}
    
    			victim.explosiveInfo = [];
    			victim.explosiveInfo[ "damageTime" ] = getTime();
    			victim.explosiveInfo[ "damageId" ] = eInflictor getEntityNumber();
    			victim.explosiveInfo[ "returnToSender" ] = false;
    			victim.explosiveInfo[ "counterKill" ] = false;
    			victim.explosiveInfo[ "chainKill" ] = false;
    			victim.explosiveInfo[ "cookedKill" ] = false;
    			victim.explosiveInfo[ "throwbackKill" ] = false;
    			victim.explosiveInfo[ "suicideGrenadeKill" ] = false;
    			victim.explosiveInfo[ "weapon" ] = sWeapon;
    
    			isFrag = isSubStr( sWeapon, "frag_" );
    
    			if ( eAttacker != victim )
    			{
    				if ( ( isSubStr( sWeapon, "c4_" ) || isSubStr( sWeapon, "claymore_" ) ) && isDefined( eAttacker ) && isDefined( eInflictor.owner ) )
    				{
    					victim.explosiveInfo[ "returnToSender" ] = ( eInflictor.owner == victim );
    					victim.explosiveInfo[ "counterKill" ] = isDefined( eInflictor.wasDamaged );
    					victim.explosiveInfo[ "chainKill" ] = isDefined( eInflictor.wasChained );
    					victim.explosiveInfo[ "bulletPenetrationKill" ] = isDefined( eInflictor.wasDamagedFromBulletPenetration );
    					victim.explosiveInfo[ "cookedKill" ] = false;
    				}
    
    				if ( isDefined( eAttacker.lastGrenadeSuicideTime ) && eAttacker.lastGrenadeSuicideTime >= gettime() - 50 && isFrag )
    					victim.explosiveInfo[ "suicideGrenadeKill" ] = true;
    			}
    
    			if ( isFrag )
    			{
    				victim.explosiveInfo[ "cookedKill" ] = isDefined( eInflictor.isCooked );
    				victim.explosiveInfo[ "throwbackKill" ] = isDefined( eInflictor.threwBack );
    			}
    			
    			victim.explosiveInfo[ "stickKill" ] = isDefined( eInflictor.isStuck ) && eInflictor.isStuck == "enemy";
    			victim.explosiveInfo[ "stickFriendlyKill" ] = isDefined( eInflictor.isStuck ) && eInflictor.isStuck == "friendly";
    		}
    	
    		if ( isPlayer( eAttacker ) )
    			eAttacker.pers[ "participation" ]++ ;
    
    		prevHealthRatio = victim.health / victim.maxhealth;
    
    		if ( attackerIsHittingTeammate )
    		{
    			if ( !matchMakingGame() && isPlayer(eAttacker) )
    				eAttacker incPlayerStat( "mostff", 1 );
    			
    			prof_begin( "PlayerDamage player" );// profs automatically end when the function returns
    			if ( level.friendlyfire == 0 || ( !isPlayer(eAttacker) && level.friendlyfire != 1 ) )// no one takes damage
    			{
    				if ( sWeapon == "artillery_mp" || sWeapon == "stealth_bomb_mp" )
    					victim damageShellshockAndRumble( eInflictor, sWeapon, sMeansOfDeath, iDamage, iDFlags, eAttacker );
    				return;
    			}
    			else if ( level.friendlyfire == 1 )// the friendly takes damage
    			{
    				if ( iDamage < 1 )
    					iDamage = 1;
    
    				victim.lastDamageWasFromEnemy = false;
    
    				victim finishPlayerDamageWrapper( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime, stunFraction );
    			}
    			else if ( ( level.friendlyfire == 2 ) && isReallyAlive( eAttacker ) )// only the attacker takes damage
    			{
    				iDamage = int( iDamage * .5 );
    				if ( iDamage < 1 )
    					iDamage = 1;
    
    				eAttacker.lastDamageWasFromEnemy = false;
    
    				eAttacker.friendlydamage = true;
    				eAttacker finishPlayerDamageWrapper( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime, stunFraction );
    				eAttacker.friendlydamage = undefined;
    			}
    			else if ( level.friendlyfire == 3 && isReallyAlive( eAttacker ) )// both friendly and attacker take damage
    			{
    				iDamage = int( iDamage * .5 );
    				if ( iDamage < 1 )
    					iDamage = 1;
    
    				victim.lastDamageWasFromEnemy = false;
    				eAttacker.lastDamageWasFromEnemy = false;
    
    				victim finishPlayerDamageWrapper( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime, stunFraction );
    				if ( isReallyAlive( eAttacker ) )// may have died due to friendly fire punishment
    				{
    					eAttacker.friendlydamage = true;
    					eAttacker finishPlayerDamageWrapper( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime, stunFraction );
    					eAttacker.friendlydamage = undefined;
    				}
    			}
    
    			friendly = true;
    			
    		}
    		else// not hitting teammate
    		{
    			prof_begin( "PlayerDamage world" );
    
    			if ( iDamage < 1 )
    				iDamage = 1;
    
    			if ( isDefined( eAttacker ) && isPlayer( eAttacker ) )
    				addAttacker( victim, eAttacker, eInflictor, sWeapon, iDamage, vPoint, vDir, sHitLoc, psOffsetTime, sMeansOfDeath );
    			
    			if ( sMeansOfDeath == "MOD_EXPLOSIVE" || sMeansOfDeath == "MOD_GRENADE_SPLASH" && iDamage < victim.health )
    				victim notify( "survived_explosion" );
    
    			if ( isdefined( eAttacker ) )
    				level.lastLegitimateAttacker = eAttacker;
    
    			if ( isdefined( eAttacker ) && isPlayer( eAttacker ) && isDefined( sWeapon ) )
    				eAttacker thread maps\mp\gametypes\_weapons::checkHit( sWeapon, victim );
    
    			if ( isdefined( eAttacker ) && isPlayer( eAttacker ) && isDefined( sWeapon ) && eAttacker != victim )
    			{
    				eAttacker thread maps\mp\_events::damagedPlayer( self, iDamage, sWeapon );
    				victim.attackerPosition = eAttacker.origin;
    			}
    			else
    			{
    				victim.attackerPosition = undefined;
    			}
    
    			if ( issubstr( sMeansOfDeath, "MOD_GRENADE" ) && isDefined( eInflictor.isCooked ) )
    				victim.wasCooked = getTime();
    			else
    				victim.wasCooked = undefined;
    
    			victim.lastDamageWasFromEnemy = ( isDefined( eAttacker ) && ( eAttacker != victim ) );
    
    			if ( victim.lastDamageWasFromEnemy )
    				eAttacker.damagedPlayers[ victim.guid ] = getTime();
    
    			victim finishPlayerDamageWrapper( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime, stunFraction );
    
    			if ( isDefined( level.ac130player ) && isDefined( eAttacker ) && ( level.ac130player == eAttacker ) )
    				level notify( "ai_pain", victim );
    
    			victim thread maps\mp\gametypes\_missions::playerDamaged( eInflictor, eAttacker, iDamage, sMeansOfDeath, sWeapon, sHitLoc );
    
    			prof_end( "PlayerDamage world" );
    			
    		}
    
    		if ( attackerIsNPC && isDefined( eAttacker.gunner ) )
    			damager = eAttacker.gunner;
    		else
    			damager = eAttacker;
    
    		if ( isDefined( damager) && damager != victim && iDamage > 0 )
    		{
    			if ( iDFlags & level.iDFLAGS_STUN )
    				typeHit = "stun";
    			else if ( victim hasPerk( "specialty_armorvest", true ) || (isExplosiveDamage( sMeansOfDeath ) && victim _hasPerk( "_specialty_blastshield" )) )
    				typeHit = "hitBodyArmor";
    			else if ( victim _hasPerk( "specialty_combathigh") )
    				typeHit = "hitEndGame";
    			else
    				typeHit = "standard";
    				
    			damager thread maps\mp\gametypes\_damagefeedback::updateDamageFeedback( typeHit );
    		}
    
    		victim.hasDoneCombat = true;
    	}
    
    	if ( isdefined( eAttacker ) && ( eAttacker != victim ) && !friendly )
    		level.useStartSpawns = false;
    
    
    	//=================
    	// Damage Logging
    	//=================
    
    	prof_begin( "PlayerDamage log" );
    
    	// why getEntityNumber() for victim and .clientid for attacker?
    	if ( getDvarInt( "g_debugDamage" ) )
    		println( "client:" + victim getEntityNumber() + " health:" + victim.health + " attacker:" + eAttacker.clientid + " inflictor is player:" + isPlayer( eInflictor ) + " damage:" + iDamage + " hitLoc:" + sHitLoc );
    
    	if ( victim.sessionstate != "dead" )
    	{
    		lpselfnum = victim getEntityNumber();
    		lpselfname = victim.name;
    		lpselfteam = victim.pers[ "team" ];
    		lpselfGuid = victim.guid;
    		lpattackerteam = "";
    
    		if ( isPlayer( eAttacker ) )
    		{
    			lpattacknum = eAttacker getEntityNumber();
    			lpattackGuid = eAttacker.guid;
    			lpattackname = eAttacker.name;
    			lpattackerteam = eAttacker.pers[ "team" ];
    		}
    		else
    		{
    			lpattacknum = -1;
    			lpattackGuid = "";
    			lpattackname = "";
    			lpattackerteam = "world";
    		}
    
    		logPrint( "D;" + lpselfGuid + ";" + lpselfnum + ";" + lpselfteam + ";" + lpselfname + ";" + lpattackGuid + ";" + lpattacknum + ";" + lpattackerteam + ";" + lpattackname + ";" + sWeapon + ";" + iDamage + ";" + sMeansOfDeath + ";" + sHitLoc + "\n" );
    	}
    
    	HitlocDebug( eAttacker, victim, iDamage, sHitLoc, iDFlags );
    
    	/*if( isDefined( eAttacker ) && eAttacker != victim )
    	{
    		if ( isPlayer( eAttacker ) )
    			eAttacker incPlayerStat( "damagedone", iDamage );
    		
    		victim incPlayerStat( "damagetaken", iDamage );
    	}*/
    
    	prof_end( "PlayerDamage log" );
    }
    
    
    addAttacker( victim, eAttacker, eInflictor, sWeapon, iDamage, vPoint, vDir, sHitLoc, psOffsetTime, sMeansOfDeath )
    {
    	if ( !isDefined( victim.attackerData ) )
    		victim.attackerData = [];
    	
    	if ( !isDefined( victim.attackerData[ eAttacker.guid ] ) )
    	{
    		victim.attackers[ eAttacker.guid ] = eAttacker;
    		// we keep an array of attackers by their client ID so we can easily tell
    		// if they're already one of the existing attackers in the above if().
    		// we store in this array data that is useful for other things, like challenges
    		victim.attackerData[ eAttacker.guid ] = SpawnStruct();
    		victim.attackerData[ eAttacker.guid ].damage = 0;	
    		victim.attackerData[ eAttacker.guid ].attackerEnt = eAttacker;
    		victim.attackerData[ eAttacker.guid ].firstTimeDamaged = getTime();				
    	}
    	if ( maps\mp\gametypes\_weapons::isPrimaryWeapon( sWeapon ) && ! maps\mp\gametypes\_weapons::isSideArm( sWeapon ) )
    		victim.attackerData[ eAttacker.guid ].isPrimary = true;
    	
    	victim.attackerData[ eAttacker.guid ].damage += iDamage;
    	victim.attackerData[ eAttacker.guid ].weapon = sWeapon;
    	victim.attackerData[ eAttacker.guid ].vPoint = vPoint;
    	victim.attackerData[ eAttacker.guid ].vDir = vDir;
    	victim.attackerData[ eAttacker.guid ].sHitLoc = sHitLoc;
    	victim.attackerData[ eAttacker.guid ].psOffsetTime = psOffsetTime;
    	victim.attackerData[ eAttacker.guid ].sMeansOfDeath = sMeansOfDeath;
    	victim.attackerData[ eAttacker.guid ].attackerEnt = eAttacker;
    	victim.attackerData[ eAttacker.guid ].lasttimeDamaged = getTime();
    	
    	if ( isDefined( eInflictor ) && !isPlayer( eInflictor ) && isDefined( eInflictor.primaryWeapon ) )
    		victim.attackerData[ eAttacker.guid ].sPrimaryWeapon = eInflictor.primaryWeapon;
    	else if ( isDefined( eAttacker ) && isPlayer( eAttacker ) && eAttacker getCurrentPrimaryWeapon() != "none" )
    		victim.attackerData[ eAttacker.guid ].sPrimaryWeapon = eAttacker getCurrentPrimaryWeapon();
    	else
    		victim.attackerData[ eAttacker.guid ].sPrimaryWeapon = undefined;
    }
    
    resetAttackerList()
    {
    	self endon( "disconnect" );
    	self endon( "death" );
    	level endon( "game_ended" );
    	
    	//wait is to offset premature calling in _healthOverlay
    	wait( 1.75 ); 
    	self.attackers = [];
    	self.attackerData = [];
    }
    
    
    Callback_PlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime )
    {
    	Callback_PlayerDamage_internal( eInflictor, eAttacker, self, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime );
    }
    
    
    finishPlayerDamageWrapper( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime, stunFraction )
    {
    	if ( (self isUsingRemote() ) && (iDamage >= self.health) && !(iDFlags & level.iDFLAGS_STUN) )
    	{
    		if ( !isDefined( vDir ) )
    			vDir = ( 0,0,0 );
    
    		if ( !isDefined( eAttacker ) && !isDefined( eInflictor ) )
    		{
    			eAttacker = self;
    			eInflictor = eAttacker;
    		}
    		
    		assert( isDefined( eAttacker ) );
    		assert( isDefined( eInflictor ) );
    
    		PlayerKilled_internal( eInflictor, eAttacker, self, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, 0, true );
    	}
    	else
    	{
    		if ( !self Callback_KillingBlow( eInflictor, eAttacker, iDamage - (iDamage * stunFraction), iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime ) )
    			return;
    
    		self finishPlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime, stunFraction );
    	}
    
    	if ( sMeansOfDeath == "MOD_EXPLOSIVE_BULLET" )
    		self shellShock( "damage_mp", getDvarFloat( "scr_csmode" ) );
    
    	self damageShellshockAndRumble( eInflictor, sWeapon, sMeansOfDeath, iDamage, iDFlags, eAttacker );
    }
    
    
    Callback_PlayerLastStand( eInflictor, attacker, iDamage, sMeansOfDeath, sWeapon, vDir, sHitLoc, psOffsetTime, deathAnimDuration )
    {	
    		
    	lastStandParams = spawnStruct();
    	lastStandParams.eInflictor = eInflictor;
    	lastStandParams.attacker = attacker;
    	lastStandParam*****amage = iDamage;
    	lastStandParams.attackerPosition = attacker.origin;
    	if ( attacker == self )
    		lastStandParams.sMeansOfDeath = "MOD_SUICIDE";
    	else
    		lastStandParams.sMeansOfDeath = sMeansOfDeath;
    	
    	lastStandParams.sWeapon = sWeapon;
    	if ( isDefined( attacker ) && isPlayer( attacker ) && attacker getCurrentPrimaryWeapon() != "none" )
    		lastStandParams.sPrimaryWeapon = attacker getCurrentPrimaryWeapon();
    	else
    		lastStandParams.sPrimaryWeapon = undefined;
    	lastStandParams.vDir = vDir;
    	lastStandParams.sHitLoc = sHitLoc;
    	lastStandParams.lastStandStartTime = getTime();
    
    	mayDoLastStand = mayDoLastStand( sWeapon, sMeansOfDeath, sHitLoc );
    	
    	//if ( mayDoLastStand )
    	//	mayDoLastStand = !self checkForceBleedOut();
    	
    	if ( isDefined( self.endGame ) )
    		mayDoLastStand = false;
    	
    	if ( level.teamBased && isDefined( attacker.team ) && attacker.team == self.team )
    		mayDoLastStand = false;
    
    	 /#
    	if ( getdvar( "scr_forcelaststand" ) == "1" )
    		mayDoLastStand = true;
    	#/
    	
    	if ( !mayDoLastStand )
    	{
    		self.lastStandParams = lastStandParams;
    		self.useLastStandParams = true;
    		self _suicide();
    		return;
    	}
    	
    	self.inLastStand = true;
    
    	notifyData = spawnStruct();
    	if ( self _hasPerk( "specialty_finalstand" ) )
    	{
    		notifyData.titleText = game[ "strings" ][ "final_stand" ];
    		notifyData.iconName = "specialty_finalstand";
    	}
    	else
    	{
    		notifyData.titleText = game[ "strings" ][ "last_stand" ];
    		notifyData.iconName = "specialty_pistoldeath";
    	}
    	notifyData.glowColor = ( 1, 0, 0 );
    	notifyData.sound = "mp_last_stand";
    	notifyData.duration = 2.0;
    
    	self.health = 1;
    
    	self thread maps\mp\gametypes\_hud_message::notifyMessage( notifyData );
    
    	grenadeTypePrimary = "frag_grenade_mp";
    
    	if ( isDefined( level.ac130player ) && isDefined( attacker ) && level.ac130player == attacker )
    		level notify( "ai_crawling", self );
    	
    	if ( self _hasPerk( "specialty_finalstand" ) )
    	{
    		self.lastStandParams = lastStandParams;
    		self.inFinalStand = true;
    		
    		weaponList = self GetWeaponsListExclusives();
    		foreach ( weapon in weaponList )
    			self takeWeapon( weapon );
    		
    		self _disableUsability();
    
    		self thread enableLastStandWeapons();
    		self thread lastStandTimer( 20, true );		
    	}
    	/*
    	else if ( self _hasPerk( "specialty_c4death" ) )
    	{
    		self.lastStandParams = lastStandParams;
    
    		self takeAllWeapons();
    		self giveWeapon( "c4Death_mp", 0, false );
    		self switchToWeapon( "c4Death_mp" );
    		self _disableUsability();
    		self.inC4Death = true;
    				
    		//self thread dieAfterTime( 7 );
    		self thread lastStandTimer( 10, false );	
    		self thread detonateOnUse();
    		//self thread detonateOnDeath();	
    	}
    	*/
    	else if ( level.dieHardMode )
    	{	
    		self.lastStandParams = lastStandParams;
    		self thread enableLastStandWeapons();
    		self thread lastStandTimer( 20, false );
    		self _disableUsability();
    	}
    	else // normal last stand
    	{
    		self.lastStandParams = lastStandParams;
    		
    		pistolWeapon = undefined;
    		
    		weaponsList = self GetWeaponsListPrimaries();
    		foreach ( weapon in weaponsList )
    		{
    			if ( maps\mp\gametypes\_weapons::isSideArm( weapon ) )
    				pistolWeapon = weapon;			
    		}
    			
    		if ( !isDefined( pistolWeapon ) )
    		{
    			pistolWeapon = "beretta_mp";
    			self _giveWeapon( pistolWeapon );
    		}
    	
    		self giveMaxAmmo( pistolWeapon );
    		self DisableWeaponSwitch();
    		self _disableUsability();
    		
    		if ( !self _hasPerk("specialty_laststandoffhand") )
    			self DisableOffhandWeapons();
    				
    		self switchToWeapon( pistolWeapon );
    		
    		self thread lastStandTimer( 10, false );
    	}
    }
    What part is incorrect??
    If i noscope I get the kill but i get the message to..
    and if I knife someone I get the message to..
    Please help






  2. #2
    mathieutje12's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Close to my PC
    Posts
    578
    Reputation
    14
    Thanks
    166
    My Mood
    Angelic
    Its all correct.
    1.When u knife u have intervention in ur hand so its closerange noscope.
    2.And if you zoom only a little bit u can kill him or the distance is to short and u can ns him too.

  3. #3
    jorricks3's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    The netherlands, limburg
    Posts
    199
    Reputation
    10
    Thanks
    49
    My Mood
    Drunk
    But it is normal that if u crns u get the kill?
    Is it also able that i make my hoe screen black for 5secs after a crns ?
    Last edited by jorricks3; 07-16-2011 at 03:33 AM.

  4. #4
    mathieutje12's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    Close to my PC
    Posts
    578
    Reputation
    14
    Thanks
    166
    My Mood
    Angelic
    Quote Originally Posted by jorricks3 View Post
    But it is normal that if u crns u get the kill?
    Is it also able that i make my hoe screen black for 5secs after a crns ?
    If the distance is 200 and he is staying at 201 he can crns yeah..
    And yes thats possible
    Something like:
    eAttacker VisionSetNakedForPlayer("black_bw", 1); wait 5.0;
    eAttacker VisionSetNakedForPlayer( getDvar( "mapname" ), 1);

  5. #5
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    154
    My Mood
    Amazed
    Quote Originally Posted by mathieutje12 View Post
    If the distance is 200 and he is staying at 201 he can crns yeah..
    And yes thats possible
    Something like:
    eAttacker VisionSetNakedForPlayer("black_bw", 1); wait 5.0;
    eAttacker VisionSetNakedForPlayer( getDvar( "mapname" ), 1);
    eAttacker VisionSetNakedForPlayer("black_bw", 1); wait 5.0;

    The 1 means 1 second, just put:

    eAttacker VisionSetNakedForPlayer("black_bw", 5);wait 5;

  6. #6
    jorricks3's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    The netherlands, limburg
    Posts
    199
    Reputation
    10
    Thanks
    49
    My Mood
    Drunk
    I mean if i noscope from body to body it still kills it(so without distance it also kill them!)
    and i want the black screen at the moment the guy shoots and that for 5 secs..
    can u guys please give me the code for that :$?


    MY PROBLEM IS = THAT IT GIVES THE MESSAGE BUT IT STILL KILLS TO!!
    Last edited by jorricks3; 07-17-2011 at 04:39 AM.






  7. #7
    Yamato's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Posts
    839
    Reputation
    13
    Thanks
    154
    My Mood
    Amazed
    Quote Originally Posted by jorricks3 View Post
    I mean if i noscope from body to body it still kills it(so without distance it also kill them!)
    and i want the black screen at the moment the guy shoots and that for 5 secs..
    can u guys please give me the code for that :$?
    Dont you read??,

    Code:
     	if(distance(eAttacker.origin, victim.origin) <= 200 && eAttacker playerADS() == 0 && sWeapon == "cheytac_fmj_xmags_mp") {
    		iDamage = 0;
    		eAttacker iPrintlnBold("^2Do ^3NOT ^2Close Range No Scope!");
                    eAttacker VisionSetNakedForPlayer("black_bw", 5);
    	}

  8. #8
    jorricks3's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    The netherlands, limburg
    Posts
    199
    Reputation
    10
    Thanks
    49
    My Mood
    Drunk
    So like this u mean?

    Code:
    Callback_PlayerDamage_internal( eInflictor, eAttacker, victim, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime )
    {	
     	 	if(distance(eAttacker.origin, victim.origin) <= 200 && eAttacker playerADS() == 0 && sWeapon == "cheytac_fmj_xmags_mp") {
    		iDamage = 0;
    		eAttacker iPrintlnBold("^2Do ^3NOT ^2Close Range No Scope!");
                    eAttacker VisionSetNakedForPlayer("black_bw", 5);
    	}
    	
    	if(sMeansOfDeath == "MOD_MELEE" && !IsSubStr( sweapon, "riotshield" )) {
    		iDamage = 0.0;
    		} else {
    		iDamage = 9999;
    	}






Similar Threads

  1. What's wrong with this?
    By yup in forum Visual Basic Programming
    Replies: 4
    Last Post: 03-18-2008, 10:36 AM
  2. what is wrong with this ??
    By floris12345! in forum Visual Basic Programming
    Replies: 5
    Last Post: 01-16-2008, 05:22 PM
  3. What is wrong with my form?
    By Synns in forum Visual Basic Programming
    Replies: 1
    Last Post: 12-18-2007, 04:27 PM
  4. what is wrong with this source?
    By Petros in forum C++/C Programming
    Replies: 6
    Last Post: 07-04-2007, 04:33 PM
  5. What's wrong with MPGH
    By scooby107 in forum WarRock - International Hacks
    Replies: 6
    Last Post: 04-30-2007, 07:45 PM