View Single Post
Author Message
skuny
Junior Member
Join Date: Dec 2018
Old 10-24-2020 , 13:35   sillyc4 set g_flag to flag " T "
Reply With Quote #1

Hi again, can anyone help me out ?

I am looking to bind this plugin for ADMIN_LEVEL_H or "Flag T"


original post link: https://forums.alliedmods.net/showthread.php?p=387759

code:

PHP Code:
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <csx>
#include <xs>

#define MAX_PLAYERS 32

new DEFUSING_SOUND[] = "weapons/c4_click.wav"

new g_NumberID 0
new g_iRandomNumbers[11]

new 
g_Defusing[MAX_PLAYERS+1]
new 
Float:g_fDelay[MAX_PLAYERS+1]
 
new 
cvar_restrictcvar_numberscvar_wallplant


static const PLUGIN_NAME[]     = "Silly C4"
static const PLUGIN_AUTHOR[]     = "Cheap_Suit"
static const PLUGIN_VERSION[]    = "1.2"

public plugin_init()
{
    
register_plugin(PLUGIN_NAMEPLUGIN_VERSIONPLUGIN_AUTHOR)
    
register_cvar(PLUGIN_NAMEPLUGIN_VERSIONFCVAR_SPONLY|FCVAR_SERVER)
    
register_event("BarTime",     "Event_BarTime""b""1=0")
    
    
cvar_numbers     register_cvar("amx_sc_rannumber""1")
    
cvar_restrict     register_cvar("amx_sc_removeres""1")
    
cvar_wallplant     register_cvar("amx_sc_wallplant""1")
}

public 
plugin_precache()
    
precache_sound(DEFUSING_SOUND)

public 
Event_BarTime(id) if(g_Defusing[id])
{    
    
g_NumberID 0
    g_Defusing
[id] = 0
}

public 
bomb_defused(id)
{
    
g_NumberID 0
    g_Defusing
[id] = 0
}

public 
bomb_defusing(id)
{
    if(
get_pcvar_num(cvar_restrict))
        
entity_set_float(idEV_FL_maxspeed240.0)
        
    
g_Defusing[id] = 1
}
    
public 
bomb_planting(id) if(get_pcvar_num(cvar_restrict))
    
entity_set_float(idEV_FL_maxspeed240.0)

public 
bomb_planted(id)
{
    if(!
get_pcvar_num(cvar_wallplant))
        return
    
    
g_NumberID 0
    
for(new 011; ++i)
        
g_iRandomNumbers[i] = rn()
    
    new 
Float:fOrigin[3]
    
entity_get_vector(idEV_VEC_originfOrigin)
        
    new 
Float:fVelocity[3]
    
VelocityByAim(id54fVelocity)
    
    if(
fVelocity[2] < -28.0)
        return 

    new 
Float:fTraceEnd[3]
    
xs_vec_add(fVelocityfOriginfTraceEnd)
        
    new 
Float:fTraceResult[3]
    
trace_line(idfOriginfTraceEndfTraceResult)

    new 
Float:fNormal[3]
    if(
trace_normal(idfOriginfTraceEndfNormal) < 1)
        return

    new 
c4 = -1
    
while((c4 find_ent_by_model(c4"grenade""models/w_c4.mdl")))
    {
        if(
entity_get_int(c4EV_INT_movetype) == MOVETYPE_FLY 
        
|| (get_entity_flags(c4) & FL_ONGROUND))
            continue
            
        
entity_set_int(c4EV_INT_movetypeMOVETYPE_FLY)
        
entity_set_vector(c4EV_VEC_velocityFloat:{0.00.00.0})
        new 
Float:fNewOrigin[3]
        
fNewOrigin[0] = fTraceResult[0] + (fNormal[0] * -0.01)
        
fNewOrigin[1] = fTraceResult[1] + (fNormal[1] * -0.01)
        
fNewOrigin[2] = fTraceResult[2] +  fNormal[2] + 8.000
        
        entity_set_origin
(c4fNewOrigin)
        
        new 
Float:fAngles[3]
        
vector_to_angle(fNormalfAngles)
        
fAngles[0] -= 180.0fAngles[1] -= 90.0fAngles[2] -= 90.0
        entity_set_vector
(c4EV_VEC_anglesfAngles)
    }
}

public 
client_PreThink(id)
{
    if(!
get_pcvar_num(cvar_numbers) || !is_user_alive(id) || !g_Defusing[id])
        return 
PLUGIN_CONTINUE

    
if(g_fDelay[id] + get_delay(id) < get_gametime())
    {
        
g_NumberID += 1
        client_cmd
(id"spk %s"DEFUSING_SOUND)
        
g_fDelay[id] = get_gametime()
    }
    
    
set_hudmessage(255255255, -1.00.400.010.00.00.02)
    switch(
g_NumberID)
    {
        case 
1show_hudmessage(id"%d%d%d%d%d%d%d%d%d%d%d"n(0), rn(), rn(), rn(), rn(), rn(), rn(), rn(), rn(), rn(), rn()) 
        case 
2show_hudmessage(id"%d%d%d%d%d%d%d%d%d%d%d"n(0), n(1), rn(), rn(), rn(), rn(), rn(), rn(), rn(), rn(), rn())
        case 
3show_hudmessage(id"%d%d%d%d%d%d%d%d%d%d%d"n(0), n(1), n(2), rn(), rn(), rn(), rn(), rn(), rn(), rn(), rn())
        case 
4show_hudmessage(id"%d%d%d%d%d%d%d%d%d%d%d"n(0), n(1), n(2), n(3), rn(), rn(), rn(), rn(), rn(), rn(), rn())
        case 
5show_hudmessage(id"%d%d%d%d%d%d%d%d%d%d%d"n(0), n(1), n(2), n(3), n(4), rn(), rn(), rn(), rn(), rn(), rn())
        case 
6show_hudmessage(id"%d%d%d%d%d%d%d%d%d%d%d"n(0), n(1), n(2), n(3), n(4), n(5), rn(), rn(), rn(), rn(), rn())
        case 
7show_hudmessage(id"%d%d%d%d%d%d%d%d%d%d%d"n(0), n(1), n(2), n(3), n(4), n(5), n(6), rn(), rn(), rn(), rn())
        case 
8show_hudmessage(id"%d%d%d%d%d%d%d%d%d%d%d"n(0), n(1), n(2), n(3), n(4), n(5), n(6), n(7), rn(), rn(), rn())
        case 
9show_hudmessage(id"%d%d%d%d%d%d%d%d%d%d%d"n(0), n(1), n(2), n(3), n(4), n(5), n(6), n(7), n(8), rn(), rn())
        case 
10:show_hudmessage(id"%d%d%d%d%d%d%d%d%d%d%d"n(0), n(1), n(2), n(3), n(4), n(5), n(6), n(7), n(8), n(9), rn())
        case 
11:show_hudmessage(id"%d%d%d%d%d%d%d%d%d%d%d"n(0), n(1), n(2), n(3), n(4), n(5), n(6), n(7), n(8), n(9),n(10)) 
        default:
show_hudmessage(id"%d%d%d%d%d%d%d%d%d%d%d"n(0), n(1), n(2), n(3), n(4), n(5), n(6), n(7), n(8), n(9),n(10))
    }
    return 
PLUGIN_CONTINUE
}

stock rn() return random_num(09)
stock n(value) return g_iRandomNumbers[value]
stock Float:get_delay(id) return cs_get_user_defuse(id) ? 0.4999 0.9999 
Attached Files
File Type: sma Get Plugin or Get Source (sillyc4 (3).sma - 89 views - 4.8 KB)

Last edited by skuny; 10-25-2020 at 08:39. Reason: Fixed! Thanks <3
skuny is offline