Raised This Month: $51 Target: $400
 12% 

Implementing slaying, noclip, teleport, et cetera


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
showdax
Senior Member
Join Date: Dec 2004
Old 10-11-2005 , 13:20   Implementing slaying, noclip, teleport, et cetera
Reply With Quote #1

I'm trying the kinds of commands listed in the topic's subject, but I'm running into some issues. I've got CBasePlayer working, but I need to create a CTakeDamageInfo object to give CBasePlayer::Event_Killed() in order for the player to actually die. If I just include game_shared/takedamageinfo.h, I get issues with undefined symbols, but if I try to build the cpp file I end up having to build twenty other cpp files and my plugin ends up being like 10 MB. Is there any way to avoid this? I've tried scanning the memory for the function the constructor calls, then writing my own constructor that calls it, but then I get this segfault:

Code:
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1218535296 (LWP 8685)]
0x01103a89 in CEngineTraceServer::GetWorldCollideable ()
   from ./srcds/bin/engine_i686.so
(gdb) bt
#0  0x01103a89 in CEngineTraceServer::GetWorldCollideable ()
   from ./srcds/bin/engine_i686.so
#1  0x01103b4b in CEngineTrace::TraceRay ()
   from ./srcds/bin/engine_i686.so
#2  0x01ccc3a8 in VecCheckToss ()
   from ./srcds/dod/bin/server_i486.so
#3  0x01c2eece in CBaseCombatCharacter::Weapon_Drop ()
   from ./srcds/dod/bin/server_i486.so
#4  0x01d51b27 in CBasePlayer::Weapon_Drop ()
   from ./srcds/dod/bin/server_i486.so
#5  0x01e65fac in CDODPlayer::DODWeaponDrop ()
   from ./srcds/dod/bin/server_i486.so
#6  0x01e6a412 in CDODPlayer::Event_Killed ()
   from ./srcds/dod/bin/server_i486.so
#7  0x00e5b77c in CAdminTools::slay (this=0xac72168, entity=0xb342502c)
    at CAdminTools.cpp:64
#8  0x00e55ad3 in admin_slay () at cvars.cpp:55
Granted this is in DoD:S, but in CS:S I can't even get to that point. CBasePlayer::IsAlive() always returns false in CS:S for some reason and I have no idea why.

I'm also having this same issue with CBaseEntity::SetMoveType() and CBaseEntity::SetAbsOrigin(), which aren't defined unless I build twenty different cpp files. The former is required for noclip and the latter is required for teleporting players. I've tried scanning memory for those but when I use them it segfaults there too. The pointers should be valid.

Is there a way to do this without building all those files and without scanning memory for functions?
showdax is offline
Send a message via MSN to showdax
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 10-11-2005 , 13:50  
Reply With Quote #2

ExecClient( pEntity, "kill\n" )
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 10-11-2005 , 13:51  
Reply With Quote #3

teleport is pBase->Teleport....
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 10-11-2005 , 13:54  
Reply With Quote #4

Just looked..
Code:
pBase->SetMoveType( MOVETYPE_NOCLIP, MOVECOLLIDE_DEFAULT );
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
showdax
Senior Member
Join Date: Dec 2004
Old 10-11-2005 , 14:06  
Reply With Quote #5

Executing kill on the client isn't reliable at all because they can just alias over it and the command will then do nothing.

I already have the prototype for SetMoveType, but that doesn't help me use it. I need a definition, which is in the cpp file, but compiling that requires compiling a thousand other things which is just a nightmare.

I tried using Teleport() and just setting the position, but that didn't affect anything.

Edit: Actually it stuff seems to work in CS:S now but the segfaults are the same.
showdax is offline
Send a message via MSN to showdax
c0ldfyr3
AlliedModders Donor
Join Date: Aug 2005
Location: Ireland
Old 10-12-2005 , 10:02  
Reply With Quote #6

Teleport works fine, I use it for my slap =)

As per the kill thing, i didnt think they could alias over that ?
__________________
c0ldfyr3 is offline
Send a message via MSN to c0ldfyr3 Send a message via Yahoo to c0ldfyr3
Rex Mundi
Junior Member
Join Date: Dec 2004
Old 10-12-2005 , 14:33  
Reply With Quote #7

I think you can alias over engine-> but not helpers->
Rex Mundi is offline
showdax
Senior Member
Join Date: Dec 2004
Old 10-12-2005 , 15:01  
Reply With Quote #8

Quote:
Originally Posted by c0ldfyr3
Teleport works fine, I use it for my slap =)

As per the kill thing, i didnt think they could alias over that ?
Maybe Teleport just doesn't work under DoD:S, which is what I'm testing this under mainly. I noticed my slap command worked under CS:S but not DoD:S.

You can definitely alias over kill though:
Code:
] alias kill what
] kill
Unknown command: what
You can even do other stupid things like making an alias alias itself and causing an infinite loop and crash. You can set aliases through a server plugin too which is even dumber. There's no way that I know of to unset an alias though.
showdax is offline
Send a message via MSN to showdax
Mani
Veteran Member
Join Date: Dec 2004
Location: UK
Old 10-12-2005 , 20:40  
Reply With Quote #9

Quote:
Originally Posted by Rex Mundi
I think you can alias over engine-> but not helpers->
helpers-> version causes crashes on linux machines.

Mani
__________________
Installation files, documentation and help can be found at: -

www.mani-admin-plugin.com
Mani is offline
Mani
Veteran Member
Join Date: Dec 2004
Location: UK
Old 10-12-2005 , 20:43  
Reply With Quote #10

Quote:
Originally Posted by showdax
Quote:
Originally Posted by c0ldfyr3
Teleport works fine, I use it for my slap =)

As per the kill thing, i didnt think they could alias over that ?
Maybe Teleport just doesn't work under DoD:S, which is what I'm testing this under mainly. I noticed my slap command worked under CS:S but not DoD:S.

You can definitely alias over kill though:
Code:
] alias kill what
] kill
Unknown command: what
You can even do other stupid things like making an alias alias itself and causing an infinite loop and crash. You can set aliases through a server plugin too which is even dumber. There's no way that I know of to unset an alias though.
Teleport crashes on DoD:Source which also means that slap (uses teleport) crashes too

It's just the risk we take by using the basentity.h header file assuming the binary image will match.

Mani
__________________
Installation files, documentation and help can be found at: -

www.mani-admin-plugin.com
Mani 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 03:04.


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