Raised This Month: $ Target: $400
 0% 

Solved InstaDefuse Code Issues


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SytekBox
AlliedModders Donor
Join Date: Feb 2017
Location: 404 not found
Old 09-21-2020 , 10:48   Re: InstaDefuse Code Issues
Reply With Quote #6

Quote:
Originally Posted by Bacardi View Post
Not sure why not work...

So I script cheap one:
PHP Code:
/*

Server event "bomb_begindefuse", Tick 14022:
- "userid" = "2"
- "haskit" = "1"


m_flTimerLength 99.000000
m_flDefuseLength 5.000000
m_flDefuseCountDown 586.031250


m_iProgressBarDuration -1
m_flProgressBarStartTime 1598.687500
*/

ConVar sm_instadefuse_enabled;

#include <sdktools>

public void OnPluginStart()
{
    
sm_instadefuse_enabled CreateConVar("sm_instadefuse_enabled""1"__true0.0true1.0);
    
HookEvent("bomb_begindefuse"bomb_begindefuse);
}

public 
void bomb_begindefuse(Event eventchar[] namebool dontBroadcast)
{
    if(!
GetConVarBool(sm_instadefuse_enabled)) return;

    
int c4 FindEntityByClassname(-1"planted_c4");

    if(
c4 == -1) return;

    
RequestFrame(frameEntIndexToEntRef(c4));
}

public 
void frame(int ref)
{
    
int c4 EntRefToEntIndex(ref);

    if(
c4 == -1) return;

    
SetEntPropFloat(c4Prop_Send"m_flDefuseCountDown"GetGameTime());

- Works 100% on maps where is only one c4 planted.
As soon as i get back at home from work i'll give this a try, would it be possible to retain the messages feature? Still want to get some sort of visual-chat alert (No need for the time left, just a Could or Couldn't defuse in time basic message).

Sorry to ask for this much spoon-feeding, not usually my go to thing but this is certainly out of my knowledge zone (Working on learning programming myself nonetheless, though i'm just a Junior Front-End Designer at the moment) i_i

Your help and time has been greatly appreciated so far! <3
SytekBox is offline
 



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:43.


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