RANGOS CS:GO + CHAT ADMIN
#1
Buenas tardes dejo este aporte una versión del Exclusivo sistema de rangos cs go de @kikizon2 el papu :3, se que no es una gran cosa pero apuesto que a nadie se le había ocurrido adaptarle el admin chat Whatever

Créditos:
Rangos: kikizon2
Chat admin: [R]ak

el sonido lo pueden descargar desde el post oficial https://amxmodx-es.com/Thread-Rangos-CS-GO

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

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

#include <amxmisc>
#include <fakemeta>
#include <nfvault>

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


/* =============================================
|= [EMPIEZA SECCION MODIFICABLE] =|
==============================================*/
/* ====================================
*[CONSTANTES]*
=====================================*/ 
//new const Web[] = "AMXMODX-ES.COM"  // Se Muestra en HUD
new const Prefijo[] = "!g[AMXMODX-ES.COM]!y" // Prefijo en say
new const Sonido[] = "rango/up.wav" // Sonido Rango UP

new Flags;
new 
g_AdminTag[33][10]

enum _:Data2 {
    
TAG[10],
    
FLAG
}

new const 
AdminsTags[][Data2] = {
    { 
"[OWNER]"ADMIN_RCON },
    { 
"[VIP]"ADMIN_IMMUNITY },
    { 
"[ADMIN]"ADMIN_KICK }
}
/* ====================================
*[CONST NOMBRES DE RANGOS]*
=====================================*/
enum _:DATA
{
    
NOMBRE[30],
    
FRAGS
}
new const 
Rangos[][DATA] = {
    { 
"Sin Rango"100 },
    { 
"Silver I"200 },
    { 
"Silver II"300 },
    { 
"Silver III"500 },
    { 
"Silver IV"700 },
    { 
"Silver Elite"800 },
    { 
"Silver Elite Master"900 },
    { 
"Gold Nova I"1000 },
    { 
"Gold Nova II"1200 },
    { 
"Gold Nova III"1300 },
    { 
"Gold Nova Master"1400 },
    { 
"Master Guardian I",1500 },
    { 
"Master Guardian II"1700 },
    { 
"Master Guardian Elite"1800 },
    { 
"Distinguished Master Guardian"1900 },
    { 
"Legendary Eagle"2000 },
    { 
"Legendary Eagle Master"2100 },
    { 
"Supreme Master First Class"2200 },
    { 
"The Global Elite"2500 },
         { 
""99999 //fix
}


/* =============================================
|= [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)
#define XD is_user_connected(id) || !is_user_bot(id) || !is_user_hltv(id)
new VaultRango[128], szRangos[180], szKey[30]

/* ====================================
*[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 - ÑO :v
    
cvar_hsx2 register_cvar("rangos_hsx2""1")        // 1 - x2 frags de HeadShot | 0 - ÑO :v
    /* =============================================
    |= [TERMINA SECCION MODIFICABLE] =|
    ==============================================*/
    
    
    
SyncHUD CreateHudSyncObj()
    
g_maxplayers get_maxplayers()
    
g_msgTeamInfo get_user_msgid("TeamInfo")
    
g_msgSayText get_user_msgid("SayText")
    
    
nfv_file("Ranguitos"VaultRangocharsmax(VaultRango))
}
/* ====================================
*[PRECACHE]*
=====================================*/
public plugin_precache() 
    
precache_sound(Sonido)
/* ===================================
*[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(255000.00.2006.01.0)
        
ShowSyncHudMsg(ID_HUDSyncHUD"Frags: %d^nRango: %s^nSig. Rango: %s^nFrags Restantes: %d"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")
    if(!
is_user_admin(id)) {
        
copy(g_AdminTag[id], charsmax(g_AdminTag[]), "")
        return
    }
        
    
Flags get_user_flagsid );
    
    for(new 
isizeof AdminsTagsi++) {
        if(
Flags AdminsTags[i][FLAG]) {
            
copy(g_AdminTag[id], charsmax(g_AdminTag[]), AdminsTags[i][TAG])
            break;
        }
    }
}
/* ==================================
    [DISCONNECT]
===================================*/
public client_disconnect(id) {
    if(
XDGuardar(id);
        
    
remove_task(id+TASK_HUD)
}

/* ==================================
    [ROUND END]
===================================*/
public logevent_round_end() {
    for(new 
id 1id <= g_maxplayersid++) {
        if(
XD
            
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]][FRAGS]) {
        
Aumento true
        g_rango
[id]++
    }
        
    if(
Aumento) {
        
chatcolor(id"%s Felicidades subiste al rango: !g[ %s ]"PrefijoRangos[g_rango[id]][NOMBRE])
        
client_cmd(id"spk %s"Sonido)
        
Aumento false
    
}

/*=====================================
*[SAY]*
=====================================*/
public message_saytext(id) { 
    static 
said[192
    
read_args(saidcharsmax(said)) 
    
remove_quotes(said
    
    if (
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)) 
            
format(saidcharsmax(said), "^x01%s (^x04 %s^x01 )^x04 %s^x01-> ^x03 %s ^x01: %s"aliveRangos[g_rango[id]][NOMBRE], g_AdminTag[id], namesaid)
    } else 
    {
        
format(saidcharsmax(said), "^x01%s (^x04 %s^x01 ) ^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] == '!' || 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))
            
format(saidcharsmax(said), "^x01%s [^x04%s^x01  ] (^x04 %s^x01 )^x04 %s^x01-> ^x03 %s ^x01: %s"aliveplayerTeamRangos[g_rango[id]], g_AdminTag[id], namesaid)
    } else {
        
format(saidcharsmax(said), "^x01%s [^x04%s^x01  ] (^x04 %s^x01 )^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) {
    
formatex(szKeycharsmax(szKey), "data_rangos"
    
formatex(szRangoscharsmax(szRangos), "%d %d"g_frags[id], g_rango[id])
    
    
nfv_set_data(VaultRangoszKeyg_playername[id], szRangos)
}

Cargar(id) {
    new 
g_load_c1[25], g_load_c2[25]
    
formatex(szKeycharsmax(szKey), "data_rangos"
    
    if(!
nfv_get_data(VaultRangoszKeyg_playername[id], szRangossizeof(szRangos) - 1)) return; 
   
    
parse(szRangosg_load_c1charsmax(g_load_c1), g_load_c2charsmax(g_load_c2))
    
    
g_frags[id] = str_to_num(g_load_c1)
    
g_rango[id] = str_to_num(g_load_c2)

/* ===================================
*[STOCKS]*
=====================================*/
// stock de chatcolor
stock chatcolorid, const input[], any:... )
{
    static 
szMsg191 ], msgSayText;
    
    if( !
msgSayText )
        
msgSayText get_user_msgid"SayText" );
    
    
vformatszMsg190input);

    
replace_allszMsg190"!g""^4" );
    
replace_allszMsg190"!y""^1" );
    
replace_allszMsg190"!t""^3" );
    
    
message_beginid MSG_ONE_UNRELIABLE MSG_BROADCASTmsgSayText, .player id );
    
write_byteid id 33 );
    
write_stringszMsg );
    
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;


hay un error que da en la linea 162 pero de igual manera funciona Genius
Crab trabaja en silencio y deja que tu exito haga todo el ruido Crab
Responder
#2
Aportas algo con códigos de otros y con un error? Oh god why
Valoro tú esfuerzo, a algún usuario le irá a servir.. Nothingdohere

Edit: arregla estas dos cosas..

Código PHP:
new Flags get_user_flags(id)
// -->
new Flags;
Flags get_user_flagsid ); 

Código PHP:
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 chatcolorid, const input[], any:... )
{
    static 
szMsg191 ], msgSayText;
    
    if( !
msgSayText )
        
msgSayText get_user_msgid"SayText" );
    
    
vformatszMsg190input);

    
replace_allszMsg190"!g""^4" );
    
replace_allszMsg190"!y""^1" );
    
replace_allszMsg190"!t""^3" );
    
    
message_beginid MSG_ONE_UNRELIABLE MSG_BROADCASTmsgSayText, .player id );
    
write_byteid id 33 );
    
write_stringszMsg );
    
message_end( );


Responder
#3
Dafuq

Es el mismo código original del que está en el tema de kikizon
Código PHP:
/*    -----------------------------------------
Creditos: Solo para Raulitop, por el hook say :3

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

#include <amxmisc>
#include <fakemeta>
#include <nfvault>

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

/* =============================================
|= [EMPIEZA SECCION MODIFICABLE] =|
==============================================*/
/* ====================================
*[CONSTANTES]*
=====================================*/ 
new const Web[] = "AMXMODX-ES.COM"  // Se Muestra en HUD
new const Prefijo[] = "!g[RANGOS]!y" // Prefijo en say
new const Sonido[] = "rango/up.wav" // Sonido Rango UP
/* ====================================
*[CONST NOMBRES DE RANGOS]*
=====================================*/
enum _:DATA
{
    
NOMBRE[30],
    
FRAGS
}
new const 
Rangos[][DATA] = {
    { 
"Sin Rango"100 },
    { 
"Silver I"200 },
    { 
"Silver II"300 },
    { 
"Silver III"500 },
    { 
"Silver IV"700 },
    { 
"Silver Elite"800 },
    { 
"Silver Elite Master"900 },
    { 
"Gold Nova I"1000 },
    { 
"Gold Nova II"1200 },
    { 
"Gold Nova III"1300 },
    { 
"Gold Nova Master"1400 },
    { 
"Master Guardian I",1500 },
    { 
"Master Guardian II"1700 },
    { 
"Master Guardian Elite"1800 },
    { 
"Distinguished Master Guardian"1900 },
    { 
"Legendary Eagle"2000 },
    { 
"Legendary Eagle Master"2100 },
    { 
"Supreme Master First Class"2200 },
    { 
"The Global Elite"2500 }
}

/* =============================================
|= [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)
#define XD is_user_connected(id) || !is_user_bot(id) || !is_user_hltv(id)
new VaultRango[128], szRangos[180], szKey[30]

/* ====================================
*[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 - ÑO :v
    
cvar_hsx2 register_cvar("rangos_hsx2""1")        // 1 - x2 frags de HeadShot | 0 - ÑO :v
    /* =============================================
    |= [TERMINA SECCION MODIFICABLE] =|
    ==============================================*/
    
    
    
SyncHUD CreateHudSyncObj()
    
g_maxplayers get_maxplayers()
    
g_msgTeamInfo get_user_msgid("TeamInfo")
    
g_msgSayText get_user_msgid("SayText")
    
    
nfv_file("Ranguitos"VaultRangocharsmax(VaultRango))
}
/* ====================================
*[PRECACHE]*
=====================================*/
public plugin_precache() 
    
precache_sound(Sonido)
/* ===================================
*[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], Web)
    }
    

/* ==================================
    [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) {
    if(
XDGuardar(id);
        
    
remove_task(id+TASK_HUD)
}

/* ==================================
    [ROUND END]
===================================*/
public logevent_round_end() {
    for(new 
id 1id <= g_maxplayersid++) {
        if(
XD
            
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]][FRAGS]) {
        
Aumento true
        g_rango
[id]++
    }
        
    if(
Aumento) {
        
chatcolor(id"%s Felicidades subiste al rango: !g[ %s ]"PrefijoRangos[g_rango[id]][NOMBRE])
        
client_cmd(id"spk %s"Sonido)
        
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) {
    
formatex(szKeycharsmax(szKey), "data_rangos"
    
formatex(szRangoscharsmax(szRangos), "%d %d"g_frags[id], g_rango[id])
    
    
nfv_set_data(VaultRangoszKeyg_playername[id], szRangos)
}

Cargar(id) {
    new 
g_load_c1[25], g_load_c2[25]
    
formatex(szKeycharsmax(szKey), "data_rangos"
    
    if(!
nfv_get_data(VaultRangoszKeyg_playername[id], szRangossizeof(szRangos) - 1)) return; 
   
    
parse(szRangosg_load_c1charsmax(g_load_c1), g_load_c2charsmax(g_load_c2))
    
    
g_frags[id] = str_to_num(g_load_c1)
    
g_rango[id] = str_to_num(g_load_c2)

/* ===================================
*[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;


https://amxmodx-es.com/Thread-Rangos-CS-GO
[Imagen: b_350_20_323957_202743_f19a15_111111.png]

Estudia siempre; el tiempo es oro, lo material se puede recuperar pero el tiempo no se puede recuperar.
(02/10/2016, 05:05 PM)meTaLiCroSS escribió: Siempre me gusta ayudar cuando alguien esta interesado realmente en ver que esta programando.
(08/08/2019, 05:32 PM)meTaLiCroSS escribió: grax x el dato cr4ck


Mis aportes

PLUGINS
MAPAS
Menú LANG [SF] Sistema de Frags
Say System (Admin Prefix)
Responder
#4
lo siento anda borracho ayer
Crab trabaja en silencio y deja que tu exito haga todo el ruido Crab
Responder
#5
(01/06/2016, 11:43 PM)Madara escribió:
(01/06/2016, 11:40 PM)totopizza escribió: Dafuq

Es el mismo código original del que está en el tema de kikizon
Código PHP:
/*    -----------------------------------------
Creditos: Solo para Raulitop, por el hook say :3

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

#include <amxmisc>
#include <fakemeta>
#include <nfvault>

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

/* =============================================
|= [EMPIEZA SECCION MODIFICABLE] =|
==============================================*/
/* ====================================
*[CONSTANTES]*
=====================================*/ 
new const Web[] = "AMXMODX-ES.COM"  // Se Muestra en HUD
new const Prefijo[] = "!g[RANGOS]!y" // Prefijo en say
new const Sonido[] = "rango/up.wav" // Sonido Rango UP
/* ====================================
*[CONST NOMBRES DE RANGOS]*
=====================================*/
enum _:DATA
{
    
NOMBRE[30],
    
FRAGS
}
new const 
Rangos[][DATA] = {
    { 
"Sin Rango"100 },
    { 
"Silver I"200 },
    { 
"Silver II"300 },
    { 
"Silver III"500 },
    { 
"Silver IV"700 },
    { 
"Silver Elite"800 },
    { 
"Silver Elite Master"900 },
    { 
"Gold Nova I"1000 },
    { 
"Gold Nova II"1200 },
    { 
"Gold Nova III"1300 },
    { 
"Gold Nova Master"1400 },
    { 
"Master Guardian I",1500 },
    { 
"Master Guardian II"1700 },
    { 
"Master Guardian Elite"1800 },
    { 
"Distinguished Master Guardian"1900 },
    { 
"Legendary Eagle"2000 },
    { 
"Legendary Eagle Master"2100 },
    { 
"Supreme Master First Class"2200 },
    { 
"The Global Elite"2500 }
}

/* =============================================
|= [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)
#define XD is_user_connected(id) || !is_user_bot(id) || !is_user_hltv(id)
new VaultRango[128], szRangos[180], szKey[30]

/* ====================================
*[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 - ÑO :v
    
cvar_hsx2 register_cvar("rangos_hsx2""1")        // 1 - x2 frags de HeadShot | 0 - ÑO :v
    /* =============================================
    |= [TERMINA SECCION MODIFICABLE] =|
    ==============================================*/
    
    
    
SyncHUD CreateHudSyncObj()
    
g_maxplayers get_maxplayers()
    
g_msgTeamInfo get_user_msgid("TeamInfo")
    
g_msgSayText get_user_msgid("SayText")
    
    
nfv_file("Ranguitos"VaultRangocharsmax(VaultRango))
}
/* ====================================
*[PRECACHE]*
=====================================*/
public plugin_precache() 
    
precache_sound(Sonido)
/* ===================================
*[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], Web)
    }
    

/* ==================================
    [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) {
    if(
XDGuardar(id);
        
    
remove_task(id+TASK_HUD)
}

/* ==================================
    [ROUND END]
===================================*/
public logevent_round_end() {
    for(new 
id 1id <= g_maxplayersid++) {
        if(
XD
            
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]][FRAGS]) {
        
Aumento true
        g_rango
[id]++
    }
        
    if(
Aumento) {
        
chatcolor(id"%s Felicidades subiste al rango: !g[ %s ]"PrefijoRangos[g_rango[id]][NOMBRE])
        
client_cmd(id"spk %s"Sonido)
        
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) {
    
formatex(szKeycharsmax(szKey), "data_rangos"
    
formatex(szRangoscharsmax(szRangos), "%d %d"g_frags[id], g_rango[id])
    
    
nfv_set_data(VaultRangoszKeyg_playername[id], szRangos)
}

Cargar(id) {
    new 
g_load_c1[25], g_load_c2[25]
    
formatex(szKeycharsmax(szKey), "data_rangos"
    
    if(!
nfv_get_data(VaultRangoszKeyg_playername[id], szRangossizeof(szRangos) - 1)) return; 
   
    
parse(szRangosg_load_c1charsmax(g_load_c1), g_load_c2charsmax(g_load_c2))
    
    
g_frags[id] = str_to_num(g_load_c1)
    
g_rango[id] = str_to_num(g_load_c2)

/* ===================================
*[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;


https://amxmodx-es.com/Thread-Rangos-CS-GO

jajaja si pero en el del , el admin escribe en verde y esas cosas pero no saben si es admin o no por eso se me ocurrió ponerle un prefijo que lo identifique aunq no quedo del todo bien pero bue A ysi

Arreglá lo que te dije..

Responder
#6
Además esto está mal...
Código PHP:
if (get_user_flags(id)) 
->
Código PHP:
if (get_user_flags(id) & ADMIN_KICK
[Imagen: b_350_20_323957_202743_f19a15_111111.png]

Estudia siempre; el tiempo es oro, lo material se puede recuperar pero el tiempo no se puede recuperar.
(02/10/2016, 05:05 PM)meTaLiCroSS escribió: Siempre me gusta ayudar cuando alguien esta interesado realmente en ver que esta programando.
(08/08/2019, 05:32 PM)meTaLiCroSS escribió: grax x el dato cr4ck


Mis aportes

PLUGINS
MAPAS
Menú LANG [SF] Sistema de Frags
Say System (Admin Prefix)
Responder
#7
soy un borrachito
Crab trabaja en silencio y deja que tu exito haga todo el ruido Crab
Responder
#8
(02/06/2016, 12:06 AM)Madara escribió:
(01/06/2016, 11:50 PM)totopizza escribió: Además esto está mal...
Código PHP:
if (get_user_flags(id)) 
->
Código PHP:
if (get_user_flags(id) & ADMIN_KICK

rey eso lo quite para hacer esto

Código PHP:
}

    if (
is_user_admin(id)) {
        if (
get_user_flags(id)) 
            
format(saidcharsmax(said), "^x01%s (^x04 %s^x01 )^x04 %s^x01-> ^x03 %s ^x01: %s"aliveRangos[g_rango[id]][NOMBRE], g_AdminTag[id], namesaid)
    } 

Código PHP:
g_AdminTag[id
llama esto

Código PHP:
new g_AdminTag[33][10]

enum _:Data2 {
    
TAG[10],
    
FLAG
}

new const 
AdminsTags[][Data2] = {
    { 
"[OWNER]"ADMIN_RCON },
    { 
"[VIP]"ADMIN_IMMUNITY },
    { 
"[ADMIN]"ADMIN_KICK }


en public client_putinserver(id)
Código PHP:
Flags get_user_flagsid ); 

    for(new 
isizeof AdminsTagsi++) {
        if(
Flags AdminsTags[i][FLAG]) {
            
copy(g_AdminTag[id], charsmax(g_AdminTag[]), AdminsTags[i][TAG])
            break;
        }
    }



NO entiendo porq dices que esta mal Dafuq Gracias Skylar ya lo arreglo Excitedeyes

Oh god why
Responder
#9
+100 prro >pacman Oh god why
[Imagen: zcsztw-4.png] [Imagen: 6u5fj2-4.png]
[Imagen: linkedin_thumb_image.png][Imagen: 76561198283253977.png][Imagen: linkedin_thumb_image.png]
Responder
#10
minimo hubieras mejorado el sistema :V
[Imagen: bvpq9q-6.png]

NO DOY AYUDA VIA MENSAJE PRIVADO

* Si requieres algún servicio de pago puedes contactarme vía MP o en mi facebook
Responder
#11
ME LO PASAN COPILADO X FAVOR?!!!!!!!!!!!!!

Cutecry
Responder
#12
(12/02/2017, 12:15 PM)viking escribió: ME LO PASAN COPILADO X FAVOR?!!!!!!!!!!!!!

Cutecry

Que error te tira?
Aprendiendo 5%Proud
Responder
#13
em como que a nadie se le abria ocurrido? jajaj es un simple hooksay Genius
nada nuevo GeniusWhatever
Nothingdohere <===| Aprendiendo Con Cada Momento |===> Nothingdohere
<==| Aportes |==>
Sistema de Carnages + Menu para Mandarlos
Responder
#14
LISTO. esta muy bueno.
Responder
#15
En fin, cual esta en buen funcionamiento? estoy algo confundidoxd
Responder
#16
WhateverTrolleyesRainbowNothingdohere
Responder


Salto de foro:


Usuarios navegando en este tema: 2 invitado(s)