Raised This Month: $ Target: $400
 0% 

SuperAwp


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
aportner
Member
Join Date: Nov 2004
Old 09-04-2007 , 15:16   SuperAwp
Reply With Quote #1

So I'm coding some stuff for the new moNstrous movie and I'm trying to figure out how to kill all 5 people on the opposite team with one awp shot from anywhere on the map. (I.E. the 5 people can be anywhere on the map, not lined up, etc.) I've got it to work with 3 and I'm trying to figure out how to get it to work with everyone. I know this is in c++ but the principles are the same. Right now I'm hooking TraceLine. SuperAwp is the target being shot and SuperAwper is the person with the awp. This code goes in the hooked version of TraceLine:

Code:
	if (superAwper != NULL && superAwp != NULL && pentToSkip == superAwper && UTIL_IsAlive(superAwper)) {
                // check to see if we killed the target
		if (superAwp->free || !UTIL_IsAlive(superAwp)) {
                        // Find a new target
			for (index = ENTINDEX(superAwp) + 1; index <= gpGlobals->maxClients; index++) {
				pPlayer = INDEXENT(index);

                                // See if there's a player who isn't dead on the other team
				if (superAwp != pPlayer && pPlayer && !pPlayer->free && UTIL_IsAlive(pPlayer) && getTeam(pPlayer) != getTeam(superAwper)) {
					superAwp = pPlayer;
					found = true;
					break;
				}
			}

                        // Check to see if there are no targets
			if (!found) {
				superAwp = NULL;
				RETURN_META(MRES_IGNORED);
			}
		}

                // Call traceline, can probably be removed
		TRACE_LINE(v1, v2, fNoMonsters, pentToSkip, ptr);
		ptr->pHit = superAwp; // Force a hit on the target
		ptr->iHitgroup = 1; // In the head
		ptr->vecEndPos = superAwp->v.origin; // Make blood come out of the guy
		ptr->flPlaneDist = 1; // Not sure if this is right

		RETURN_META(MRES_SUPERCEDE);
	}
I can kill 3 people with 1 awp shot anywhere on the map but it seems CS stops there. Any ideas?
aportner is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode