Raised This Month: $ Target: $400
 0% 

SuperAwp


Post New Thread Reply   
 
Thread Tools Display Modes
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
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 09-04-2007 , 15:18   Re: SuperAwp
Reply With Quote #2

so like someone press the fire button whit the awp somewhare else 5 people get killd ?
__________________
If one of my plugins become broken, contact me by mail. [email protected]
fxfighter is offline
Send a message via MSN to fxfighter
aportner
Member
Join Date: Nov 2004
Old 09-04-2007 , 15:27   Re: SuperAwp
Reply With Quote #3

Exactly. It seems like this is the way to do it as I heard FakeDamage doesn't work so well.

Plus this method works exactly when the gun is fired. If there's a better way to do this I'm open to suggestions.
aportner is offline
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 09-04-2007 , 15:31   Re: SuperAwp
Reply With Quote #4

you can like this sounds insane but did it once you can like catch the mouse press event and easy exe kill cmds one the players you want.
like someone fire a gun and if it is a awp and admin just slay 5 guys
__________________
If one of my plugins become broken, contact me by mail. [email protected]
fxfighter is offline
Send a message via MSN to fxfighter
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 09-04-2007 , 15:34   Re: SuperAwp
Reply With Quote #5

Why don't you simply kill all players with user_silentkill and then make fake death messages with headshot ?
ConnorMcLeod is offline
fxfighter
Veteran Member
Join Date: Feb 2007
Location: Trollhättan
Old 09-04-2007 , 15:42   Re: SuperAwp
Reply With Quote #6

Code:
 
 
#include <amxmodx>
#include <fakemeta>
//...
register_forward(FM_PlayerPreThink, "fwdPlayerPreThink");
//...
public fwdPlayerPreThink(id) {
    if(pev(id, pev_button) & IN_ATTACK && get_user_weapon(id) == CSW_AWP) {
        //... kill the dudes heer
    }
}
shuld work notice this event get trigerd like 5-10 times if you hold down fire key
__________________
If one of my plugins become broken, contact me by mail. [email protected]
fxfighter is offline
Send a message via MSN to fxfighter
aportner
Member
Join Date: Nov 2004
Old 09-04-2007 , 15:42   Re: SuperAwp
Reply With Quote #7

I might just end up doing that then. The weird thing is that the TraceLine code works but it only kills a maximum of 3 people and I have no idea why it stops working there. Oh well looks like I'll have to fake a death msg.
aportner is offline
_Master_
Senior Member
Join Date: Dec 2006
Old 09-05-2007 , 03:33   Re: SuperAwp
Reply With Quote #8

Are you sure you got it right in here ?
PHP Code:
for (index ENTINDEX(superAwp) + 1index <= gpGlobals->maxClientsindex++) 
_Master_ is offline
aportner
Member
Join Date: Nov 2004
Old 09-05-2007 , 19:25   Re: SuperAwp
Reply With Quote #9

yeah, SuperAwp is always assigned to the first entity in that list. so it just goes through it like that
aportner is offline
[ --<-@ ] Black Rose
ANNIHILATED
Join Date: Sep 2005
Location: Stockholm, Sweden.
Old 09-06-2007 , 04:51   Re: SuperAwp
Reply With Quote #10

"->" Is that something new?
I've never seen it before. Isn't that C++ or something?
[ --<-@ ] Black Rose is offline
Reply



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 11:36.


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