Raised This Month: $ Target: $400
 0% 

10 Sec and break.


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
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
 



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