AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Bomb Defuse Predictions v1.2 (https://forums.alliedmods.net/showthread.php?t=116974)

Starsailor 01-27-2010 22:48

Bomb Defuse Predictions v1.2
 
2 Attachment(s)
Bomb Defuse Predictions v1.2
Another simple useless plugin by me

Description:

With this plugin, when you are defusing the bomb, you can know if you have time to defuse or not. (a message will appear)

Cvars:

bdp_enabled (0|1) Enables|Disables plugin, Default 1

Modules:
Fakemeta
Hamsandwich

Credits:
Fran aka Asd': For nothing:crab:
Connor: I used some code from his plugin (c4 sprite timer). I always have to give credits to you :mrgreen::mrgreen:

Translations
Code:

[es] by me
[en] by me & crazyeffect
[pt] by NGage70
[ru] by Romper
[tr] by KadiR & xD_1991
[de] by Nextra
[ro] by Il3gal
[fr] by Arkshine

Changelog:
Code:

v1.0: First release
v1.1: Code optimized - Thanks Connor
v1.2: Code optimized - Thanks Connor Again :), Added ML

Servers with this plugin

Suggestions are welcome (:

Zombiezzz 01-27-2010 23:08

Re: Bomb Defuse Predictions v1.0
 
cool :P

NiQu 01-27-2010 23:28

Re: Bomb Defuse Predictions v1.0
 
gj :)
Could use this with deff or die plugin :D

ConnorMcLeod 01-28-2010 02:01

Re: Bomb Defuse Predictions v1.0
 
You should base times to bomb entity offsets, would be more accurate.
But with such a plugin, you break fun from the game.

Try :

PHP Code:

#include <amxmodx>
// #include <amxmisc>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <hamsandwich>

new const VERSION[] = "0.0.1"

new g_iDefuser

public plugin_init()
{
    
register_plugin("c4 defuse time"VERSION"ConnorMcLeod")

    if( !
find_ent_by_class(FM_NULLENT"func_bomb_target") && find_ent_by_class(FM_NULLENT"info_bomb_target") )
    {
        
pause("ad")
        return
    }

    
RegisterHam(Ham_Use"grenade""CC4_Use_Pre"0)
    
RegisterHam(Ham_Use"grenade""CC4_Use_Post"1)
}

public 
CC4_Use_Pre(iC4ididactivatoruse_typeFloat:value)
{
    if( 
use_type == && value == 1.0 || cs_get_user_team(id) == CS_TEAM_CT || !cs_get_c4_defusing(iC4) )
    {
        
g_iDefuser id
    
}
}

public 
CC4_Use_Post(iC4ididactivatoruse_typeFloat:value)
{
    if( 
use_type != || value != 1.0 || g_iDefuser != id || !cs_get_c4_defusing(iC4) )
    {
        return
    }

    const 
m_flDefusedGameTime 99

    
new Float:flTime cs_get_c4_explode_timeiC4 ) - get_pdata_float(iC4m_flDefusedGameTime5)

    if( 
flTime >= 0.0 )
    {
        
client_print(idprint_chat"You can defuse the bomb and have an advance of %.3f seconds"flTime)
    }
    else
    {
        
client_print(idprint_chat"Take care, you miss %.3f seconds to defuse the bomb"flTime)
    }


You could also use :

register_event("BarTime", "Event_BarTime_Defuse", "be", "1=5", "1=10")

to detect the defuse event rather than the logevent.

Starsailor 01-28-2010 05:11

Re: Bomb Defuse Predictions v1.0
 
Quote:

Originally Posted by ConnorMcLeod (Post 1070327)

You should base times to bomb entity offsets, would be more accurate.

Im workin on that

Quote:

Originally Posted by ConnorMcLeod (Post 1070327)
But with such a plugin, you break fun from the game.

I dont think so

Quote:

Originally Posted by ConnorMcLeod (Post 1070327)
You could also use :

register_event("BarTime", "Event_BarTime_Defuse", "be", "1=5", "1=10")

to detect the defuse event rather than the logevent.

I am using that :\

ConnorMcLeod 01-28-2010 12:08

Re: Bomb Defuse Predictions v1.1
 
set_fail_state("Invalid Map") implies that the plugin can't load due to an error, would be better to just pause it.
Code looks baaaaad :P

Also, why to you check if player has a defuser in BarTime event ???

Starsailor 01-28-2010 12:18

Re: Bomb Defuse Predictions v1.1
 
Quote:

Originally Posted by ConnorMcLeod (Post 1070706)
set_fail_state("Invalid Map") implies that the plugin can't load due to an error, would be better to just pause it.
Code looks baaaaad :P

oh, fuck :D, always learns something new

Quote:

Also, why to you check if player has a defuser in BarTime event ???
because with defuser it takes you 5 seg to defuse and without defuse 10 sec, but im sure that can be optimized

crazyeffect 01-28-2010 12:19

Re: Bomb Defuse Predictions v1.1
 
I got a suggestion, wanna guess?

I think it would be good for this, since the messages show up pretty much.

Starsailor 01-28-2010 12:24

Re: Bomb Defuse Predictions v1.1
 
Quote:

Originally Posted by crazyeffect (Post 1070725)
I got a suggestion, wanna guess?

I think it would be good for this, since the messages show up pretty much.

Off course ML Man haha, in next version.

hleV 01-28-2010 12:34

Re: Bomb Defuse Predictions v1.1
 
You should use #define for strings since you're using these multiple times in your code.


All times are GMT -4. The time now is 01:42.

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