Allied Modders en español
jctf_team_scoreV2 ayuda - Versión para impresión

+- Allied Modders en español (https://amxmodx-es.com)
+-- Foro: AMX Mod X - Plugins (https://amxmodx-es.com/Forum-AMX-Mod-X-Plugins)
+--- Foro: Pedido de Plugins (https://amxmodx-es.com/Forum-Pedido-de-Plugins)
+--- Tema: jctf_team_scoreV2 ayuda (/Thread-jctf-team-scoreV2-ayuda)



jctf_team_scoreV2 ayuda - moli102 - 16/05/2018

me sale este error al copilar el plugin y si me podrian ayudar a seprar un poco mas el hud osea Blue Team un poco mas a la izquierda y Red Team un poco mas a la derechera q no esten tan pegados
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2006 ITB CompuPhase, AMX Mod X Team

Warning: Loose indentation on line 96
Warning: Loose indentation on line 102
Warning: Loose indentation on line 103
Warning: Loose indentation on line 110
Warning: Symbol is assigned a value that is never used: "Conteo" on line 113
Warning: Symbol is assigned a value that is never used: "Tonteo" on line 113
Header size: 872 bytes
Code size: 4844 bytes
Data size: 1164 bytes
Stack/heap size: 16384 bytes; estimated max. usage=198 cells (792 bytes)
Total requirements: 23264 bytes

6 Warnings.
Done.


Código PHP:
#include <amxmodx>
#include <jctf>
#include <cstrike>
#include <dhudmessage>

#define PLUGIN "Team Score (JCTF)"
#define VERSION "2.0"
#define AUTHOR "Sugisaki"

new scorett
new scorect

new Conteo
new Tonteo

new SND_BLUE_WIN[] = "AG_CTF_2018/blue_wins.wav"
new SND_RED_WIN[] = "AG_CTF_2018/red_wins.wav"
new SND_TEAMS_TIED[] = "AG_CTF_2018/teams_tied.wav"

enum
{
    
TEAM_NONE 0,
    
TEAM_RED,
    
TEAM_BLUE,
    
TEAM_SPEC
}

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_event("TextMsg","game_c","a","2&#Game_C")
    
set_task(0.7,"score_round",_,_,_,"b")
    
set_task(0.1"check"___"b")
    
set_task(0.1,"conteo_team",19708,_,_,"b")
    
scorett 0
    scorect 
0
}
public 
PlaySound(sound[])
{
    
client_cmd(0"spk ^"%s^""sound)
}
public 
plugin_precache()
{
    
precache_sound(SND_BLUE_WIN)
    
precache_sound(SND_RED_WIN)
    
precache_sound(SND_TEAMS_TIED)
}
public 
game_c()
{
    
set_task(3.0"reset_score")
}
public 
reset_score()
{
    
scorett 0
    scorect 
0
}
public 
jctf_flag(evidtm)
{
    if(
ev == FLAG_CAPTURED)
    {
        switch(
tm)
        {
            case 
TEAM_REDscorect++
            case 
TEAM_BLUEscorett++
        }
    }
    return
}
public 
score_round()
{
    
set_dhudmessage(002550.350.0110.51.0+0.01)
    
show_dhudmessage(0"|   Blue Team  |^n          %i"scorect)
    
    
set_dhudmessage(255000.520.0110.51.0+0.01)
    
show_dhudmessage(0"|  Red Team  |^n         %i"scorett)
}
public 
check()
{
    new 
string[10]
    
get_cvar_string("amx_timeleft"string10)
    
    if(
equal(string"00:00"))
    {
        
remove_task(_)
        if(
scorect == scorett)
            
PlaySound(SND_TEAMS_TIED)
        else if(
scorect>scorett)
            
PlaySound(SND_BLUE_WIN)
        else if(
scorect<scorett)
            
PlaySound(SND_RED_WIN)
    }
}

public 
conteo_team() {
    new 
iCTconteo                                                                                            
        
for(new 0<= get_maxplayers(); i++) {                                                    
        if(
is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_CT)
        {
            
iCTconteo++
        }
    }    
    new 
iTRconteo
        
for(new 0<= get_maxplayers(); i++) 
    {                                                        
        if(
is_user_alive(i) && cs_get_user_team(i) == CS_TEAM_T)
        {
            
iTRconteo++
        }
    }
    
Conteo iCTconteo
    Tonteo 
iTRconteo




RE: jctf_team_scoreV2 ayuda - Exertency - 16/05/2018

Las primeras 4 advertencias son de mala tabulación, corregilas con el Tab o eliminando los espacios demás.
Y las 2 siguientes te advierte de que esas 2 variables no se utilizan.
El plugin está bien y compila, solo son advertencias.

Para mover a la izquierda un hud tenés que disminuir la posición X y para mover a la derecha aumentar.
Código PHP:
set_dhudmessage(00255POSICIÓN _XPOSICIÓN _Y ..... 
En tu caso, en el hud "Blue Team" modificas el valor 0.35 por alguno menor y en el hud "Red Team" modificas el 0.52 por alguno mayor.
Pd: esto va en la sección scripting.