error al copilar rangos
#1
pls me sale esto al copilar Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright © 1997-2006 ITB CompuPhase, AMX Mod X Team

Error: Undefined symbol "index" on line 145

1 Error.
Could not locate output file C:\Users\Usuario\Desktop\Rangos.amx (compile failed).

Código PHP:
/*    -----------------------------------------
Creditos: Solo para Raulitop, por el hook say :3

Version Con Guardado NFVAULT
-------------------------------            */

#include <amxmisc>
#include <fakemeta>
#include <adv_vault>

new const PLUGIN[] = "Rangos CS:GO"
#define VERSION "1.0"
new const AUTHOR[] = "kikizon"

/* =============================================
|= [EMPIEZA SECCION MODIFICABLE] =|
==============================================*/
/* ====================================
*[CONSTANTES]*
=====================================*/ 
new const Prefijo[] = "!t[!yRANGOS!t]" // Prefijo en say
native jctf_get_adrenaline(id)
/* ====================================
*[CONST NOMBRES DE RANGOS]*
=====================================*/
enum _:DATA
{
    
NOMBRE[32],
    
FRAGS
}
new const 
Rangos[][DATA] = {
    { 
"Silver New"20 },
    { 
"Silver I"100 },
    { 
"Silver II"300 },
    { 
"Silver III"800 },
    { 
"Silver IV"1500 },
    { 
"Silver Elite"2500 },
    { 
"Elite I"3800 },
    { 
"Elite II"5400 },
    { 
"Elite III"7400 },
    { 
"Elite S"9750 },
    { 
"Elite Master"12450 },
    { 
"GoldNova I"15450 },
    { 
"GoldNova II"18850 },
    { 
"GoldNova III"22650 },
    { 
"GoldNova SS"26850 },
    { 
"GoldNova Master"31450 },
    { 
"MasterGuardian I"36450 },
    { 
"MasterGuardian II"41950 },
    { 
"MasterGuardian III"47950 },
    { 
"MasterGuardian S"54950 },
    { 
"MasterGuardian SS"64950 },
    { 
"MasterGuardian Elite"77950 },
    { 
"MasterGuardian Elite I"94950 },
    { 
"MasterGuardian Elite II"116950 },
    { 
"MasterGuardian Elite III"150000 },
    { 
"Master Distinguido"151000 },
    { 
"Master Distinguido SS"152000 },
    { 
"Master Distinguido SSS"180000 },
    { 
"Legendary"200000 },
    { 
"Legendary S"225000 },
    { 
"Legendary SS"255000 },
    { 
"Legendary Eagle"290000 },
    { 
"Legendary Eagle S"330000 },
    { 
"Legendary Eagle SS"340000 },
    { 
"Legendary Eagle SSS"375000 },
    { 
"Legendaty Master"425000 },
    { 
"Legendaty Master S"430000 }
}

/* =============================================
|= [TERMINA SECCION MODIFICABLE] =|
==============================================*/
/* ====================================
*[VARIABLES]*
=====================================*/
new g_rango[33], g_frags[33]
new 
SyncHUDg_maxplayersg_msgTeamInfog_msgSayTextg_playername[33][32];
#define TASK_HUD 2100
#define ID_HUD (taskid - TASK_HUD)
new g_vault

enum 
{
    
CAMPO_RANGO,
    
CAMPO_FRAG,
    
CAMPO_MAX
}
new 
g_campos[CAMPO_MAX]

/* ====================================
*[Cvars]*
=====================================*/
new cvar_Hudcvar_knifex2cvar_hsx2
/* ====================================
*[INIT]*
=====================================*/
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("DeathMsg""Event_DeathMsg""a")
    
register_logevent("logevent_round_end"2"1=Round_End")
    
    
register_clcmd("say""message_saytext"
    
register_clcmd("say_team""message_sayteam")
    
    
    
/* =============================================
    |= [EMPIEZA SECCION MODIFICABLE] =|
    ==============================================*/
    
cvar_Hud register_cvar("rangos_hud""1")          // 1 - Mostrar HUD | 0 - No Mostrar
    
cvar_knifex2 register_cvar("rangos_knifex2""1")    // 1 - x2 frags con knife | 0 - NO :v
    
cvar_hsx2 register_cvar("rangos_hsx2""1")        // 1 - x2 frags de HeadShot | 0 - NO :v
    /* =============================================
    |= [TERMINA SECCION MODIFICABLE] =|
    ==============================================*/
    
    
SyncHUD CreateHudSyncObj()
    
g_maxplayers get_maxplayers()
    
g_msgTeamInfo get_user_msgid("TeamInfo")
    
g_msgSayText get_user_msgid("SayText")
    
    
g_vault adv_vault_open("data_rangos"false)
    
g_campos[CAMPO_RANGO] = adv_vault_register_field(g_vault"RANGOS")
    
g_campos[CAMPO_FRAG] = adv_vault_register_field(g_vault"FRAGS")
    
adv_vault_init(g_vault)
}

/* ===================================
*[HUD]*
=====================================*/
public HUD(taskid) {
    new 
id ID_HUD
    
    
if (!is_user_alive(id)) {
        
id pev(idpev_iuser2)
        if (!
is_user_alive(id)) return;
    }
   
    if(
id != ID_HUD) {
        
set_hudmessage(2552552550.600.6716.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"Frags: %d Rango: %s"g_frags[id], Rangos[g_rango[id]][NOMBRE])
    } else {
        
set_hudmessage(2041532552.00.016.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"Frags: [ %d ] - Rango: [ %s ]^nSig. Rango: [ %s ] - Frags Restantes: [ %d ]^nAdrenalina: [ %d / 100 ]"
        
g_frags[id], Rangos[g_rango[id]][NOMBRE], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] -  g_frags[id], jctf_get_adrenaline(index))
    }
    

/* ==================================
    [PUTINSERVER]
===================================*/
public client_putinserver(id) {
    
get_user_nameidg_playernameid ], charsmaxg_playername[ ] ) );
    
g_rango[id] = 0
    g_frags
[id] = 0
    
    Cargar
(id)
    
    if(
get_pcvar_num(cvar_Hud)) 
        
set_task(1.0"HUD"id+TASK_HUD__"b")
}
/* ==================================
    [DISCONNECT]
===================================*/
public client_disconnect(id) {
    
Guardar(id);
        
    
remove_task(id+TASK_HUD)
}

/* ==================================
    [ROUND END]
===================================*/
public logevent_round_end() {
    for(new 
id 1id <= g_maxplayersid++)
        
Guardar(id); 
}
/* ==================================
    [DEATHMSG]
===================================*/
public Event_DeathMsg() {
    new 
attacker read_data(1)
    new 
victim read_data(2)
    new 
hs read_data(3)
    new 
weaponid get_user_weapon(attacker)
    
    if(
victim == attacker) return;
    
    if(
is_user_alive(attacker)) {
        
g_frags[attacker]++
        
        if(
get_pcvar_num(cvar_knifex2)) {
            if(
weaponid == CSW_KNIFE
                
g_frags[attacker]++
        }
        if(
get_pcvar_num(cvar_hsx2)) {
            if(
hsg_frags[attacker]++
        }
        
AumentarRango(attacker)
    }
}
/* ================================
    [UPDATE RANGO]
=================================*/
AumentarRango(id) {    
    new 
Aumento false
    
    
while(g_frags[id] >= Rangos[g_rango[id]+1][FRAGS]) {
        
Aumento true
        g_rango
[id]++
    }
        
    if(
Aumento) {
        
chatcolor(id"[%s] Felicidades subiste al rango: !g[%s]"PrefijoRangos[g_rango[id]][NOMBRE])
        
Aumento false
    
}

/*=====================================
*[SAY]*
=====================================*/
public message_saytext(id) { 
    static 
said[192
    
read_args(saidcharsmax(said)) 
    
remove_quotes(said
    
    if (
said[0] == '@' || said[0] == '%' || said[0] == '-' || said[0] == '.' || said[0] == '!' || equal (said""))
        return 
PLUGIN_HANDLED

    
if (!ValidMessage(said1)) return PLUGIN_CONTINUE;
    
    static 
color[11], name[32], alive[11]
    
get_user_team(id,color,charsmax(color))
    
get_user_name(id,name,charsmax(name))

    if (
is_user_alive (id)) {
        
alive ""
    
} else {
        
alive "[Muerto]"
    
}

    if (
is_user_admin(id)) {
        if (
get_user_flags(id) & ADMIN_KICK
            
format(saidcharsmax(said), "^x01%s^x04%s ^x03%s ^x04: %s"aliveRangos[g_rango[id]][NOMBRE], namesaid)
    } else {
        
format(saidcharsmax(said), "^x01%s^04%s ^x03%s ^x01: %s"aliveRangos[g_rango[id]][NOMBRE], namesaid)
    }
    
    static 
iteam[11
    for (
1<= g_maxplayersi++) {
        if (!
is_user_connected(i)) continue
        
get_user_name(id,name,charsmax(name))
        
        if (
is_user_admin(i) || is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) {
            
get_user_team(iteamcharsmax(team))
            
changeTeamInfo(icolor)
            
writeMessage(isaid)
            
changeTeamInfo(iteam)
        }
    }
    return 
PLUGIN_HANDLED_MAIN;
}

public 
message_sayteam(id)
{    
    static 
said[192
    
read_args(saidcharsmax(said)) 
    
remove_quotes(said
    
    if (
said[0] == '@' || said[0] == '%' || said[0] == '-' || said[0] == '.' || said[0] == '!' || equal (said""))
        return 
PLUGIN_HANDLED

    
if (!ValidMessage(said1)) return PLUGIN_CONTINUE
    
    static 
playerTeamplayerTeamName[19]
    
playerTeam get_user_team(id)
    
    switch (
playerTeam) {
        case 
1copy (playerTeamName6"TE")
        case 
2copy (playerTeamName8"CT"
        default: 
copy (playerTeamName11"SPEC"
    }

    static 
color[11], name[32], alive[11]
    
get_user_team(id,color,charsmax(color))
    
get_user_name(id,name,charsmax(name))

    if (
is_user_alive (id)) {
        
alive ""
    
} else {
        
alive "[MUERTO]"
    
}

    if (
is_user_admin(id)) {
        if (
get_user_flags(id) & ADMIN_RCON)
            
format(saidcharsmax(said), "^x01%s [ %s ] ^x04%s ^x03%s ^x04: %s"aliveplayerTeamRangos[g_rango[id]], namesaid)
    } else {
        
format(saidcharsmax(said), "^x01%s [ %s ] ^04%s ^x03%s ^x01: %s"aliveplayerTeamRangos[g_rango[id]],namesaid)
    }

    static 
iteam[11
    for (
1<= g_maxplayersi++) {
        if (!
is_user_connected(i)) continue;
        
get_user_name(id,name,charsmax(name))
        
        if (
get_user_team(i) == playerTeam || is_user_admin(i)) {
            if (
is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) {
                
get_user_team(iteamcharsmax(team))
                
changeTeamInfo(icolor)
                
writeMessage(isaid)
                
changeTeamInfo(iteam)
            }
        }
    }
    return 
PLUGIN_HANDLED_MAIN;
}
public 
changeTeamInfo(playerteam[]) {
    
message_begin(MSG_ONEg_msgTeamInfo_player)
    
write_byte(player)
    
write_string(team)
    
message_end()
}




public 
writeMessage(playermessage[]) {
    
message_begin(MSG_ONEg_msgSayText, {000}, player)
    
write_byte(player)
    
write_string(message)
    
message_end()
}
/* ===================================
*[GUARDADO]*
=====================================*/
Guardar(id) {
    
adv_vault_set_start(g_vault)
    
    
adv_vault_set_field(g_vaultg_campos[CAMPO_RANGO], g_rango[id])
    
adv_vault_set_field(g_vaultg_campos[CAMPO_RANGO], g_frags[id])
    
    
adv_vault_set_end(g_vault0g_playername[id])
}

Cargar(id) {
    if(!
adv_vault_get_prepare(g_vault_g_playername[id])) 
        return
    
    
g_rango[id] = adv_vault_get_field(g_vaultg_campos[CAMPO_RANGO])
    
g_frags[id] = adv_vault_get_field(g_vaultg_campos[CAMPO_FRAG])

/* ===================================
*[STOCKS]*
=====================================*/
// stock de chatcolor
stock chatcolor(id, const input[], any:...) {
    new 
count 1players[32]; 
    static 
msg[191]; 
    
vformat(msg190input3); 
     
    
replace_all(msg190"!g""^4"); // Verde
    
replace_all(msg190"!y""^1"); // Default
    
replace_all(msg190"!t""^3"); // Color del Equipo 
     
    
if (idplayers[0] = id; else get_players(playerscount"ch"); { 
        for (new 
0counti++)  { 
            if (
is_user_connected(players[i])) { 
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]); 
                
write_byte(players[i]); 
                
write_string(msg); 
                
message_end(); 
            } 
        } 
    } 

// Stock para Saber Si el mensaje es valido
stock ValidMessage(text[], maxcount) {
    static 
lenicount
    len 
strlen(text)
    
count 0
    
    
if (!len)
        return 
false;
    
    for (
0leni++) {
        if (
text[i] != ' ') {
            
count++
            if (
count >= maxcount)
                return 
true;
        }
    }
    return 
false;

Responder
#2
Código PHP:
/*    -----------------------------------------
Creditos: Solo para Raulitop, por el hook say :3

Version Con Guardado NFVAULT
-------------------------------            */

#include <amxmisc>
#include <fakemeta>
#include <adv_vault>

new const PLUGIN[] = "Rangos CS:GO"
#define VERSION "1.0"
new const AUTHOR[] = "kikizon"

/* =============================================
|= [EMPIEZA SECCION MODIFICABLE] =|
==============================================*/
/* ====================================
*[CONSTANTES]*
=====================================*/ 
new const Prefijo[] = "!t[!yRANGOS!t]" // Prefijo en say
native jctf_get_adrenaline(id)
/* ====================================
*[CONST NOMBRES DE RANGOS]*
=====================================*/
enum _:DATA
{
    
NOMBRE[32],
    
FRAGS
}
new const 
Rangos[][DATA] = {
    { 
"Silver New"20 },
    { 
"Silver I"100 },
    { 
"Silver II"300 },
    { 
"Silver III"800 },
    { 
"Silver IV"1500 },
    { 
"Silver Elite"2500 },
    { 
"Elite I"3800 },
    { 
"Elite II"5400 },
    { 
"Elite III"7400 },
    { 
"Elite S"9750 },
    { 
"Elite Master"12450 },
    { 
"GoldNova I"15450 },
    { 
"GoldNova II"18850 },
    { 
"GoldNova III"22650 },
    { 
"GoldNova SS"26850 },
    { 
"GoldNova Master"31450 },
    { 
"MasterGuardian I"36450 },
    { 
"MasterGuardian II"41950 },
    { 
"MasterGuardian III"47950 },
    { 
"MasterGuardian S"54950 },
    { 
"MasterGuardian SS"64950 },
    { 
"MasterGuardian Elite"77950 },
    { 
"MasterGuardian Elite I"94950 },
    { 
"MasterGuardian Elite II"116950 },
    { 
"MasterGuardian Elite III"150000 },
    { 
"Master Distinguido"151000 },
    { 
"Master Distinguido SS"152000 },
    { 
"Master Distinguido SSS"180000 },
    { 
"Legendary"200000 },
    { 
"Legendary S"225000 },
    { 
"Legendary SS"255000 },
    { 
"Legendary Eagle"290000 },
    { 
"Legendary Eagle S"330000 },
    { 
"Legendary Eagle SS"340000 },
    { 
"Legendary Eagle SSS"375000 },
    { 
"Legendaty Master"425000 },
    { 
"Legendaty Master S"430000 }
}

/* =============================================
|= [TERMINA SECCION MODIFICABLE] =|
==============================================*/
/* ====================================
*[VARIABLES]*
=====================================*/
new g_rango[33], g_frags[33]
new 
SyncHUDg_maxplayersg_msgTeamInfog_msgSayTextg_playername[33][32];
#define TASK_HUD 2100
#define ID_HUD (taskid - TASK_HUD)
new g_vault

enum 
{
    
CAMPO_RANGO,
    
CAMPO_FRAG,
    
CAMPO_MAX
}
new 
g_campos[CAMPO_MAX]

/* ====================================
*[Cvars]*
=====================================*/
new cvar_Hudcvar_knifex2cvar_hsx2
/* ====================================
*[INIT]*
=====================================*/
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("DeathMsg""Event_DeathMsg""a")
    
register_logevent("logevent_round_end"2"1=Round_End")
    
    
register_clcmd("say""message_saytext"
    
register_clcmd("say_team""message_sayteam")
    
    
    
/* =============================================
    |= [EMPIEZA SECCION MODIFICABLE] =|
    ==============================================*/
    
cvar_Hud register_cvar("rangos_hud""1")          // 1 - Mostrar HUD | 0 - No Mostrar
    
cvar_knifex2 register_cvar("rangos_knifex2""1")    // 1 - x2 frags con knife | 0 - NO :v
    
cvar_hsx2 register_cvar("rangos_hsx2""1")        // 1 - x2 frags de HeadShot | 0 - NO :v
    /* =============================================
    |= [TERMINA SECCION MODIFICABLE] =|
    ==============================================*/
    
    
SyncHUD CreateHudSyncObj()
    
g_maxplayers get_maxplayers()
    
g_msgTeamInfo get_user_msgid("TeamInfo")
    
g_msgSayText get_user_msgid("SayText")
    
    
g_vault adv_vault_open("data_rangos"false)
    
g_campos[CAMPO_RANGO] = adv_vault_register_field(g_vault"RANGOS")
    
g_campos[CAMPO_FRAG] = adv_vault_register_field(g_vault"FRAGS")
    
adv_vault_init(g_vault)
}

/* ===================================
*[HUD]*
=====================================*/
public HUD(taskid) {
    new 
id ID_HUD
    
    
if (!is_user_alive(id)) {
        
id pev(idpev_iuser2)
        if (!
is_user_alive(id)) return;
    }
   
    if(
id != ID_HUD) {
        
set_hudmessage(2552552550.600.6716.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"Frags: %d Rango: %s"g_frags[id], Rangos[g_rango[id]][NOMBRE])
    } else {
        
set_hudmessage(2041532552.00.016.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"Frags: [ %d ] - Rango: [ %s ]^nSig. Rango: [ %s ] - Frags Restantes: [ %d ]^nAdrenalina: [ %d / 100 ]"
        
g_frags[id], Rangos[g_rango[id]][NOMBRE], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] -  g_frags[id], jctf_get_adrenaline(id))
    }
    

/* ==================================
    [PUTINSERVER]
===================================*/
public client_putinserver(id) {
    
get_user_nameidg_playernameid ], charsmaxg_playername[ ] ) );
    
g_rango[id] = 0
    g_frags
[id] = 0
    
    Cargar
(id)
    
    if(
get_pcvar_num(cvar_Hud)) 
        
set_task(1.0"HUD"id+TASK_HUD__"b")
}
/* ==================================
    [DISCONNECT]
===================================*/
public client_disconnect(id) {
    
Guardar(id);
        
    
remove_task(id+TASK_HUD)
}

/* ==================================
    [ROUND END]
===================================*/
public logevent_round_end() {
    for(new 
id 1id <= g_maxplayersid++)
        
Guardar(id); 
}
/* ==================================
    [DEATHMSG]
===================================*/
public Event_DeathMsg() {
    new 
attacker read_data(1)
    new 
victim read_data(2)
    new 
hs read_data(3)
    new 
weaponid get_user_weapon(attacker)
    
    if(
victim == attacker) return;
    
    if(
is_user_alive(attacker)) {
        
g_frags[attacker]++
        
        if(
get_pcvar_num(cvar_knifex2)) {
            if(
weaponid == CSW_KNIFE
                
g_frags[attacker]++
        }
        if(
get_pcvar_num(cvar_hsx2)) {
            if(
hsg_frags[attacker]++
        }
        
AumentarRango(attacker)
    }
}
/* ================================
    [UPDATE RANGO]
=================================*/
AumentarRango(id) {    
    new 
Aumento false
    
    
while(g_frags[id] >= Rangos[g_rango[id]+1][FRAGS]) {
        
Aumento true
        g_rango
[id]++
    }
        
    if(
Aumento) {
        
chatcolor(id"[%s] Felicidades subiste al rango: !g[%s]"PrefijoRangos[g_rango[id]][NOMBRE])
        
Aumento false
    
}

/*=====================================
*[SAY]*
=====================================*/
public message_saytext(id) { 
    static 
said[192
    
read_args(saidcharsmax(said)) 
    
remove_quotes(said
    
    if (
said[0] == '@' || said[0] == '%' || said[0] == '-' || said[0] == '.' || said[0] == '!' || equal (said""))
        return 
PLUGIN_HANDLED

    
if (!ValidMessage(said1)) return PLUGIN_CONTINUE;
    
    static 
color[11], name[32], alive[11]
    
get_user_team(id,color,charsmax(color))
    
get_user_name(id,name,charsmax(name))

    if (
is_user_alive (id)) {
        
alive ""
    
} else {
        
alive "[Muerto]"
    
}

    if (
is_user_admin(id)) {
        if (
get_user_flags(id) & ADMIN_KICK
            
format(saidcharsmax(said), "^x01%s^x04%s ^x03%s ^x04: %s"aliveRangos[g_rango[id]][NOMBRE], namesaid)
    } else {
        
format(saidcharsmax(said), "^x01%s^04%s ^x03%s ^x01: %s"aliveRangos[g_rango[id]][NOMBRE], namesaid)
    }
    
    static 
iteam[11
    for (
1<= g_maxplayersi++) {
        if (!
is_user_connected(i)) continue
        
get_user_name(id,name,charsmax(name))
        
        if (
is_user_admin(i) || is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) {
            
get_user_team(iteamcharsmax(team))
            
changeTeamInfo(icolor)
            
writeMessage(isaid)
            
changeTeamInfo(iteam)
        }
    }
    return 
PLUGIN_HANDLED_MAIN;
}

public 
message_sayteam(id)
{    
    static 
said[192
    
read_args(saidcharsmax(said)) 
    
remove_quotes(said
    
    if (
said[0] == '@' || said[0] == '%' || said[0] == '-' || said[0] == '.' || said[0] == '!' || equal (said""))
        return 
PLUGIN_HANDLED

    
if (!ValidMessage(said1)) return PLUGIN_CONTINUE
    
    static 
playerTeamplayerTeamName[19]
    
playerTeam get_user_team(id)
    
    switch (
playerTeam) {
        case 
1copy (playerTeamName6"TE")
        case 
2copy (playerTeamName8"CT"
        default: 
copy (playerTeamName11"SPEC"
    }

    static 
color[11], name[32], alive[11]
    
get_user_team(id,color,charsmax(color))
    
get_user_name(id,name,charsmax(name))

    if (
is_user_alive (id)) {
        
alive ""
    
} else {
        
alive "[MUERTO]"
    
}

    if (
is_user_admin(id)) {
        if (
get_user_flags(id) & ADMIN_RCON)
            
format(saidcharsmax(said), "^x01%s [ %s ] ^x04%s ^x03%s ^x04: %s"aliveplayerTeamRangos[g_rango[id]], namesaid)
    } else {
        
format(saidcharsmax(said), "^x01%s [ %s ] ^04%s ^x03%s ^x01: %s"aliveplayerTeamRangos[g_rango[id]],namesaid)
    }

    static 
iteam[11
    for (
1<= g_maxplayersi++) {
        if (!
is_user_connected(i)) continue;
        
get_user_name(id,name,charsmax(name))
        
        if (
get_user_team(i) == playerTeam || is_user_admin(i)) {
            if (
is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) {
                
get_user_team(iteamcharsmax(team))
                
changeTeamInfo(icolor)
                
writeMessage(isaid)
                
changeTeamInfo(iteam)
            }
        }
    }
    return 
PLUGIN_HANDLED_MAIN;
}
public 
changeTeamInfo(playerteam[]) {
    
message_begin(MSG_ONEg_msgTeamInfo_player)
    
write_byte(player)
    
write_string(team)
    
message_end()
}




public 
writeMessage(playermessage[]) {
    
message_begin(MSG_ONEg_msgSayText, {000}, player)
    
write_byte(player)
    
write_string(message)
    
message_end()
}
/* ===================================
*[GUARDADO]*
=====================================*/
Guardar(id) {
    
adv_vault_set_start(g_vault)
    
    
adv_vault_set_field(g_vaultg_campos[CAMPO_RANGO], g_rango[id])
    
adv_vault_set_field(g_vaultg_campos[CAMPO_RANGO], g_frags[id])
    
    
adv_vault_set_end(g_vault0g_playername[id])
}

Cargar(id) {
    if(!
adv_vault_get_prepare(g_vault_g_playername[id])) 
        return
    
    
g_rango[id] = adv_vault_get_field(g_vaultg_campos[CAMPO_RANGO])
    
g_frags[id] = adv_vault_get_field(g_vaultg_campos[CAMPO_FRAG])

/* ===================================
*[STOCKS]*
=====================================*/
// stock de chatcolor
stock chatcolor(id, const input[], any:...) {
    new 
count 1players[32]; 
    static 
msg[191]; 
    
vformat(msg190input3); 
     
    
replace_all(msg190"!g""^4"); // Verde
    
replace_all(msg190"!y""^1"); // Default
    
replace_all(msg190"!t""^3"); // Color del Equipo 
     
    
if (idplayers[0] = id; else get_players(playerscount"ch"); { 
        for (new 
0counti++)  { 
            if (
is_user_connected(players[i])) { 
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]); 
                
write_byte(players[i]); 
                
write_string(msg); 
                
message_end(); 
            } 
        } 
    } 

// Stock para Saber Si el mensaje es valido
stock ValidMessage(text[], maxcount) {
    static 
lenicount
    len 
strlen(text)
    
count 0
    
    
if (!len)
        return 
false;
    
    for (
0leni++) {
        if (
text[i] != ' ') {
            
count++
            if (
count >= maxcount)
                return 
true;
        }
    }
    return 
false;

Steam
Responder
#3
(28/07/2018, 03:56 PM)Pablo_1998 escribió:
Código PHP:
/*    -----------------------------------------
Creditos: Solo para Raulitop, por el hook say :3

Version Con Guardado NFVAULT
-------------------------------            */

#include <amxmisc>
#include <fakemeta>
#include <adv_vault>

new const PLUGIN[] = "Rangos CS:GO"
#define VERSION "1.0"
new const AUTHOR[] = "kikizon"

/* =============================================
|= [EMPIEZA SECCION MODIFICABLE] =|
==============================================*/
/* ====================================
*[CONSTANTES]*
=====================================*/ 
new const Prefijo[] = "!t[!yRANGOS!t]" // Prefijo en say
native jctf_get_adrenaline(id)
/* ====================================
*[CONST NOMBRES DE RANGOS]*
=====================================*/
enum _:DATA
{
    
NOMBRE[32],
    
FRAGS
}
new const 
Rangos[][DATA] = {
    { 
"Silver New"20 },
    { 
"Silver I"100 },
    { 
"Silver II"300 },
    { 
"Silver III"800 },
    { 
"Silver IV"1500 },
    { 
"Silver Elite"2500 },
    { 
"Elite I"3800 },
    { 
"Elite II"5400 },
    { 
"Elite III"7400 },
    { 
"Elite S"9750 },
    { 
"Elite Master"12450 },
    { 
"GoldNova I"15450 },
    { 
"GoldNova II"18850 },
    { 
"GoldNova III"22650 },
    { 
"GoldNova SS"26850 },
    { 
"GoldNova Master"31450 },
    { 
"MasterGuardian I"36450 },
    { 
"MasterGuardian II"41950 },
    { 
"MasterGuardian III"47950 },
    { 
"MasterGuardian S"54950 },
    { 
"MasterGuardian SS"64950 },
    { 
"MasterGuardian Elite"77950 },
    { 
"MasterGuardian Elite I"94950 },
    { 
"MasterGuardian Elite II"116950 },
    { 
"MasterGuardian Elite III"150000 },
    { 
"Master Distinguido"151000 },
    { 
"Master Distinguido SS"152000 },
    { 
"Master Distinguido SSS"180000 },
    { 
"Legendary"200000 },
    { 
"Legendary S"225000 },
    { 
"Legendary SS"255000 },
    { 
"Legendary Eagle"290000 },
    { 
"Legendary Eagle S"330000 },
    { 
"Legendary Eagle SS"340000 },
    { 
"Legendary Eagle SSS"375000 },
    { 
"Legendaty Master"425000 },
    { 
"Legendaty Master S"430000 }
}

/* =============================================
|= [TERMINA SECCION MODIFICABLE] =|
==============================================*/
/* ====================================
*[VARIABLES]*
=====================================*/
new g_rango[33], g_frags[33]
new 
SyncHUDg_maxplayersg_msgTeamInfog_msgSayTextg_playername[33][32];
#define TASK_HUD 2100
#define ID_HUD (taskid - TASK_HUD)
new g_vault

enum 
{
    
CAMPO_RANGO,
    
CAMPO_FRAG,
    
CAMPO_MAX
}
new 
g_campos[CAMPO_MAX]

/* ====================================
*[Cvars]*
=====================================*/
new cvar_Hudcvar_knifex2cvar_hsx2
/* ====================================
*[INIT]*
=====================================*/
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("DeathMsg""Event_DeathMsg""a")
    
register_logevent("logevent_round_end"2"1=Round_End")
    
    
register_clcmd("say""message_saytext"
    
register_clcmd("say_team""message_sayteam")
    
    
    
/* =============================================
    |= [EMPIEZA SECCION MODIFICABLE] =|
    ==============================================*/
    
cvar_Hud register_cvar("rangos_hud""1")          // 1 - Mostrar HUD | 0 - No Mostrar
    
cvar_knifex2 register_cvar("rangos_knifex2""1")    // 1 - x2 frags con knife | 0 - NO :v
    
cvar_hsx2 register_cvar("rangos_hsx2""1")        // 1 - x2 frags de HeadShot | 0 - NO :v
    /* =============================================
    |= [TERMINA SECCION MODIFICABLE] =|
    ==============================================*/
    
    
SyncHUD CreateHudSyncObj()
    
g_maxplayers get_maxplayers()
    
g_msgTeamInfo get_user_msgid("TeamInfo")
    
g_msgSayText get_user_msgid("SayText")
    
    
g_vault adv_vault_open("data_rangos"false)
    
g_campos[CAMPO_RANGO] = adv_vault_register_field(g_vault"RANGOS")
    
g_campos[CAMPO_FRAG] = adv_vault_register_field(g_vault"FRAGS")
    
adv_vault_init(g_vault)
}

/* ===================================
*[HUD]*
=====================================*/
public HUD(taskid) {
    new 
id ID_HUD
    
    
if (!is_user_alive(id)) {
        
id pev(idpev_iuser2)
        if (!
is_user_alive(id)) return;
    }
   
    if(
id != ID_HUD) {
        
set_hudmessage(2552552550.600.6716.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"Frags: %d Rango: %s"g_frags[id], Rangos[g_rango[id]][NOMBRE])
    } else {
        
set_hudmessage(2041532552.00.016.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"Frags: [ %d ] - Rango: [ %s ]^nSig. Rango: [ %s ] - Frags Restantes: [ %d ]^nAdrenalina: [ %d / 100 ]"
        
g_frags[id], Rangos[g_rango[id]][NOMBRE], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] -  g_frags[id], jctf_get_adrenaline(id))
    }
    

/* ==================================
    [PUTINSERVER]
===================================*/
public client_putinserver(id) {
    
get_user_nameidg_playernameid ], charsmaxg_playername[ ] ) );
    
g_rango[id] = 0
    g_frags
[id] = 0
    
    Cargar
(id)
    
    if(
get_pcvar_num(cvar_Hud)) 
        
set_task(1.0"HUD"id+TASK_HUD__"b")
}
/* ==================================
    [DISCONNECT]
===================================*/
public client_disconnect(id) {
    
Guardar(id);
        
    
remove_task(id+TASK_HUD)
}

/* ==================================
    [ROUND END]
===================================*/
public logevent_round_end() {
    for(new 
id 1id <= g_maxplayersid++)
        
Guardar(id); 
}
/* ==================================
    [DEATHMSG]
===================================*/
public Event_DeathMsg() {
    new 
attacker read_data(1)
    new 
victim read_data(2)
    new 
hs read_data(3)
    new 
weaponid get_user_weapon(attacker)
    
    if(
victim == attacker) return;
    
    if(
is_user_alive(attacker)) {
        
g_frags[attacker]++
        
        if(
get_pcvar_num(cvar_knifex2)) {
            if(
weaponid == CSW_KNIFE
                
g_frags[attacker]++
        }
        if(
get_pcvar_num(cvar_hsx2)) {
            if(
hsg_frags[attacker]++
        }
        
AumentarRango(attacker)
    }
}
/* ================================
    [UPDATE RANGO]
=================================*/
AumentarRango(id) {    
    new 
Aumento false
    
    
while(g_frags[id] >= Rangos[g_rango[id]+1][FRAGS]) {
        
Aumento true
        g_rango
[id]++
    }
        
    if(
Aumento) {
        
chatcolor(id"[%s] Felicidades subiste al rango: !g[%s]"PrefijoRangos[g_rango[id]][NOMBRE])
        
Aumento false
    
}

/*=====================================
*[SAY]*
=====================================*/
public message_saytext(id) { 
    static 
said[192
    
read_args(saidcharsmax(said)) 
    
remove_quotes(said
    
    if (
said[0] == '@' || said[0] == '%' || said[0] == '-' || said[0] == '.' || said[0] == '!' || equal (said""))
        return 
PLUGIN_HANDLED

    
if (!ValidMessage(said1)) return PLUGIN_CONTINUE;
    
    static 
color[11], name[32], alive[11]
    
get_user_team(id,color,charsmax(color))
    
get_user_name(id,name,charsmax(name))

    if (
is_user_alive (id)) {
        
alive ""
    
} else {
        
alive "[Muerto]"
    
}

    if (
is_user_admin(id)) {
        if (
get_user_flags(id) & ADMIN_KICK
            
format(saidcharsmax(said), "^x01%s^x04%s ^x03%s ^x04: %s"aliveRangos[g_rango[id]][NOMBRE], namesaid)
    } else {
        
format(saidcharsmax(said), "^x01%s^04%s ^x03%s ^x01: %s"aliveRangos[g_rango[id]][NOMBRE], namesaid)
    }
    
    static 
iteam[11
    for (
1<= g_maxplayersi++) {
        if (!
is_user_connected(i)) continue
        
get_user_name(id,name,charsmax(name))
        
        if (
is_user_admin(i) || is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) {
            
get_user_team(iteamcharsmax(team))
            
changeTeamInfo(icolor)
            
writeMessage(isaid)
            
changeTeamInfo(iteam)
        }
    }
    return 
PLUGIN_HANDLED_MAIN;
}

public 
message_sayteam(id)
{    
    static 
said[192
    
read_args(saidcharsmax(said)) 
    
remove_quotes(said
    
    if (
said[0] == '@' || said[0] == '%' || said[0] == '-' || said[0] == '.' || said[0] == '!' || equal (said""))
        return 
PLUGIN_HANDLED

    
if (!ValidMessage(said1)) return PLUGIN_CONTINUE
    
    static 
playerTeamplayerTeamName[19]
    
playerTeam get_user_team(id)
    
    switch (
playerTeam) {
        case 
1copy (playerTeamName6"TE")
        case 
2copy (playerTeamName8"CT"
        default: 
copy (playerTeamName11"SPEC"
    }

    static 
color[11], name[32], alive[11]
    
get_user_team(id,color,charsmax(color))
    
get_user_name(id,name,charsmax(name))

    if (
is_user_alive (id)) {
        
alive ""
    
} else {
        
alive "[MUERTO]"
    
}

    if (
is_user_admin(id)) {
        if (
get_user_flags(id) & ADMIN_RCON)
            
format(saidcharsmax(said), "^x01%s [ %s ] ^x04%s ^x03%s ^x04: %s"aliveplayerTeamRangos[g_rango[id]], namesaid)
    } else {
        
format(saidcharsmax(said), "^x01%s [ %s ] ^04%s ^x03%s ^x01: %s"aliveplayerTeamRangos[g_rango[id]],namesaid)
    }

    static 
iteam[11
    for (
1<= g_maxplayersi++) {
        if (!
is_user_connected(i)) continue;
        
get_user_name(id,name,charsmax(name))
        
        if (
get_user_team(i) == playerTeam || is_user_admin(i)) {
            if (
is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) {
                
get_user_team(iteamcharsmax(team))
                
changeTeamInfo(icolor)
                
writeMessage(isaid)
                
changeTeamInfo(iteam)
            }
        }
    }
    return 
PLUGIN_HANDLED_MAIN;
}
public 
changeTeamInfo(playerteam[]) {
    
message_begin(MSG_ONEg_msgTeamInfo_player)
    
write_byte(player)
    
write_string(team)
    
message_end()
}




public 
writeMessage(playermessage[]) {
    
message_begin(MSG_ONEg_msgSayText, {000}, player)
    
write_byte(player)
    
write_string(message)
    
message_end()
}
/* ===================================
*[GUARDADO]*
=====================================*/
Guardar(id) {
    
adv_vault_set_start(g_vault)
    
    
adv_vault_set_field(g_vaultg_campos[CAMPO_RANGO], g_rango[id])
    
adv_vault_set_field(g_vaultg_campos[CAMPO_RANGO], g_frags[id])
    
    
adv_vault_set_end(g_vault0g_playername[id])
}

Cargar(id) {
    if(!
adv_vault_get_prepare(g_vault_g_playername[id])) 
        return
    
    
g_rango[id] = adv_vault_get_field(g_vaultg_campos[CAMPO_RANGO])
    
g_frags[id] = adv_vault_get_field(g_vaultg_campos[CAMPO_FRAG])

/* ===================================
*[STOCKS]*
=====================================*/
// stock de chatcolor
stock chatcolor(id, const input[], any:...) {
    new 
count 1players[32]; 
    static 
msg[191]; 
    
vformat(msg190input3); 
     
    
replace_all(msg190"!g""^4"); // Verde
    
replace_all(msg190"!y""^1"); // Default
    
replace_all(msg190"!t""^3"); // Color del Equipo 
     
    
if (idplayers[0] = id; else get_players(playerscount"ch"); { 
        for (new 
0counti++)  { 
            if (
is_user_connected(players[i])) { 
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]); 
                
write_byte(players[i]); 
                
write_string(msg); 
                
message_end(); 
            } 
        } 
    } 

// Stock para Saber Si el mensaje es valido
stock ValidMessage(text[], maxcount) {
    static 
lenicount
    len 
strlen(text)
    
count 0
    
    
if (!len)
        return 
false;
    
    for (
0leni++) {
        if (
text[i] != ' ') {
            
count++
            if (
count >= maxcount)
                return 
true;
        }
    }
    return 
false;


gracias
Responder
#4
toma por si las dudas xd
Código PHP:
/*    -----------------------------------------
Creditos: Solo para Raulitop, por el hook say :3

Version Con Guardado NFVAULT
-------------------------------            */

#include <amxmisc>
#include <fakemeta>
#include <adv_vault>

new const PLUGIN[] = "Rangos CS:GO"
#define VERSION "1.0"
new const AUTHOR[] = "kikizon"

/* =============================================
|= [EMPIEZA SECCION MODIFICABLE] =|
==============================================*/
/* ====================================
*[CONSTANTES]*
=====================================*/ 
new const Prefijo[] = "!t[!yRANGOS!t]" // Prefijo en say
native jctf_get_adrenaline(id)
/* ====================================
*[CONST NOMBRES DE RANGOS]*
=====================================*/
enum _:DATA
{
    
NOMBRE[32],
    
FRAGS
}
new const 
Rangos[][DATA] = {
    { 
"Silver New"20 },
    { 
"Silver I"100 },
    { 
"Silver II"300 },
    { 
"Silver III"800 },
    { 
"Silver IV"1500 },
    { 
"Silver Elite"2500 },
    { 
"Elite I"3800 },
    { 
"Elite II"5400 },
    { 
"Elite III"7400 },
    { 
"Elite S"9750 },
    { 
"Elite Master"12450 },
    { 
"GoldNova I"15450 },
    { 
"GoldNova II"18850 },
    { 
"GoldNova III"22650 },
    { 
"GoldNova SS"26850 },
    { 
"GoldNova Master"31450 },
    { 
"MasterGuardian I"36450 },
    { 
"MasterGuardian II"41950 },
    { 
"MasterGuardian III"47950 },
    { 
"MasterGuardian S"54950 },
    { 
"MasterGuardian SS"64950 },
    { 
"MasterGuardian Elite"77950 },
    { 
"MasterGuardian Elite I"94950 },
    { 
"MasterGuardian Elite II"116950 },
    { 
"MasterGuardian Elite III"150000 },
    { 
"Master Distinguido"151000 },
    { 
"Master Distinguido SS"152000 },
    { 
"Master Distinguido SSS"180000 },
    { 
"Legendary"200000 },
    { 
"Legendary S"225000 },
    { 
"Legendary SS"255000 },
    { 
"Legendary Eagle"290000 },
    { 
"Legendary Eagle S"330000 },
    { 
"Legendary Eagle SS"340000 },
    { 
"Legendary Eagle SSS"375000 },
    { 
"Legendaty Master"425000 },
    { 
"Legendaty Master S"430000 }

}
/* =============================================
|= [TERMINA SECCION MODIFICABLE] =|
==============================================*/
/* ====================================
*[VARIABLES]*
=====================================*/
new g_rango[33], g_frags[33]
new 
SyncHUDg_maxplayersg_msgTeamInfog_msgSayTextg_playername[33][32];
#define TASK_HUD 2100
#define ID_HUD (taskid - TASK_HUD)
new g_vault

enum 
{
    
CAMPO_RANGO,
    
CAMPO_FRAG,
    
CAMPO_MAX
}
new 
g_campos[CAMPO_MAX]

/* ====================================
*[Cvars]*
=====================================*/
new cvar_Hudcvar_knifex2cvar_hsx2
/* ====================================
*[INIT]*
=====================================*/
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("DeathMsg""Event_DeathMsg""a")
    
register_logevent("logevent_round_end"2"1=Round_End")
    
    
register_clcmd("say""message_saytext"
    
register_clcmd("say_team""message_sayteam")
    
    
    
/* =============================================
    |= [EMPIEZA SECCION MODIFICABLE] =|
    ==============================================*/
    
cvar_Hud register_cvar("rangos_hud""1")          // 1 - Mostrar HUD | 0 - No Mostrar
    
cvar_knifex2 register_cvar("rangos_knifex2""1")    // 1 - x2 frags con knife | 0 - NO :v
    
cvar_hsx2 register_cvar("rangos_hsx2""1")        // 1 - x2 frags de HeadShot | 0 - NO :v
    /* =============================================
    |= [TERMINA SECCION MODIFICABLE] =|
    ==============================================*/
    
    
SyncHUD CreateHudSyncObj()
    
g_maxplayers get_maxplayers()
    
g_msgTeamInfo get_user_msgid("TeamInfo")
    
g_msgSayText get_user_msgid("SayText")
    
    
g_vault adv_vault_open("data_rangos"false)
    
g_campos[CAMPO_RANGO] = adv_vault_register_field(g_vault"RANGOS")
    
g_campos[CAMPO_FRAG] = adv_vault_register_field(g_vault"FRAGS")
    
adv_vault_init(g_vault)
}

/* ===================================
*[HUD]*
=====================================*/
public HUD(taskid) {
    new 
id ID_HUD
    
    
if (!is_user_alive(id)) {
        
id pev(idpev_iuser2)
        if (!
is_user_alive(id)) return;
    }
   
    if(
id != ID_HUD) {
        
set_hudmessage(2552552550.600.6716.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"Frags: %d  ||  Rango: %s"g_frags[id], Rangos[g_rango[id]][NOMBRE])
    } else {
        
set_hudmessage(025500.00.2016.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"=======================^nFrags: %d^nRango: %s^n=======================^nSig. Rango: %s^nFrags Restantes: %d^n=======================^n%s"
        
g_frags[id], Rangos[g_rango[id]][NOMBRE], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] -  g_frags[id])
    }
    

/* ==================================
    [PUTINSERVER]
===================================*/
public client_putinserver(id) {
    
get_user_nameidg_playernameid ], charsmaxg_playername[ ] ) );
    
g_rango[id] = 0
    g_frags
[id] = 0
    
    Cargar
(id)
    
    if(
get_pcvar_num(cvar_Hud)) 
        
set_task(1.0"HUD"id+TASK_HUD__"b")
}
/* ==================================
    [DISCONNECT]
===================================*/
public client_disconnect(id) {
    
Guardar(id);
        
    
remove_task(id+TASK_HUD)
}

/* ==================================
    [ROUND END]
===================================*/
public logevent_round_end() {
    for(new 
id 1id <= g_maxplayersid++)
        
Guardar(id); 
}
/* ==================================
    [DEATHMSG]
===================================*/
public Event_DeathMsg() {
    new 
attacker read_data(1)
    new 
victim read_data(2)
    new 
hs read_data(3)
    new 
weaponid get_user_weapon(attacker)
    
    if(
victim == attacker) return;
    
    if(
is_user_alive(attacker)) {
        
g_frags[attacker]++
        
        if(
get_pcvar_num(cvar_knifex2)) {
            if(
weaponid == CSW_KNIFE
                
g_frags[attacker]++
        }
        if(
get_pcvar_num(cvar_hsx2)) {
            if(
hsg_frags[attacker]++
        }
        
AumentarRango(attacker)
    }
}
/* ================================
    [UPDATE RANGO]
=================================*/
AumentarRango(id) {    
    new 
Aumento false
    
    
while(g_frags[id] >= Rangos[g_rango[id]+1][FRAGS]) {
        
Aumento true
        g_rango
[id]++
    }
        
    if(
Aumento) {
        
chatcolor(id"[%s] Felicidades subiste al rango: !g[%s]"PrefijoRangos[g_rango[id]][NOMBRE])
        
Aumento false
    
}

/*=====================================
*[SAY]*
=====================================*/
public message_saytext(id) { 
    static 
said[192
    
read_args(saidcharsmax(said)) 
    
remove_quotes(said
    
    if (
said[0] == '@' || said[0] == '%' || said[0] == '-' || said[0] == '.' || said[0] == '!' || equal (said""))
        return 
PLUGIN_HANDLED

    
if (!ValidMessage(said1)) return PLUGIN_CONTINUE;
    
    static 
color[11], name[32], alive[11]
    
get_user_team(id,color,charsmax(color))
    
get_user_name(id,name,charsmax(name))

    if (
is_user_alive (id)) {
        
alive ""
    
} else {
        
alive "[Muerto]"
    
}

    if (
is_user_admin(id)) {
        if (
get_user_flags(id) & ADMIN_KICK
            
format(saidcharsmax(said), "^x01%s^x04%s ^x03%s ^x04: %s"aliveRangos[g_rango[id]][NOMBRE], namesaid)
    } else {
        
format(saidcharsmax(said), "^x01%s^04%s ^x03%s ^x01: %s"aliveRangos[g_rango[id]][NOMBRE], namesaid)
    }
    
    static 
iteam[11
    for (
1<= g_maxplayersi++) {
        if (!
is_user_connected(i)) continue
        
get_user_name(id,name,charsmax(name))
        
        if (
is_user_admin(i) || is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) {
            
get_user_team(iteamcharsmax(team))
            
changeTeamInfo(icolor)
            
writeMessage(isaid)
            
changeTeamInfo(iteam)
        }
    }
    return 
PLUGIN_HANDLED_MAIN;
}

public 
message_sayteam(id)
{    
    static 
said[192
    
read_args(saidcharsmax(said)) 
    
remove_quotes(said
    
    if (
said[0] == '@' || said[0] == '%' || said[0] == '-' || said[0] == '.' || said[0] == '!' || equal (said""))
        return 
PLUGIN_HANDLED

    
if (!ValidMessage(said1)) return PLUGIN_CONTINUE
    
    static 
playerTeamplayerTeamName[19]
    
playerTeam get_user_team(id)
    
    switch (
playerTeam) {
        case 
1copy (playerTeamName6"TE")
        case 
2copy (playerTeamName8"CT"
        default: 
copy (playerTeamName11"SPEC"
    }

    static 
color[11], name[32], alive[11]
    
get_user_team(id,color,charsmax(color))
    
get_user_name(id,name,charsmax(name))

    if (
is_user_alive (id)) {
        
alive ""
    
} else {
        
alive "[MUERTO]"
    
}

    if (
is_user_admin(id)) {
        if (
get_user_flags(id) & ADMIN_RCON)
            
format(saidcharsmax(said), "^x01%s [ %s ] ^x04%s ^x03%s ^x04: %s"aliveplayerTeamRangos[g_rango[id]], namesaid)
    } else {
        
format(saidcharsmax(said), "^x01%s [ %s ] ^04%s ^x03%s ^x01: %s"aliveplayerTeamRangos[g_rango[id]],namesaid)
    }

    static 
iteam[11
    for (
1<= g_maxplayersi++) {
        if (!
is_user_connected(i)) continue;
        
get_user_name(id,name,charsmax(name))
        
        if (
get_user_team(i) == playerTeam || is_user_admin(i)) {
            if (
is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) {
                
get_user_team(iteamcharsmax(team))
                
changeTeamInfo(icolor)
                
writeMessage(isaid)
                
changeTeamInfo(iteam)
            }
        }
    }
    return 
PLUGIN_HANDLED_MAIN;
}
public 
changeTeamInfo(playerteam[]) {
    
message_begin(MSG_ONEg_msgTeamInfo_player)
    
write_byte(player)
    
write_string(team)
    
message_end()
}




public 
writeMessage(playermessage[]) {
    
message_begin(MSG_ONEg_msgSayText, {000}, player)
    
write_byte(player)
    
write_string(message)
    
message_end()
}
/* ===================================
*[GUARDADO]*
=====================================*/
Guardar(id) {
    
adv_vault_set_start(g_vault)
    
    
adv_vault_set_field(g_vaultg_campos[CAMPO_RANGO], g_rango[id])
    
adv_vault_set_field(g_vaultg_campos[CAMPO_RANGO], g_frags[id])
    
    
adv_vault_set_end(g_vault0g_playername[id])
}

Cargar(id) {
    if(!
adv_vault_get_prepare(g_vault_g_playername[id])) 
        return
    
    
g_rango[id] = adv_vault_get_field(g_vaultg_campos[CAMPO_RANGO])
    
g_frags[id] = adv_vault_get_field(g_vaultg_campos[CAMPO_FRAG])

/* ===================================
*[STOCKS]*
=====================================*/
// stock de chatcolor
stock chatcolor(id, const input[], any:...) {
    new 
count 1players[32]; 
    static 
msg[191]; 
    
vformat(msg190input3); 
     
    
replace_all(msg190"!g""^4"); // Verde
    
replace_all(msg190"!y""^1"); // Default
    
replace_all(msg190"!t""^3"); // Color del Equipo 
     
    
if (idplayers[0] = id; else get_players(playerscount"ch"); { 
        for (new 
0counti++)  { 
            if (
is_user_connected(players[i])) { 
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]); 
                
write_byte(players[i]); 
                
write_string(msg); 
                
message_end(); 
            } 
        } 
    } 

// Stock para Saber Si el mensaje es valido
stock ValidMessage(text[], maxcount) {
    static 
lenicount
    len 
strlen(text)
    
count 0
    
    
if (!len)
        return 
false;
    
    for (
0leni++) {
        if (
text[i] != ' ') {
            
count++
            if (
count >= maxcount)
                return 
true;
        }
    }
    return 
false;



Código:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Header size:           1272 bytes
Code size:            10492 bytes
Data size:            14956 bytes
Stack/heap size:      16384 bytes; estimated max. usage=780 cells (3120 bytes)
Total requirements:   43104 bytes
Done.

Lo que hice yo fue esto
busque el sma de kikizon el que esta sin editar busque todo lo de la linea hud

y fue poner esto
Código PHP:
public HUD(taskid) {
    new 
id ID_HUD
    
    
if (!is_user_alive(id)) {
        
id pev(idpev_iuser2)
        if (!
is_user_alive(id)) return;
    }
   
    if(
id != ID_HUD) {
        
set_hudmessage(2552552550.600.6716.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"Frags: %d  ||  Rango: %s"g_frags[id], Rangos[g_rango[id]][NOMBRE])
    } else {
        
set_hudmessage(025500.00.2016.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"=======================^nFrags: %d^nRango: %s^n=======================^nSig. Rango: %s^nFrags Restantes: %d^n=======================^n%s"
        
g_frags[id], Rangos[g_rango[id]][NOMBRE], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] -  g_frags[id], Web)
    }
    



y borrar esto
Código PHP:
[id], Web
y dejarlo asi
Código PHP:
g_frags[id], Rangos[g_rango[id]][NOMBRE], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] -  g_frags[id]) 
y compilo bien xd Insecure
Zombie Plague Demolition 1.2.9
fix del sma 10%
Zombie Escape Niveles 1.0
en desarrollo
Responder
#5
(28/07/2018, 04:11 PM)RiSpEK-.S escribió: toma por si las dudas xd
Código PHP:
/*    -----------------------------------------
Creditos: Solo para Raulitop, por el hook say :3

Version Con Guardado NFVAULT
-------------------------------            */

#include <amxmisc>
#include <fakemeta>
#include <adv_vault>

new const PLUGIN[] = "Rangos CS:GO"
#define VERSION "1.0"
new const AUTHOR[] = "kikizon"

/* =============================================
|= [EMPIEZA SECCION MODIFICABLE] =|
==============================================*/
/* ====================================
*[CONSTANTES]*
=====================================*/ 
new const Prefijo[] = "!t[!yRANGOS!t]" // Prefijo en say
native jctf_get_adrenaline(id)
/* ====================================
*[CONST NOMBRES DE RANGOS]*
=====================================*/
enum _:DATA
{
    
NOMBRE[32],
    
FRAGS
}
new const 
Rangos[][DATA] = {
    { 
"Silver New"20 },
    { 
"Silver I"100 },
    { 
"Silver II"300 },
    { 
"Silver III"800 },
    { 
"Silver IV"1500 },
    { 
"Silver Elite"2500 },
    { 
"Elite I"3800 },
    { 
"Elite II"5400 },
    { 
"Elite III"7400 },
    { 
"Elite S"9750 },
    { 
"Elite Master"12450 },
    { 
"GoldNova I"15450 },
    { 
"GoldNova II"18850 },
    { 
"GoldNova III"22650 },
    { 
"GoldNova SS"26850 },
    { 
"GoldNova Master"31450 },
    { 
"MasterGuardian I"36450 },
    { 
"MasterGuardian II"41950 },
    { 
"MasterGuardian III"47950 },
    { 
"MasterGuardian S"54950 },
    { 
"MasterGuardian SS"64950 },
    { 
"MasterGuardian Elite"77950 },
    { 
"MasterGuardian Elite I"94950 },
    { 
"MasterGuardian Elite II"116950 },
    { 
"MasterGuardian Elite III"150000 },
    { 
"Master Distinguido"151000 },
    { 
"Master Distinguido SS"152000 },
    { 
"Master Distinguido SSS"180000 },
    { 
"Legendary"200000 },
    { 
"Legendary S"225000 },
    { 
"Legendary SS"255000 },
    { 
"Legendary Eagle"290000 },
    { 
"Legendary Eagle S"330000 },
    { 
"Legendary Eagle SS"340000 },
    { 
"Legendary Eagle SSS"375000 },
    { 
"Legendaty Master"425000 },
    { 
"Legendaty Master S"430000 }

}
/* =============================================
|= [TERMINA SECCION MODIFICABLE] =|
==============================================*/
/* ====================================
*[VARIABLES]*
=====================================*/
new g_rango[33], g_frags[33]
new 
SyncHUDg_maxplayersg_msgTeamInfog_msgSayTextg_playername[33][32];
#define TASK_HUD 2100
#define ID_HUD (taskid - TASK_HUD)
new g_vault

enum 
{
    
CAMPO_RANGO,
    
CAMPO_FRAG,
    
CAMPO_MAX
}
new 
g_campos[CAMPO_MAX]

/* ====================================
*[Cvars]*
=====================================*/
new cvar_Hudcvar_knifex2cvar_hsx2
/* ====================================
*[INIT]*
=====================================*/
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_event("DeathMsg""Event_DeathMsg""a")
    
register_logevent("logevent_round_end"2"1=Round_End")
    
    
register_clcmd("say""message_saytext"
    
register_clcmd("say_team""message_sayteam")
    
    
    
/* =============================================
    |= [EMPIEZA SECCION MODIFICABLE] =|
    ==============================================*/
    
cvar_Hud register_cvar("rangos_hud""1")          // 1 - Mostrar HUD | 0 - No Mostrar
    
cvar_knifex2 register_cvar("rangos_knifex2""1")    // 1 - x2 frags con knife | 0 - NO :v
    
cvar_hsx2 register_cvar("rangos_hsx2""1")        // 1 - x2 frags de HeadShot | 0 - NO :v
    /* =============================================
    |= [TERMINA SECCION MODIFICABLE] =|
    ==============================================*/
    
    
SyncHUD CreateHudSyncObj()
    
g_maxplayers get_maxplayers()
    
g_msgTeamInfo get_user_msgid("TeamInfo")
    
g_msgSayText get_user_msgid("SayText")
    
    
g_vault adv_vault_open("data_rangos"false)
    
g_campos[CAMPO_RANGO] = adv_vault_register_field(g_vault"RANGOS")
    
g_campos[CAMPO_FRAG] = adv_vault_register_field(g_vault"FRAGS")
    
adv_vault_init(g_vault)
}

/* ===================================
*[HUD]*
=====================================*/
public HUD(taskid) {
    new 
id ID_HUD
    
    
if (!is_user_alive(id)) {
        
id pev(idpev_iuser2)
        if (!
is_user_alive(id)) return;
    }
   
    if(
id != ID_HUD) {
        
set_hudmessage(2552552550.600.6716.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"Frags: %d  ||  Rango: %s"g_frags[id], Rangos[g_rango[id]][NOMBRE])
    } else {
        
set_hudmessage(025500.00.2016.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"=======================^nFrags: %d^nRango: %s^n=======================^nSig. Rango: %s^nFrags Restantes: %d^n=======================^n%s"
        
g_frags[id], Rangos[g_rango[id]][NOMBRE], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] -  g_frags[id])
    }
    

/* ==================================
    [PUTINSERVER]
===================================*/
public client_putinserver(id) {
    
get_user_nameidg_playernameid ], charsmaxg_playername[ ] ) );
    
g_rango[id] = 0
    g_frags
[id] = 0
    
    Cargar
(id)
    
    if(
get_pcvar_num(cvar_Hud)) 
        
set_task(1.0"HUD"id+TASK_HUD__"b")
}
/* ==================================
    [DISCONNECT]
===================================*/
public client_disconnect(id) {
    
Guardar(id);
        
    
remove_task(id+TASK_HUD)
}

/* ==================================
    [ROUND END]
===================================*/
public logevent_round_end() {
    for(new 
id 1id <= g_maxplayersid++)
        
Guardar(id); 
}
/* ==================================
    [DEATHMSG]
===================================*/
public Event_DeathMsg() {
    new 
attacker read_data(1)
    new 
victim read_data(2)
    new 
hs read_data(3)
    new 
weaponid get_user_weapon(attacker)
    
    if(
victim == attacker) return;
    
    if(
is_user_alive(attacker)) {
        
g_frags[attacker]++
        
        if(
get_pcvar_num(cvar_knifex2)) {
            if(
weaponid == CSW_KNIFE
                
g_frags[attacker]++
        }
        if(
get_pcvar_num(cvar_hsx2)) {
            if(
hsg_frags[attacker]++
        }
        
AumentarRango(attacker)
    }
}
/* ================================
    [UPDATE RANGO]
=================================*/
AumentarRango(id) {    
    new 
Aumento false
    
    
while(g_frags[id] >= Rangos[g_rango[id]+1][FRAGS]) {
        
Aumento true
        g_rango
[id]++
    }
        
    if(
Aumento) {
        
chatcolor(id"[%s] Felicidades subiste al rango: !g[%s]"PrefijoRangos[g_rango[id]][NOMBRE])
        
Aumento false
    
}

/*=====================================
*[SAY]*
=====================================*/
public message_saytext(id) { 
    static 
said[192
    
read_args(saidcharsmax(said)) 
    
remove_quotes(said
    
    if (
said[0] == '@' || said[0] == '%' || said[0] == '-' || said[0] == '.' || said[0] == '!' || equal (said""))
        return 
PLUGIN_HANDLED

    
if (!ValidMessage(said1)) return PLUGIN_CONTINUE;
    
    static 
color[11], name[32], alive[11]
    
get_user_team(id,color,charsmax(color))
    
get_user_name(id,name,charsmax(name))

    if (
is_user_alive (id)) {
        
alive ""
    
} else {
        
alive "[Muerto]"
    
}

    if (
is_user_admin(id)) {
        if (
get_user_flags(id) & ADMIN_KICK
            
format(saidcharsmax(said), "^x01%s^x04%s ^x03%s ^x04: %s"aliveRangos[g_rango[id]][NOMBRE], namesaid)
    } else {
        
format(saidcharsmax(said), "^x01%s^04%s ^x03%s ^x01: %s"aliveRangos[g_rango[id]][NOMBRE], namesaid)
    }
    
    static 
iteam[11
    for (
1<= g_maxplayersi++) {
        if (!
is_user_connected(i)) continue
        
get_user_name(id,name,charsmax(name))
        
        if (
is_user_admin(i) || is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) {
            
get_user_team(iteamcharsmax(team))
            
changeTeamInfo(icolor)
            
writeMessage(isaid)
            
changeTeamInfo(iteam)
        }
    }
    return 
PLUGIN_HANDLED_MAIN;
}

public 
message_sayteam(id)
{    
    static 
said[192
    
read_args(saidcharsmax(said)) 
    
remove_quotes(said
    
    if (
said[0] == '@' || said[0] == '%' || said[0] == '-' || said[0] == '.' || said[0] == '!' || equal (said""))
        return 
PLUGIN_HANDLED

    
if (!ValidMessage(said1)) return PLUGIN_CONTINUE
    
    static 
playerTeamplayerTeamName[19]
    
playerTeam get_user_team(id)
    
    switch (
playerTeam) {
        case 
1copy (playerTeamName6"TE")
        case 
2copy (playerTeamName8"CT"
        default: 
copy (playerTeamName11"SPEC"
    }

    static 
color[11], name[32], alive[11]
    
get_user_team(id,color,charsmax(color))
    
get_user_name(id,name,charsmax(name))

    if (
is_user_alive (id)) {
        
alive ""
    
} else {
        
alive "[MUERTO]"
    
}

    if (
is_user_admin(id)) {
        if (
get_user_flags(id) & ADMIN_RCON)
            
format(saidcharsmax(said), "^x01%s [ %s ] ^x04%s ^x03%s ^x04: %s"aliveplayerTeamRangos[g_rango[id]], namesaid)
    } else {
        
format(saidcharsmax(said), "^x01%s [ %s ] ^04%s ^x03%s ^x01: %s"aliveplayerTeamRangos[g_rango[id]],namesaid)
    }

    static 
iteam[11
    for (
1<= g_maxplayersi++) {
        if (!
is_user_connected(i)) continue;
        
get_user_name(id,name,charsmax(name))
        
        if (
get_user_team(i) == playerTeam || is_user_admin(i)) {
            if (
is_user_alive(id) && is_user_alive(i) || !is_user_alive(id) && !is_user_alive(i)) {
                
get_user_team(iteamcharsmax(team))
                
changeTeamInfo(icolor)
                
writeMessage(isaid)
                
changeTeamInfo(iteam)
            }
        }
    }
    return 
PLUGIN_HANDLED_MAIN;
}
public 
changeTeamInfo(playerteam[]) {
    
message_begin(MSG_ONEg_msgTeamInfo_player)
    
write_byte(player)
    
write_string(team)
    
message_end()
}




public 
writeMessage(playermessage[]) {
    
message_begin(MSG_ONEg_msgSayText, {000}, player)
    
write_byte(player)
    
write_string(message)
    
message_end()
}
/* ===================================
*[GUARDADO]*
=====================================*/
Guardar(id) {
    
adv_vault_set_start(g_vault)
    
    
adv_vault_set_field(g_vaultg_campos[CAMPO_RANGO], g_rango[id])
    
adv_vault_set_field(g_vaultg_campos[CAMPO_RANGO], g_frags[id])
    
    
adv_vault_set_end(g_vault0g_playername[id])
}

Cargar(id) {
    if(!
adv_vault_get_prepare(g_vault_g_playername[id])) 
        return
    
    
g_rango[id] = adv_vault_get_field(g_vaultg_campos[CAMPO_RANGO])
    
g_frags[id] = adv_vault_get_field(g_vaultg_campos[CAMPO_FRAG])

/* ===================================
*[STOCKS]*
=====================================*/
// stock de chatcolor
stock chatcolor(id, const input[], any:...) {
    new 
count 1players[32]; 
    static 
msg[191]; 
    
vformat(msg190input3); 
     
    
replace_all(msg190"!g""^4"); // Verde
    
replace_all(msg190"!y""^1"); // Default
    
replace_all(msg190"!t""^3"); // Color del Equipo 
     
    
if (idplayers[0] = id; else get_players(playerscount"ch"); { 
        for (new 
0counti++)  { 
            if (
is_user_connected(players[i])) { 
                
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"), _players[i]); 
                
write_byte(players[i]); 
                
write_string(msg); 
                
message_end(); 
            } 
        } 
    } 

// Stock para Saber Si el mensaje es valido
stock ValidMessage(text[], maxcount) {
    static 
lenicount
    len 
strlen(text)
    
count 0
    
    
if (!len)
        return 
false;
    
    for (
0leni++) {
        if (
text[i] != ' ') {
            
count++
            if (
count >= maxcount)
                return 
true;
        }
    }
    return 
false;



Código:
Welcome to the AMX Mod X 1.8.1-300 Compiler.
Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team

Header size:           1272 bytes
Code size:            10492 bytes
Data size:            14956 bytes
Stack/heap size:      16384 bytes; estimated max. usage=780 cells (3120 bytes)
Total requirements:   43104 bytes
Done.

Lo que hice yo fue esto
busque el sma de kikizon el que esta sin editar busque todo lo de la linea hud

y fue poner esto
Código PHP:
public HUD(taskid) {
    new 
id ID_HUD
    
    
if (!is_user_alive(id)) {
        
id pev(idpev_iuser2)
        if (!
is_user_alive(id)) return;
    }
   
    if(
id != ID_HUD) {
        
set_hudmessage(2552552550.600.6716.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"Frags: %d  ||  Rango: %s"g_frags[id], Rangos[g_rango[id]][NOMBRE])
    } else {
        
set_hudmessage(025500.00.2016.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"=======================^nFrags: %d^nRango: %s^n=======================^nSig. Rango: %s^nFrags Restantes: %d^n=======================^n%s"
        
g_frags[id], Rangos[g_rango[id]][NOMBRE], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] -  g_frags[id], Web)
    }
    



y borrar esto
Código PHP:
[id], Web
y dejarlo asi
Código PHP:
g_frags[id], Rangos[g_rango[id]][NOMBRE], Rangos[g_rango[id]+1][NOMBRE], Rangos[g_rango[id]][FRAGS] -  g_frags[id]) 
y compilo bien xd Insecure

Si vas a comentar cualquier cosa no comentes pls

Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)