Hola Como Hago para ponerle models a cada Rango [SOLUCIONADO]
#1
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 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[32],
    
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)
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)
}
/* ====================================
*[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) {
    
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]][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) {
    
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;

Cita: Kikizon2 Dijo :
Lo que deberian de aprender es a escribir, parece que escriben con el escroto en la mano.
Responder
#2
model de player o de armas
Responder
#3
(29/09/2018, 03:18 PM)La Renga Mk escribió: model de player o de armas
[/quo]

Las 2 cosas Osea solo quiero intentarlo x mi mismo xd y si no puedo Pos ni modo xd Claro siempre acepto ayuda

[quote='La Renga Mk' pid='189287' dateline='1538245130']
model de player o de armas

Las 2 cosas Osea solo quiero intentarlo x mi mismo xd y si no puedo Pos ni modo xd Claro siempre acepto ayuda
Cita: Kikizon2 Dijo :
Lo que deberian de aprender es a escribir, parece que escriben con el escroto en la mano.
Responder
#4
Código PHP:
new const g_model_rango[][] = {
    
"model_1",
    
"model_2",
    
"model_3"


Código PHP:
public plugin_precache()
{
    static 
i;
    for(
0sizeof(g_model_rango); ++iprecache_player_model(g_model_rango[i]);


Código PHP:
stock precache_player_model(const modelname[]) 

    static 
longname[128]
    
formatex(longnamecharsmax(longname), "models/player/%s/%s.mdl"modelnamemodelname
    
precache_model(longname
    
    
copy(longname[strlen(longname)-4], charsmax(longname) - (strlen(longname)-4), "T.mdl"
    if (
file_exists(longname)) precache_model(longname


#include <cs_player_models_api>
Código PHP:
cs_set_player_model(idg_model_rango[g_rango[id]]) 

#include <cstrike>
Código PHP:
cs_set_user_model(idg_model_rango[g_rango[id]]) 
Responder
#5
renga no es cstrike ?
[Imagen: b_350_20_323957_202743_f19a15_111111.png]

(18/11/2014, 05:47 PM)Neeeeeeeeeel.- escribió: Por qué necesitan una guía para todo? Meté mano y que salga lo que salga... es la mejor forma de aprender.

(16/05/2016, 11:08 PM)kikizon2 escribió: No cabe duda que tienen mierda en vez de cerebro, par de pendejos v:
Responder
#6
(29/09/2018, 07:15 PM)OsweRRR escribió: renga no es cstrike ?

Sonrisa tenes todo la rason era cs_set_player_model a hora lo modifico

edito este post para no crear otro

Código PHP:
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])


--->

Código PHP:
adv_vault_set_field(g_vaultg_campos[CAMPO_FRAG], g_frags[id]) 
Responder
#7
(29/09/2018, 07:33 PM)La Renga Mk escribió:
(29/09/2018, 07:15 PM)OsweRRR escribió: renga no es cstrike ?

Sonrisa tenes todo la rason era cs_set_player_model a hora lo modifico

edito este post para no crear otro

Código PHP:
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])


--->

Código PHP:
adv_vault_set_field(g_vaultg_campos[CAMPO_FRAG], g_frags[id]) 



Hola Esta que dando Haci tu me dices si voy mal y que debo Hacer

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

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

#include <amxmisc>
#include <fakemeta>
#include <adv_vault>
#include <cs_player_models_api>
#include <cstrike>

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[32],
    
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 }
}

new const 
g_model_rango[][] = {
    
"model_1",
    
"model_2",
    
"model_3"


public 
plugin_precache()
{
    static 
i;
    for(
0sizeof(g_model_rango); ++iprecache_player_model(g_model_rango[i]);


stock precache_player_model(const modelname[]) 

    static 
longname[128]
    
formatex(longnamecharsmax(longname), "models/player/%s/%s.mdl"modelnamemodelname
    
precache_model(longname
    
    
copy(longname[strlen(longname)-4], charsmax(longname) - (strlen(longname)-4), "T.mdl"
    if (
file_exists(longname)) precache_model(longname


/* =============================================
|= [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)
}
/* ====================================
*[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) {
    
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]][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) {
    
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_FRAG], 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;


(29/09/2018, 07:33 PM)La Renga Mk escribió:
(29/09/2018, 07:15 PM)OsweRRR escribió: renga no es cstrike ?

Sonrisa tenes todo la rason era cs_set_player_model a hora lo modifico

edito este post para no crear otro

Código PHP:
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])


--->

Código PHP:
adv_vault_set_field(g_vaultg_campos[CAMPO_FRAG], g_frags[id]) 


Me sale este error Solucion?


Archivos adjuntos Miniatura(s)
   
Cita: Kikizon2 Dijo :
Lo que deberian de aprender es a escribir, parece que escriben con el escroto en la mano.
Responder
#8
(30/09/2018, 01:48 PM)KevinJesus escribió:
Código PHP:
/*    -----------------------------------------
Creditos: Solo para Raulitop, por el hook say :3

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

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

// aka usa 1 solo el que mas te guste yo uso la api como vos quieras 
#include <cs_player_models_api> 
#include <cstrike> 

/*
cs_set_player_model(id, g_model_rango[g_rango[id]]) 

se lo agregas en esta parte (AumentarRango) para cuando sube de rango le das el model */ 

con el error que te sale es porque tenes 2 plugin_precache

tiene que ser 1 solo

algo asi
Código PHP:
public plugin_precache()
{
    
precache_sound(Sonido);

    static 
i;
    for(
0sizeof(g_model_rango); ++iprecache_player_model(g_model_rango[i]);


Código PHP:
stock precache_player_model(const modelname[]) 

    static 
longname[128]
    
formatex(longnamecharsmax(longname), "models/player/%s/%s.mdl"modelnamemodelname
    
precache_model(longname
    
    
copy(longname[strlen(longname)-4], charsmax(longname) - (strlen(longname)-4), "T.mdl"
    if (
file_exists(longname)) precache_model(longname


ponelo en la parte

Código PHP:
/* ===================================
*[STOCKS]*
=====================================*/ 
Responder
#9
(30/09/2018, 02:03 PM)La Renga Mk escribió:
(30/09/2018, 01:48 PM)KevinJesus escribió:
Código PHP:
/*    -----------------------------------------
Creditos: Solo para Raulitop, por el hook say :3

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

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

// aka usa 1 solo el que mas te guste yo uso la api como vos quieras 
#include <cs_player_models_api> 
#include <cstrike> 

/*
cs_set_player_model(id, g_model_rango[g_rango[id]]) 

se lo agregas en esta parte (AumentarRango) para cuando sube de rango le das el model */ 

con el error que te sale es porque tenes 2 plugin_precache

tiene que ser 1 solo

algo asi
Código PHP:
public plugin_precache()
{
    
precache_sound(Sonido);

    static 
i;
    for(
0sizeof(g_model_rango); ++iprecache_player_model(g_model_rango[i]);


Código PHP:
stock precache_player_model(const modelname[]) 

    static 
longname[128]
    
formatex(longnamecharsmax(longname), "models/player/%s/%s.mdl"modelnamemodelname
    
precache_model(longname
    
    
copy(longname[strlen(longname)-4], charsmax(longname) - (strlen(longname)-4), "T.mdl"
    if (
file_exists(longname)) precache_model(longname


ponelo en la parte

Código PHP:
/* ===================================
*[STOCKS]*
=====================================*/ 

Listo Fue algo Dificil para mi que no se Pero creo que ya quedo Mira haber y me dices si encuentras algun bug o algo

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

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

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

//
#include <cs_player_models_api> 


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[32],
    
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 }
}
new const 
g_model_rango[][] = {
    
"model_1",
    
"model_2",
    
"model_3"


/* =============================================
|= [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)
}
/* ====================================
*[PRECACHE]*
=====================================*/
public plugin_precache()
{
    
precache_sound(Sonido);

    static 
i;
    for(
0sizeof(g_model_rango); ++iprecache_player_model(g_model_rango[i]);


/* ===================================
*[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) {
    
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]][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) {
    
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_FRAG], 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 precache_player_model(const modelname[]) 

    static 
longname[128]
    
formatex(longnamecharsmax(longname), "models/player/%s/%s.mdl"modelnamemodelname
    
precache_model(longname
    
    
copy(longname[strlen(longname)-4], charsmax(longname) - (strlen(longname)-4), "T.mdl"
    if (
file_exists(longname)) precache_model(longname


// 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;



(30/09/2018, 02:03 PM)La Renga Mk escribió:
(30/09/2018, 01:48 PM)KevinJesus escribió:
Código PHP:
/*    -----------------------------------------
Creditos: Solo para Raulitop, por el hook say :3

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

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

// aka usa 1 solo el que mas te guste yo uso la api como vos quieras 
#include <cs_player_models_api> 
#include <cstrike> 

/*
cs_set_player_model(id, g_model_rango[g_rango[id]]) 

se lo agregas en esta parte (AumentarRango) para cuando sube de rango le das el model */ 

con el error que te sale es porque tenes 2 plugin_precache

tiene que ser 1 solo

algo asi
Código PHP:
public plugin_precache()
{
    
precache_sound(Sonido);

    static 
i;
    for(
0sizeof(g_model_rango); ++iprecache_player_model(g_model_rango[i]);


Código PHP:
stock precache_player_model(const modelname[]) 

    static 
longname[128]
    
formatex(longnamecharsmax(longname), "models/player/%s/%s.mdl"modelnamemodelname
    
precache_model(longname
    
    
copy(longname[strlen(longname)-4], charsmax(longname) - (strlen(longname)-4), "T.mdl"
    if (
file_exists(longname)) precache_model(longname


ponelo en la parte

Código PHP:
/* ===================================
*[STOCKS]*
=====================================*/ 

Eso es para Ponerle Los models a los Player o alas Armas?
Cita: Kikizon2 Dijo :
Lo que deberian de aprender es a escribir, parece que escriben con el escroto en la mano.
Responder
#10
ES PARA LOS MODEL DE PLAYER

le tenes que dar el model cuando sube de rango
algo asi
Código PHP:
/* ================================
    [UPDATE RANGO]
=================================*/
AumentarRango(id) {    
    new 
Aumento false
    
    
while(g_frags[id] >= Rangos[g_rango[id]][FRAGS]) {
        
Aumento true
        g_rango
[id]++
        
cs_set_player_model(idg_model_rango[g_rango[id]]) // #include <cs_player_models_api>
        //cs_set_user_model(id, g_model_rango[g_rango[id]]) // #include <cstrike>
    
}
        
    if(
Aumento) {
        
chatcolor(id"%s Felicidades subiste al rango: !g[ %s ]"PrefijoRangos[g_rango[id]][NOMBRE])
        
client_cmd(id"spk %s"Sonido)
        
Aumento false
    
}

Responder
#11
(30/09/2018, 02:51 PM)La Renga Mk escribió: ES PARA LOS MODEL DE PLAYER

le tenes que dar el model cuando sube de rango
algo asi
Código PHP:
/* ================================
    [UPDATE RANGO]
=================================*/
AumentarRango(id) {    
    new 
Aumento false
    
    
while(g_frags[id] >= Rangos[g_rango[id]][FRAGS]) {
        
Aumento true
        g_rango
[id]++
        
cs_set_player_model(idg_model_rango[g_rango[id]]) // #include <cs_player_models_api>
        //cs_set_user_model(id, g_model_rango[g_rango[id]]) // #include <cstrike>
    
}
        
    if(
Aumento) {
        
chatcolor(id"%s Felicidades subiste al rango: !g[ %s ]"PrefijoRangos[g_rango[id]][NOMBRE])
        
client_cmd(id"spk %s"Sonido)
        
Aumento false
    
}



Listo Pero Ahora me sale que no funciona en mi cs Solucion?


Archivos adjuntos Miniatura(s)
   
Cita: Kikizon2 Dijo :
Lo que deberian de aprender es a escribir, parece que escriben con el escroto en la mano.
Responder
#12
Código PHP:
new const g_model_rango[][] = {
    
"model_1",
    
"model_2",
    
"model_3"


Te vas a model / player / y creas una carpeta model_1 / y el model se tiene que llamar igual que la carpeta model_1.mdl

EL QUE VOS POSTIASTE AKA https://amxmodx-es.com/Thread-Hola-Como-...#pid189315

solo le agregue cs_set_player_model(id, g_model_rango[g_rango[id]])

y mate unos bot y me dio el model para que lo pruebes ponele menos rango 2, 5, 8 y yo uso /cam para ver el personaje

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

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

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

//
#include <cs_player_models_api> 


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[32],
    
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 }
}
new const 
g_model_rango[][] = {
    
"model_1",
    
"model_2",
    
"model_3"


/* =============================================
|= [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)
}
/* ====================================
*[PRECACHE]*
=====================================*/
public plugin_precache()
{
    
precache_sound(Sonido);

    static 
i;
    for(
0sizeof(g_model_rango); ++iprecache_player_model(g_model_rango[i]);


/* ===================================
*[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) {
    
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]][FRAGS]) {
        
Aumento true
        g_rango
[id]++
        
cs_set_player_model(idg_model_rango[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) {
    
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_FRAG], 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 precache_player_model(const modelname[]) 

    static 
longname[128]
    
formatex(longnamecharsmax(longname), "models/player/%s/%s.mdl"modelnamemodelname
    
precache_model(longname
    
    
copy(longname[strlen(longname)-4], charsmax(longname) - (strlen(longname)-4), "T.mdl"
    if (
file_exists(longname)) precache_model(longname


// 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
#13
(30/09/2018, 03:04 PM)La Renga Mk escribió:
Código PHP:
new const g_model_rango[][] = {
    
"model_1",
    
"model_2",
    
"model_3"


Te vas a model / player / y creas una carpeta model_1 / y el model se tiene que llamar igual que la carpeta model_1.mdl

EL QUE VOS POSTIASTE AKA https://amxmodx-es.com/Thread-Hola-Como-...#pid189315

solo le agregue cs_set_player_model(id, g_model_rango[g_rango[id]])

y mate unos bot y me dio el model para que lo pruebes ponele menos rango 2, 5, 8 y yo uso /cam para ver el personaje

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

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

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

//
#include <cs_player_models_api> 


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[32],
    
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 }
}
new const 
g_model_rango[][] = {
    
"model_1",
    
"model_2",
    
"model_3"


/* =============================================
|= [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)
}
/* ====================================
*[PRECACHE]*
=====================================*/
public plugin_precache()
{
    
precache_sound(Sonido);

    static 
i;
    for(
0sizeof(g_model_rango); ++iprecache_player_model(g_model_rango[i]);


/* ===================================
*[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) {
    
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]][FRAGS]) {
        
Aumento true
        g_rango
[id]++
        
cs_set_player_model(idg_model_rango[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) {
    
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_FRAG], 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 precache_player_model(const modelname[]) 

    static 
longname[128]
    
formatex(longnamecharsmax(longname), "models/player/%s/%s.mdl"modelnamemodelname
    
precache_model(longname
    
    
copy(longname[strlen(longname)-4], charsmax(longname) - (strlen(longname)-4), "T.mdl"
    if (
file_exists(longname)) precache_model(longname


// 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;


Listo ya cree las carpetas y puse el code que me pasaste pero me sigue dando error y ya cree las carpetas Con los models de cada uno


Archivos adjuntos Miniatura(s)
       
Cita: Kikizon2 Dijo :
Lo que deberian de aprender es a escribir, parece que escriben con el escroto en la mano.
Responder
#14
\cstrike\addons\amxmodx\logs

borra todo lo que tenga dentro y renicia el servidor para ver que error te sale
Responder
#15
(30/09/2018, 03:30 PM)La Renga Mk escribió: \cstrike\addons\amxmodx\logs

borra todo lo que tenga dentro y renicia el servidor para ver que error te sale

Borre todo lo de logs y volvio a salir el archivo txt, Esto es lo que sale en el txt y Sale error todabia en el sv
Código PHP:
09/30/2018 14:32:11: [admincmd.amxxCmd"Gato.!<1><STEAM_ID_LAN><>" changelevel "cs_assault"
09/30/2018 14:32:14: -------- Mapchange to cs_assault --------
09/30/2018 14:32:14: [AMXXPlugin "RangosCTF.amxx" failed to loadModule/Library "cs_player_models_api" required for plugin.  Check modules.ini.
09/30/2018 14:32:15: [admin.amxxLogin"Gato.!<1><STEAM_ID_LAN><>" became an admin (account "loopback") (access "abcdefghijklmnopqrstu") (address "loopback")
09/30/2018 14:32:16: [admin.amxxLogin"Gato.!<1><STEAM_ID_LAN><>" became an admin (account "loopback") (access "abcdefghijklmnopqrstu") (address "loopback"
Cita: Kikizon2 Dijo :
Lo que deberian de aprender es a escribir, parece que escriben con el escroto en la mano.
Responder
#16
Cita:L 09/30/2018 - 14:32:14: [AMXX] Plugin "RangosCTF.amxx" failed to load: Module/Library "cs_player_models_api" required for plugin. Check modules.ini.

tenes que agregar la api

esto va en plugins.ini
Cita:cs_player_models_api.amxx
Responder
#17
(30/09/2018, 03:36 PM)La Renga Mk escribió:
Cita:L 09/30/2018 - 14:32:14: [AMXX] Plugin "RangosCTF.amxx" failed to load: Module/Library "cs_player_models_api" required for plugin. Check modules.ini.

tenes que agregar la api

esto va en plugins.ini
Cita:cs_player_models_api.amxx

Listo ya agregue la api en plugins.ini pero sigue sin funcionar y sale esto Ahora
Código PHP:
09/30/2018 14:42:26: [admincmd.amxxCmd"Gato.!<1><STEAM_ID_LAN><>" changelevel "cs_assault"
09/30/2018 14:42:28: -------- Mapchange to cs_assault --------
09/30/2018 14:42:29: [AMXXPlugin "cs_player_models_api.amxx" failed to loadModule/Library "cstrike" required for plugin.  Check modules.ini.
09/30/2018 14:42:29: [AMXXPlugin "RangosCTF.amxx" failed to loadPlugin uses an unknown function (name "adv_vault_get_field") - check your modules.ini.
09/30/2018 14:42:30: [admin.amxxLogin"Gato.!<1><STEAM_ID_LAN><>" became an admin (account "loopback") (access "abcdefghijklmnopqrstu") (address "loopback"
Cita: Kikizon2 Dijo :
Lo que deberian de aprender es a escribir, parece que escriben con el escroto en la mano.
Responder
#18
No te la compliques usa cstrike

#include <cstrike>

Código PHP:
cs_set_user_model(idg_model_rango[g_rango[id]]) 
Responder
#19
(30/09/2018, 03:47 PM)La Renga Mk escribió: No te la compliques usa cstrike

#include <cstrike>

Código PHP:
cs_set_user_model(idg_model_rango[g_rango[id]]) 

Listo ya le puse el include <cstrike> pero sigue dando el mismo error pacman
Código PHP:
09/30/2018 14:56:42: -------- Mapchange to cs_assault --------
09/30/2018 14:56:42: [AMXXPlugin "RangosCTF.amxx" failed to loadModule/Library "cstrike" required for plugin.  Check modules.ini.
09/30/2018 14:56:43: [admin.amxxLogin"Gato.!<1><STEAM_ID_LAN><>" became an admin (account "loopback") (access "abcdefghijklmnopqrstu") (address "loopback")
09/30/2018 14:56:45: [admin.amxxLogin"Gato.!<1><STEAM_ID_LAN><>" became an admin (account "loopback") (access "abcdefghijklmnopqrstu") (address "loopback"
Cita: Kikizon2 Dijo :
Lo que deberian de aprender es a escribir, parece que escriben con el escroto en la mano.
Responder
#20
pone en consola amx_modules

primero fijate que lo tengas seguro que no lo tenes
\cstrike\addons\amxmodx\modules\cstrike_amxx.dll
Responder
#21
(30/09/2018, 04:19 PM)La Renga Mk escribió: pone en consola amx_modules

primero fijate que lo tengas seguro que no lo tenes
\cstrike\addons\amxmodx\modules\cstrike_amxx.dll

No lo tenia pero Lo descargue y quedo asi y sigue dando error y no Agarra

(30/09/2018, 04:19 PM)La Renga Mk escribió: pone en consola amx_modules

primero fijate que lo tengas seguro que no lo tenes
\cstrike\addons\amxmodx\modules\cstrike_amxx.dll

y en Logs da este error
Código PHP:
09/30/2018 15:37:57: [admincmd.amxxCmd"Gato.!<2><STEAM_ID_LAN><>" changelevel "cs_assault"
09/30/2018 15:37:59: -------- Mapchange to cs_assault --------
09/30/2018 15:37:59: [AMXXPlugin "RangosCTF.amxx" failed to loadPlugin uses an unknown function (name "adv_vault_get_field") - check your modules.ini.
09/30/2018 15:38:00: [admin.amxxLogin"Gato.!<2><STEAM_ID_LAN><>" became an admin (account "loopback") (access "abcdefghijklmnopqrstu") (address "loopback")
09/30/2018 15:38:02: [admin.amxxLogin"Gato.!<2><STEAM_ID_LAN><>" became an admin (account "loopback") (access "abcdefghijklmnopqrstu") (address "loopback"
Cita: Kikizon2 Dijo :
Lo que deberian de aprender es a escribir, parece que escriben con el escroto en la mano.
Responder
#22
anda a la carpeta plugins

y busca adv_vault.amxx si lo tenes agregalo a plugins.ini

si no lo tenes descargalo https://amxmodx-es.com/Thread-API-Advanc...12-06-2015
Responder
#23
(30/09/2018, 04:52 PM)La Renga Mk escribió: anda a la carpeta plugins

y busca adv_vault.amxx si lo tenes agregalo a plugins.ini

si no lo tenes descargalo https://amxmodx-es.com/Thread-API-Advanc...12-06-2015

Listo Gracias Renga Por tu ayuda Ya actualize el tema de del pedido a SOLUCIONADO
Cita: Kikizon2 Dijo :
Lo que deberian de aprender es a escribir, parece que escriben con el escroto en la mano.
Responder


Salto de foro:


Usuarios navegando en este tema: 1 invitado(s)