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

Solved [HELP] Destroying 2 Bomb Sites


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hellmonja
Senior Member
Join Date: Oct 2015
Old 07-15-2020 , 11:16   [HELP] Destroying 2 Bomb Sites
Reply With Quote #1

I'm trying to make a new game mode where you have to destroy both bomb sites. Currently I'm doing preliminary testing, using Infinite Round to prevent the round ending, and a small plugin using fun to give myself a second C4 after the 1st one blows up.

The trouble is when the 1st one explodes and I spawn the 2nd C4 but I can't plant it on the other site, giving me the message that the C4 has to be planted on site. The game seems to disable the site when a C4 has exploded. Is there a way to prevent this or reactivate the site for a second bombing?...
__________________

Last edited by hellmonja; 07-17-2020 at 12:51.
hellmonja is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 07-15-2020 , 11:47   Re: [HELP] Destroying 2 Bomb Sites
Reply With Quote #2

Best bet look at existing plugins like 'Plant Anywhere 2' to see how to do it.
__________________
DJEarthQuake is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 07-15-2020 , 11:49   Re: [HELP] Destroying 2 Bomb Sites
Reply With Quote #3

Quote:
Originally Posted by DJEarthQuake View Post
Best bet look at existing plugins like 'Plant Anywhere 2' to see how to do it.
Great thanks! I did remember such a plugin but I forgot what's it called. Thanks for reminding me...
__________________
hellmonja is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-15-2020 , 11:49   Re: [HELP] Destroying 2 Bomb Sites
Reply With Quote #4

For these kinds of things, ReGameDLL is your friend. See what happens when the bomb explodes and undo it.
__________________
HamletEagle is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 07-15-2020 , 12:01   Re: [HELP] Destroying 2 Bomb Sites
Reply With Quote #5

Quote:
Originally Posted by HamletEagle View Post
For these kinds of things, ReGameDLL is your friend. See what happens when the bomb explodes and undo it.
Hmm, not familiar with ReGameDLL but I will find it anyway. It sounds like a very useful thing. Thank you for the info, sensei...
__________________
hellmonja is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-15-2020 , 15:08   Re: [HELP] Destroying 2 Bomb Sites
Reply With Quote #6

https://github.com/s1lentq/ReGameDLL...regamedll/dlls
I'm not saying to run regamedll, probably my previous post wasn't clear. You should look at the source code and figure out what happens that blocks the other bombsite, then undo that.

I may give it a try, but I can't promise it will be soon. You can start from ShootSatchelCharge function which creates the C4 and C4Think function that's the function for c4 entity thinking. It should have a check for when the bomb should explode and you can go from there, checking what other functions are called and trying to make sense of the code, see what happens when. It may look hard at first, but if you get used to it, it will help you a ton in the future.
__________________

Last edited by HamletEagle; 07-15-2020 at 15:10.
HamletEagle is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 07-15-2020 , 22:26   Re: [HELP] Destroying 2 Bomb Sites
Reply With Quote #7

I pray you would be patient because, frankly, this is delving into unknown territory for me. So I assume this is C++ and I need an IDE to open it?...
__________________
hellmonja is offline
ZaX
Senior Member
Join Date: Jan 2015
Old 07-16-2020 , 00:22   Re: [HELP] Destroying 2 Bomb Sites
Reply With Quote #8

You can open the file in github and check it, or download it and use any editor.
ZaX is offline
hellmonja
Senior Member
Join Date: Oct 2015
Old 07-17-2020 , 12:51   Re: [HELP] Destroying 2 Bomb Sites
Reply With Quote #9

PHP Code:
register_logevent("Event_C4_Planted"3"2=Planted_The_Bomb")
...
public 
Event_C4_Planted()
{
    return 
PLUGIN_HANDLED

Alright, solved it with this. It even works on rare maps with 3 bombsites like de_drastic. I admit I haven't gotten far studying ReGamedll; it's kinda overwhelming for me, might take me days or weeks to get accustomed to it. But since I'm working on a big CS project I see the value of learning its code so I will try to keep on it when I have time. Thank you, everyone! I really appreciate being introduced to ReGamedll. This might be my chance to delve deeper into programming...
__________________
hellmonja is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 07-19-2020 , 14:22   Re: [HELP] Destroying 2 Bomb Sites
Reply With Quote #10

Quote:
Originally Posted by hellmonja View Post
PHP Code:
register_logevent("Event_C4_Planted"3"2=Planted_The_Bomb")
...
public 
Event_C4_Planted()
{
    return 
PLUGIN_HANDLED

Alright, solved it with this.
Are you sure this is what actually solved it? With register_logevent you just catch a log message, it's not the actual bomb planted function. Also superceding Event_C4_Planted shouldn't do anything.
I didn't dig into this, there may be some weird things like some part of the game/client code relying on that log, but that would be kinda silly tbh.
__________________

Last edited by HamletEagle; 07-19-2020 at 17:04.
HamletEagle 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 20:18.


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