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

Ayuda!.. Plugin funciona incorrectamente


  
 
 
Thread Tools Display Modes
Author Message
FreeLayer
Member
Join Date: Mar 2011
Old 07-01-2011 , 15:31   Ayuda!.. Plugin funciona incorrectamente
#1

La verdad es muy simple tengo este plugin

PHP Code:
#include <amxmodx>

#define PLUGIN "Bomb Explode Sounds"
#define VERSION "0.3"
#define AUTHOR "FreeLayer"

public bomb_exploding () {
    new 
losowo random_num(0,2)
   
    switch(
losowo) {
        case 
0client_cmd(0,"mp3 play sound/misc/bomba1.mp3")
        case 
1client_cmd(0,"mp3 play sound/misc/bomba2.mp3")
        case 
2client_cmd(0,"mp3 play sound/misc/bomba.mp3")
    }
}
#define czas 10
//

//

new g_c4timerpointnum;
new 
bool:b_planted false;

new 
g_msgsync;

public 
plugin_init()
{
    
/* --| Registering the plugin to show when you type amx_plugins.. */
    
register_plugin(PLUGIN,VERSION,AUTHOR);
    
/* --| Registering a little cvar to see wich servers using this plugin */
    
register_cvar"be3s_version"VERSIONFCVAR_SERVER FCVAR_SPONLY );

    
pointnum get_cvar_pointer("mp_c4timer");

    
register_logevent("newRound"2"1=Round_Start");
    
register_logevent("endRound"2"1=Round_End");
    
register_logevent("endRound"2"1&Restart_Round_");

    
g_msgsync CreateHudSyncObj();
}

public 
newRound()
{
    
g_c4timer = -1;
    
remove_task(652450);
    
b_planted false;
}

public 
endRound()
{
    
g_c4timer = -1;
    
remove_task(652450);
}

public 
bomb_planted()
{
    
b_planted true;
    
g_c4timer get_pcvar_num(pointnum);
    
dispTime()
    
set_task(1.0"dispTime"652450""0"b");
}

public 
bomb_defused()
{
    if(
b_planted)
    {
        
remove_task(652450);
        
b_planted false;
    }
}

public 
bomb_explode()
{
    if(
b_planted)
    {
        
remove_task(652450);
        
b_planted false;
    }
}

public 
dispTime()
{
    if(!
b_planted)
    {
        
remove_task(652450);
        return;
    }


    if(
g_c4timer >= 0)
    {
        if(
g_c4timer 13) {
            
set_hudmessage(01500, -1.00.8001.01.00.010.01, -1);
        }
        else if(
g_c4timer 7) {
            
set_hudmessage(1501500, -1.00.8001.01.00.010.01, -1);
        if(
g_c4timer == czas) {
            
set_task(0.1"bomb_exploding"0)
        }}
        else {
            
set_hudmessage(15000, -1.00.8001.01.00.010.01, -1);
        }

        
ShowSyncHudMsg(0g_msgsync"C4: %d"g_c4timer);

        --
g_c4timer;
    }
}

public 
plugin_precache()
{
    
precache_sound("misc/bomba.mp3")
    
precache_sound("misc/bomba1.mp3")
    
precache_sound("misc/bomba2.mp3")

    return 
PLUGIN_CONTINUE

El plugin en si funciona y 10 segs antes de explotar emite un sonido el problema es que Ese sonido funciona cuando quiere me refiero a que en algunos rouns si y a veces esta 3 y hasta 5 round sin sonar si me pueden arreglar lo que esta mal para que suena siempre se los agradecerķa ojala me puedan ayudar
FreeLayer is offline
xhiino
Senior Member
Join Date: Oct 2009
Location: santiasko
Old 07-01-2011 , 15:58   Re: Ayuda!.. Plugin funciona incorrectamente
#2

1 ero en la funcion bomb_planted llamas 2 veces a la misma funcion

PHP Code:
dispTime() 
    
set_task(1.0"dispTime"652450""0"b"); 
2 esta funcion me tiene sospechando bomb_planted ya k nunca se nombra en el plugin aparte de su public ... prueba revisando esto y ve como te va
__________________
xhiino is offline
Send a message via MSN to xhiino
FreeLayer
Member
Join Date: Mar 2011
Old 07-01-2011 , 18:13   Re: Ayuda!.. Plugin funciona incorrectamente
#3

no hay mas ideas o mas gente ? D:
FreeLayer is offline
matrix123
Veteran Member
Join Date: Feb 2011
Old 07-01-2011 , 19:38   Re: Ayuda!.. Plugin funciona incorrectamente
#4

PHP Code:
public bomb_planted() 

    
b_planted true
    
g_c4timer get_pcvar_num(pointnum); 
    
dispTime() 
    
set_task(1.0"dispTime"652450""0"b"); 

--->

PHP Code:
public bomb_planted(id

    
b_planted true
    
g_c4timer get_pcvar_num(pointnum); 
    
dispTime() 
    
set_task(1.0"dispTime"652450""0"b"); 

matrix123 is offline
paoliita
Senior Member
Join Date: May 2011
Old 07-02-2011 , 01:20   Re: Ayuda!.. Plugin funciona incorrectamente
#5

Para que el index ahi si no lo usas en la funcion... ?
paoliita is offline
Send a message via MSN to paoliita
 



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 01:21.


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