Raised This Month: $32 Target: $400
 8% 

Solved [CSGO] How to drop hostage as CT?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Austin
Senior Member
Join Date: Oct 2005
Old 12-08-2022 , 16:23   [CSGO] How to drop hostage as CT?
Reply With Quote #1

I would like to write a plugin that allows CTs to drop a hostage they are carrying.

I am competent at writing plugins but have no idea how to start on this one.

Last edited by Austin; 12-16-2022 at 04:17.
Austin is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-09-2022 , 11:28   Re: [CSGO] How to drop hostage as CT?
Reply With Quote #2

I tough csgo game have already some kind hostage drop command...

I tried using SDKCall to execute DropHostage() function, but it always crash server.
Maybe source code what I am lookin is little old than what game use now or I'm doing something wrong.

But here is "fake" DropHostage(). It not work perfectly but it's something to play.
- You will get some errors, crash or bugs with this.

Command: sm_test2

Attached Files
File Type: sp Get Plugin or Get Source (test.sp - 40 views - 6.6 KB)
__________________
Do not Private Message @me
Bacardi is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-10-2022 , 11:29   Re: [CSGO] How to drop hostage as CT?
Reply With Quote #3

Sorry second post.

I got void CHostage::DropHostage( Vector vecPosition, bool bIsRescued ) work with signature.
- Fix was to get memory address with signature, using gamedata file.
- I have only tested on Windows. Linux signature is included tough.

I also added DHooks detour, if someone want follow when DropHostage() happens.

Again, command is sm_test2
- Small tracehull check added, can you drop in front of you. Not perfect.
- Hostage would not appear after drop if hostage stuck inside something solid.
Attached Files
File Type: sp Get Plugin or Get Source (test.sp - 43 views - 3.5 KB)
File Type: txt test.games.txt (835 Bytes, 33 views)
__________________
Do not Private Message @me

Last edited by Bacardi; 12-10-2022 at 11:30.
Bacardi is offline
FroGeX
Senior Member
Join Date: Aug 2020
Old 12-12-2022 , 07:50   Re: [CSGO] How to drop hostage as CT?
Reply With Quote #4

Just call on player fake death event....
FroGeX is offline
Austin
Senior Member
Join Date: Oct 2005
Old 12-13-2022 , 01:37   Re: [CSGO] How to drop hostage as CT?
Reply With Quote #5

Bacardi,
I haven't used sigs yet but need to learn them!

1) Do I put the test.games.txt file into this folder?
..\sourcemod\gamedata

Do I keep this exact name?
test.games.txt


2) I got dhooks.inc from here. Is this the correct one to use?
https://www.sourcemod.net/new-api/dhooks/__raw

but I get this on compile

test.sp(11) : error 105: cannot find method or property GameData.GetMemSig
test.sp(11) : warning 213: tag mismatch
Austin is offline
Austin
Senior Member
Join Date: Oct 2005
Old 12-13-2022 , 01:39   Re: [CSGO] How to drop hostage as CT?
Reply With Quote #6

Quote:
Originally Posted by FroGeX View Post
Just call on player fake death event....
Can you give an example how to to do this?

tx
Austin is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-13-2022 , 02:42   Re: [CSGO] How to drop hostage as CT?
Reply With Quote #7

About GetMemSig error, what version SM you are running?

sm version


*edit
I have use SourcePawn compiler: SourcePawn Compiler 1.11.0.6913
__________________
Do not Private Message @me

Last edited by Bacardi; 12-13-2022 at 12:35.
Bacardi is offline
Austin
Senior Member
Join Date: Oct 2005
Old 12-13-2022 , 21:55   Re: [CSGO] How to drop hostage as CT?
Reply With Quote #8

Quote:
Originally Posted by Bacardi View Post
About GetMemSig error, what version SM you are running?

sm version


*edit
I have use SourcePawn compiler: SourcePawn Compiler 1.11.0.6913
I had to update SM in my build environment AND on the server.

It works!

Bacardi == "Genius" ? "Yes!" : "Probably.."


I made a slight change.
PHP Code:
    if(!didhit)
        
SDKCall(DropHostagem_hCarriedHostageendposfalse);
    else
        
PrintCenterText(client,"Can not drop hostage here.\nMove to where you have more free space in front of you."); 
And this is a great example to help get me started on sigs.......

Can you point me to the best intro on sigs, on what I would have to do to find this sig after some valve updates breaks it?

Thank you!

Last edited by Austin; 12-13-2022 at 21:56.
Austin is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 12-14-2022 , 06:22   Re: [CSGO] How to drop hostage as CT?
Reply With Quote #9

Quote:
Originally Posted by Austin View Post
...

Can you point me to the best intro on sigs, on what I would have to do to find this sig after some valve updates breaks it?

Thank you!
I don't know how much you have "disassembler" server *.dll file or *.so file

Easiest way is, ask in this forum.

Hard way is setup your PC with The Interactive Disassembler (IDA) program, (I use old version).
Then you need lot of hard disk space, IDA is creating 200~300MB database from server-libary file.
-You want also download SRCDS and use that as sandbox for all testing. Not public server.

It is require to have PC with good CPU with many cores. (When disassembly, IDA is using 6 threads)

Looking for offsets:
Sticky: [IDA/DHooks]How to get vtable offsets

Here look signature between Linux and Windows:
https://youtu.be/xUOU2bU6EF0

Another signature thingy:
https://youtu.be/SD6Rn2D7IGo


*edit
For finding CSGO drophostage signature (server.dll, server.so):
Look for these two strings
PHP Code:
aStopfollowing  db 'StopFollowing',0    DATA XREFsub_105485F0+23E↑o
 
aSISS0f0f0fDrop db '"%s<%i><%s><%s>" [%.0f %.0f %.0f] dropped off a hostage',0Ah,
__________________
Do not Private Message @me

Last edited by Bacardi; 12-14-2022 at 06:26.
Bacardi is offline
Austin
Senior Member
Join Date: Oct 2005
Old 12-14-2022 , 18:18   Re: [CSGO] How to drop hostage as CT?
Reply With Quote #10

Quote:
Originally Posted by Bacardi View Post
Easiest way is, ask in this forum.
Bacardi, EXACTLY what I was asking for!!!

I prefer to learn how to do everything myself because
it is fun to learn and
I have many more things I want to do that are related as far as using the same programming techniques.

I run bot servers and what I would really like to do is
FINALLY create a sourcemod "sdktools" for bot functions!

I have used IDA before (an also got an A in my college x86 class ;-) and have set up many srcs servers.

My "desktop" PC is a server motherboard with old now but still great,
Xeon 3.6 GHZ 6 physical cores.
2x 1080Ti
64 GB memory.....
1T nvme.

Again thanks for the links....

Last question and only still a mystery.....

HOW did you know to look for these strings to find the offsets?
I already knew looking for strings was a way to find offsets, but how did you know to look for THESE strings?

By looking at strings in the binaries, or by looking at
source source?

Last edited by Austin; 12-14-2022 at 18:27.
Austin is offline
Reply


Thread Tools
Display Modes

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 05:55.


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