AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help me please, error when compiling (https://forums.alliedmods.net/showthread.php?t=343958)

Fururasshu 09-18-2023 20:25

Help me please, error when compiling
 
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");
    }



fysiks 09-19-2023 00:15

Re: Help me please, error when compiling
 
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.


All times are GMT -4. The time now is 15:16.

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