Raised This Month: $ Target: $400
 0% 

Old problem: no points from bomb explode/defuse


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 11-14-2022 , 21:50   Re: Old problem: no points from bomb explode/defuse
Reply With Quote #1

Quote:
Originally Posted by Natsheh View Post
Here you can use this hook to strip the 3 frags given to the defuser

PHP Code:
register_logevent("logevent_defuse"3"2=Defused_The_Bomb")

public 
logevent_defuse()
{
   new 
id = ........ The defuser id from the log.
   
set_user_frags(idget_user_frags(id) - 3)

}

And the same thing for the planter...

and the defuser of the log is?, does not exist
you can hook the event, the act, but not get the one that put it like that, you have to look for the classname of the c4 which is "weapon_c4", from there get the owner, (assuming that the owner of the c4 is the one who planted it)

"new id = ........ The defuser id from the log."

It makes me laugh when they put these things in the middle when they don't even know

here you have a real guide, the logevent is only a hook of when something in particular happens, but it does not leave you any other tool

https://forums.alliedmods.net/showthread.php?t=40164

IMPORTANT Edit: if you just want to get the index of the planted and the defused, better hook the sound/voice, when someone defuses or plants, the player says a phrase, "the bomb has been planted", "the bomb was defused" , there you get the exact moment and index(I don't know if it works, it's just an idea, but you can follow the guide above if it doesn't work)


PHP Code:
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_forward(FM_EmitSound "EmitSound");
}
public 
EmitSound(idchannel, const sound[])
{
    if(
equal(sound "weapons/planted.wav")) // i dont know the real name sound
    
{
           
// The bomb has been planted

           
set_user_frags(idget_user_frags(id) + 3)
    }
    else if(
equal(sound"weapons/defused.wav" ))
    {
           
// the bomb has been defused

           
set_user_frags(idget_user_frags(id) + 3)
    }


Last edited by MrPickles; 11-14-2022 at 22:12.
MrPickles 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 15:37.


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