Raised This Month: $ Target: $400
 0% 

Help me please, error when compiling


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Fururasshu
Junior Member
Join Date: Sep 2023
Old 09-18-2023 , 20:25   Help me please, error when compiling
Reply With Quote #1

Quote:
warmup.sma(20) : error 029 invalid expression, assumed zero
warmup.sma(20) : warning 215: expression has no effect
warmup.sma(20) : error 029 invalid expression, assumed zero
warmup.sma(20) : error 029 invalid expression, assumed zero
warmup.sma(20) : fatal error 107: too many error messages on one line
PHP Code:
#include <amxmodx>
#include <fun>

new WarmupTime 60// Duración del calentamiento en segundos
new WarmupMusic[] = "music/warmup.mp3"// Ruta de la música de calentamiento

public plugin_init()
{
    
register_plugin("warmup""1.0""a stranger");
    
    
register_clcmd("warmup""cmd_warmup");
}

public 
cmd_warmup(id)
{
    new 
time get_user_weapon(id); // Obtenemos el arma actual del jugador
    
    
if (time == CSW_AWP || time == CSW_AK47 || time == CSW_M4A1)
    {
        
set_task(WarmupTimer1000_id);
        
client_print(idprint_console"¡Calentamiento iniciado!");
        
        
// Reproducir música
        
client_cmd(id"mp3 play "WarmupMusic" 1");
    }
    else
    {
        
client_print(idprint_console"No se puede realizar el calentamiento con esta arma.");
    }
}

public 
WarmupTimer(id)
{
    if (
WarmupTime 0)
    {
        
client_print(idprint_chat"¡Tiempo restante de calentamiento: "WarmupTime" segundos!");
        
WarmupTime--;
        
set_task(WarmupTimer1000_id);
    }
    else
    {
        
client_print(idprint_chat"¡Calentamiento finalizado!");
        
        
// Detener música gradualmente
        
client_cmd(id"mp3 fadeout 5");
    }
}
#include <amxmodx>
#include <fun>

new WarmupTime 60// Duración del calentamiento en segundos
new WarmupMusic[] = "music/warmup.mp3"// Ruta de la música de calentamiento

public plugin_init()
{
    
register_plugin("warm-up""1.0""a stranger");
    
    
register_clcmd("warmup""cmd_warmup");
}

public 
cmd_warmup(id)
{
    new 
time get_user_weapon(id); // Obtenemos el arma actual del jugador
    
    
if (time == CSW_AWP || time == CSW_AK47 || time == CSW_M4A1)
    {
        
set_task(WarmupTimer1000_id);
        
client_print(idprint_console"¡Calentamiento iniciado!");
        
        
// Reproducir música
        
client_cmd(id"mp3 play "WarmupMusic" 1");
    }
    else
    {
        
client_print(idprint_console"No se puede realizar el calentamiento con esta arma.");
    }
}

public 
WarmupTimer(id)
{
    if (
WarmupTime 0)
    {
        
client_print(idprint_chat"¡Tiempo restante de calentamiento: "WarmupTime" segundos!");
        
WarmupTime--;
        
set_task(WarmupTimer1000_id);
    }
    else
    {
        
client_print(idprint_chat"¡Calentamiento finalizado!");
        
        
// Detener música gradualmente
        
client_cmd(id"mp3 fadeout 5");
    }
}
#include <amxmodx>
#include <fun>

new WarmupTime 60// Duración del calentamiento en segundos
new WarmupMusic[] = "music/warmup.mp3"// Ruta de la música de calentamiento

public plugin_init()
{
    
register_plugin("warm-up""1.0""a stranger");
    
    
register_clcmd("warmup""cmd_warmup");
}

public 
cmd_warmup(id)
{
    new 
time get_user_weapon(id); // Obtenemos el arma actual del jugador
    
    
if (time == CSW_AWP || time == CSW_AK47 || time == CSW_M4A1)
    {
        
set_task(WarmupTimer1000_id);
        
client_print(idprint_console"¡Calentamiento iniciado!");
        
        
// Reproducir música
        
client_cmd(id"mp3 play "WarmupMusic" 1");
    }
    else
    {
        
client_print(idprint_console"No se puede realizar el calentamiento con esta arma.");
    }
}

public 
WarmupTimer(id)
{
    if (
WarmupTime 0)
    {
        
client_print(idprint_chat"¡Tiempo restante de calentamiento: "WarmupTime" segundos!");
        
WarmupTime--;
        
set_task(WarmupTimer1000_id);
    }
    else
    {
        
client_print(idprint_chat"¡Calentamiento finalizado!");
        
        
// Detener música gradualmente
        
client_cmd(id"mp3 fadeout 5");
    }

Fururasshu is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-19-2023 , 00:15   Re: Help me please, error when compiling
Reply With Quote #2

Well, you should probably at least try to do something based on the original thread. In summary, they said you need to learn how to use the set_task() function. Find any plugin that uses this function for an example of how to use it.

If you're not aware of it already, there is a pretty good documentation of all the functions available here.
__________________

Last edited by fysiks; 09-19-2023 at 00:17.
fysiks 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 15:26.


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