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

Lower Defuse time...


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tobi187
Junior Member
Join Date: Jan 2012
Old 03-04-2012 , 08:32   Lower Defuse time...
Reply With Quote #1

How could i set the defuse time with kit, to lets say 4 Seconds instead of 6?

ive only found something for AMX Mod http://forums.alliedmods.net/showthr...ht=defuse+time

Is it possible with sourcemod?

Last edited by tobi187; 03-04-2012 at 08:35.
tobi187 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-04-2012 , 09:19   Re: Lower Defuse time...
Reply With Quote #2

Ok...
- Hook event when player begin defuse c4.
- Check player have he defusing kits.
- Change entity planted c4 defusing end game time.

*edit
there is pRED* - quickdefuse plugins so you can peek plugin source code

Last edited by Bacardi; 03-04-2012 at 09:23. Reason: game time
Bacardi is offline
tobi187
Junior Member
Join Date: Jan 2012
Old 03-04-2012 , 09:29   Re: Lower Defuse time...
Reply With Quote #3

PHP Code:
public OnPluginStart(){
    
HookEvent("bomb_begindefuse"Event_DefuseEventHookMode_Post);
}
 
 

public 
Event_Defuse(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
clientId GetEventInt(event"userid");
    new 
client GetClientOfUserId(clientId);
    new 
bool:kit GetEventBool(event"haskit");
    new 
bombent FindEntityByClassname(-1,"planted_c4"); 
    if(
kitSetEntPropFloat(bombentProp_Send"m_flDefuseCountDown"3.0);
    if(!
kitSetEntPropFloat(bombentProp_Send"m_flDefuseCountDown"5.0);

Thats what i have and it doesnt work for me...
tobi187 is offline
Bacardi
Veteran Member
Join Date: Jan 2010
Location: mom's basement
Old 03-04-2012 , 10:03   Re: Lower Defuse time...
Reply With Quote #4

Quote:
Originally Posted by tobi187 View Post
Thats what i have and it doesnt work for me...
Yeah, problem is that game event is coming little early than you can change c4 defusing end time.
So you need delay it just little.

I shorted also player defusing bar

PHP Code:
#include <sdktools>

public OnPluginStart()
{
    
HookEventEx("bomb_begindefuse"begindefuse);
}

public 
begindefuse(Handle:event, const String:name[], bool:dontBroadcast)
{
    new 
userid GetEventInt(event"userid");
    
CreateTimer(0.0timer_delayuserid); // Need delay

}

public 
Action:timer_delay(Handle:timerany:userid)
{

    new 
client GetClientOfUserId(userid);

    if(
client != 0)
    {
        if(
IsPlayerAlive(client))
        {
            new 
Float:defuse_time;

            if(
GetEntProp(clientProp_Send"m_bHasDefuser"))
            {
                
defuse_time 3.0;
            }
            else
            {
                
defuse_time 5.0;
            }
            new 
c4 FindEntityByClassname(MaxClients+1"planted_c4");
            if(
c4 != -1)
            {
                
SetEntPropFloat(c4Prop_Send"m_flDefuseCountDown"GetGameTime()+defuse_time);
                
SetEntProp(clientProp_Send"m_iProgressBarDuration"RoundFloat(defuse_time));
            }
        }
    }

Bacardi is offline
tobi187
Junior Member
Join Date: Jan 2012
Old 03-04-2012 , 10:44   Re: Lower Defuse time...
Reply With Quote #5

Thanks a lot, im gonna test it!
tobi187 is offline
tobi187
Junior Member
Join Date: Jan 2012
Old 03-04-2012 , 18:38   Re: Lower Defuse time...
Reply With Quote #6

Looks like its working.
Thanks a lot
tobi187 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 19:29.


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