Raised This Month: $ Target: $400
 0% 

10 Sec and break.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 10-09-2010 , 08:29   10 Sec and break.
Reply With Quote #1

How i can do than hud to count 10 and all glass gona break?
__________________
Still studying scripting...
zirualas is offline
Send a message via Skype™ to zirualas
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 10-09-2010 , 09:24   Re: 10 Sec and break.
Reply With Quote #2

Try this:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <engine>

#define PLUGIN "Countdown - Glass"
#define VERSION "1.0"
#define AUTHOR "Xalus"

#define ACCESS ADMIN_KICK

new cCountdown;
new 
Float:g_fStartTime;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
/* Cvar */
    
cCountdown     register_cvar("countdown_status""10");
    
    
/* Say Commands */
    
register_clcmd("say /countdown""Handler");
    
register_clcmd("say countdown""Handler");
}
/*
CountDown Glass:
    - Handler
*/
public Handler(id) {
    if(
get_user_flags(id) & ACCESS) {
        
g_fStartTime get_gametime()
        
StartCountdown()    
    }
}
/*
CountDown Glass:
    - CountDown
*/
public StartCountdown() {
    new 
Float:fRemainingTime = (get_gametime() - g_fStartTime)
    
    if(
get_pcvar_float(cCountdown) <= fRemainingTime) {
        
client_cmd("spk radio/com_go")
        
        new 
ent 0
        
while((ent find_ent_by_class(ent,"func_breakable")) != 0) {
            
ExecuteHamBHam_TakeDamageent009999.0DMG_GENERIC )
        }
    } else {
        new 
Time floatround(get_pcvar_float(cCountdown) - fRemainingTime)
        new 
szTime[32]
        
        
num_to_word(TimeszTime31)
        
        if(
Time <= 10)
            if(
Time)
                
client_cmd(0,"speak ^"vox/%s^""szTime)
                
        
set_hudmessage(random(255), random(255), random(255), -1.00.0506.01.00.00.0, -2);
        
show_hudmessage(0"[Glass Break in: %d Seconds]"Time)
        
// timer
        
set_task(1.0"StartCountdown")
    }
    
    return 
PLUGIN_CONTINUE;

__________________
Retired.

Last edited by Xalus; 10-09-2010 at 11:36.
Xalus is offline
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 10-09-2010 , 10:57   Re: 10 Sec and break.
Reply With Quote #3

Not working, I even create own map , but this not work, or I need to type that for my "func_breakable"? I give it name "breakable" but nothing..
__________________
Still studying scripting...

Last edited by zirualas; 10-09-2010 at 11:03.
zirualas is offline
Send a message via Skype™ to zirualas
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 10-09-2010 , 11:36   Re: 10 Sec and break.
Reply With Quote #4

ye sorry, It has to be func_breakable in the plugin, not breakable
-> My fault ;)

Try again.
__________________
Retired.
Xalus is offline
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 10-09-2010 , 11:40   Re: 10 Sec and break.
Reply With Quote #5

Now it's working and i want to ask one more question, what i need to type to .sma file that break glass only with name breakable?
__________________
Still studying scripting...
zirualas is offline
Send a message via Skype™ to zirualas
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 10-09-2010 , 11:50   Re: 10 Sec and break.
Reply With Quote #6

if its a func_breakable & the name of it = breakable ?
__________________
Retired.
Xalus is offline
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 10-09-2010 , 11:55   Re: 10 Sec and break.
Reply With Quote #7

Yes if that "THING" is func_breakable and have name breakable it's gona broked then end countdown
__________________
Still studying scripting...
zirualas is offline
Send a message via Skype™ to zirualas
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 10-09-2010 , 12:00   Re: 10 Sec and break.
Reply With Quote #8

Try this:

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <engine>
#include <fakemeta>

#define PLUGIN "Countdown - Glass"
#define VERSION "1.0"
#define AUTHOR "Xalus"

#define ACCESS ADMIN_KICK

new cCountdown;
new 
Float:g_fStartTime;

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
/* Cvar */
    
cCountdown     register_cvar("countdown_status""10");
    
    
/* Say Commands */
    
register_clcmd("say /countdown""Handler");
    
register_clcmd("say countdown""Handler");
}
/*
CountDown Glass:
    - Handler
*/
public Handler(id) {
    if(
get_user_flags(id) & ACCESS) {
        
g_fStartTime get_gametime()
        
StartCountdown()    
    }
}
/*
CountDown Glass:
    - CountDown
*/
public StartCountdown() {
    new 
Float:fRemainingTime = (get_gametime() - g_fStartTime)
    
    if(
get_pcvar_float(cCountdown) <= fRemainingTime) {
        
client_cmd("spk radio/com_go")
        new 
ent 0
        
while((ent find_ent_by_class(ent,"func_breakable")) != 0) {
            new 
target[32]; pev(entpev_targetnametarget31); 
            if(
equal(target"breakable")) {
                
ExecuteHamBHam_TakeDamageent009999.0DMG_GENERIC )
            }
        }
    } else {
        new 
Time floatround(get_pcvar_float(cCountdown) - fRemainingTime)
        new 
szTime[32]
        
        
num_to_word(TimeszTime31)
        
        if(
Time <= 10)
            if(
Time)
                
client_cmd(0,"speak ^"vox/%s^""szTime)
                
        
set_hudmessage(random(255), random(255), random(255), -1.00.0506.01.00.00.0, -2);
        
show_hudmessage(0"[Glass Break in: %d Seconds]"Time)
        
// timer
        
set_task(1.0"StartCountdown")
    }
    
    return 
PLUGIN_CONTINUE;

__________________
Retired.

Last edited by Xalus; 10-09-2010 at 12:40.
Xalus is offline
zirualas
Senior Member
Join Date: Jun 2010
Location: Lithuania
Old 10-09-2010 , 12:22   Re: 10 Sec and break.
Reply With Quote #9

Again you do your mistake

while((ent = find_ent_by_class(ent,"breakable")) != 0) {
new
target[32]; pev(ent, pev_targetname, target, 31);
if(
equal(target, "breakable")) {
ExecuteHamB( Ham_TakeDamage, ent, 0, 0, 9999.0, DMG_GENERIC )

while((ent = find_ent_by_class(ent,"func_breakable")) != 0) {
new
target[32]; pev(ent, pev_targetname, target, 31);
if(
equal(target, "breakable")) {
ExecuteHamB( Ham_TakeDamage, ent, 0, 0, 9999.0, DMG_GENERIC )

-EDIT-
Ok all is working but why than round starts it's saying "Ten Ten", "Nine Nine", "Eight Eight" ...
BTW i reconstruct your given plugin .
Code :
PHP Code:
#include <amxmodx>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <amxmisc>
#include <engine>
#include <fakemeta>

#define PLUGIN "Silent Ninjas Attack"
#define VERSION "1.0"
#define AUTHOR "Zirual"

new const mdlTs[]="arctic";
new const 
mdlCTs[]="urban";
new 
cCountdown;
new 
Float:g_fStartTime;

public 
plugin_init()
{
    
/* Cvar */
    
cCountdown     register_cvar("countdown_status""10");
    
    
register_plugin(PLUGINVERSIONAUTHOR)

    
RegisterHam(Ham_Spawn,"player","runda"1);
    
RegisterHam(Ham_Spawn,"player","PlayerSpawn"1);
    
RegisterHam(Ham_Spawn,"player","Handler"1);

}
/*
CountDown Glass:
    - Handler
*/
public Handler(id)
{
        
g_fStartTime get_gametime()
        
StartCountdown()
}

public 
runda(id)
{
    
set_user_rendering(idkRenderFxNone255255255kRenderTransAlpha192);
}
public 
PlayerSpawn(id)
{
    if( 
is_user_alive(id) )
    {
        switch(
cs_get_user_team(id))
        {
            case 
CS_TEAM_T:
            {
                
cs_set_user_model(id,mdlTs)
            }
            case 
CS_TEAM_CT:
            {
                
cs_set_user_model(id,mdlCTs)
            }
        }
    }
    
give_item(id"weapon_deagle");
    
cs_set_user_bpammo(idCSW_DEAGLE35
}
/*
CountDown Glass:
    - CountDown
*/
public StartCountdown() {
    new 
Float:fRemainingTime = (get_gametime() - g_fStartTime)
    
    if(
get_pcvar_float(cCountdown) <= fRemainingTime) {
        
client_cmd("spk radio/com_go")
        new 
ent 0
        
while((ent find_ent_by_class(ent,"func_breakable")) != 0) {
            new 
target[32]; pev(entpev_targetnametarget31); 
            if(
equal(target"breakable")) {
                
ExecuteHamBHam_TakeDamageent009999.0DMG_GENERIC )
            }
        }
    } else {
        new 
Time floatround(get_pcvar_float(cCountdown) - fRemainingTime)
        new 
szTime[32]
        
        
num_to_word(TimeszTime31)
        
        if(
Time <= 10)
            if(
Time)
                
client_cmd(0,"speak ^"vox/%s^""szTime)
                
        
set_hudmessage(random(255), random(255), random(255), -1.00.0506.01.00.00.0, -2);
        
show_hudmessage(0"[Glass Break in: %d Seconds]"Time)
        
// timer
        
set_task(1.0"StartCountdown")
    }
    
    return 
PLUGIN_CONTINUE;

In code is 3 Ham_Spawn I use because for me is
convenience.
__________________
Still studying scripting...

Last edited by zirualas; 10-09-2010 at 12:32.
zirualas is offline
Send a message via Skype™ to zirualas
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 10-09-2010 , 12:41   Re: 10 Sec and break.
Reply With Quote #10

U got Hns on it?

Becuase Hns also count down? I dunno..
__________________
Retired.
Xalus 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 10:23.


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