hola que tal, le cambie el numero al final de cada logro lo reconoce pero me sigue dando el logro al numero anterior como que se cambio solamente el texto pero el logro quedo al anterior , aca te paso el sma quizas me podrias ayudar con un ejemplo ,
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <csx>
#include <adv_vault>
#define TASKID(%0) (taskid - %0)
new PLUGIN [] = "WWW.VENTASCSONLINE.COM - Sistema de logros"
new VERSION [] = "1.0"
new AUTHOR [] = "Alejandro-."
new FONDO [] = "http://img.fenixzone.net/i/JHhcROm.jpeg"
new TAG [] = "^4[^3SG^4]^1"
const TASK = 125421
const TASK2 = 124421
const TASK3 = 124421
new Seg[33], Min[33];
new CountDown
enum LOGROS_DT
{
nombre[32],
IMG[400],
nIMG[400],
DESCRIPSION[500],
VECES
}
new const iLogros[][LOGROS_DT]=
{
{"Solo 1hp", "http://insurgentescs.tk/a.png", "http://insurgentescs.tk/0a.png", "Mata a un jugador tienendo 1 de vida", 1},
{"Master Spray", "http://insurgentescs.tk/b.png", "http://insurgentescs.tk/0b.png", "Haz 50 graffitis", 50},
{"Mas alla", "http://insurgentescs.tk/c.png", "http://insurgentescs.tk/0c.png", "Mata con granada de fuego despues de morir", 1},
{"c4 Complete", "http://insurgentescs.tk/d.png", "http://insurgentescs.tk/0d.png", "Planta la c4 y haz que detone", 1},
{"Desarmador", "http://insurgentescs.tk/e.png", "http://insurgentescs.tk/0e.png", "Defusa 30 veces la c4", 30},
{"Boom!", "http://insurgentescs.tk/f.png", "http://insurgentescs.tk/0f.png", "Haz explotar el c4 30 veces", 30},
{"Master Desert", "http://insurgentescs.tk/g.png", "http://insurgentescs.tk/0g.png", "Mata 50 veces con deagle", 50},
{"Master Ak47", "http://insurgentescs.tk/h.png", "http://insurgentescs.tk/0h.png", "Mata 100 veces con la ak47", 100},
{"Master HE", "http://insurgentescs.tk/i.png", "http://insurgentescs.tk/0i.png", "Mata 30 veces con Granada de fuego", 30},
{"Master m4a1", "http://insurgentescs.tk/j.png", "http://insurgentescs.tk/0j.png", "Mata 100 veces con la m4a1", 100},
{"Servicio", "http://insurgentescs.tk/k.png", "http://insurgentescs.tk/0k.png", "Dura 1 hora jugando en el servidor", 60},
{"Carnicero", "http://insurgentescs.tk/l.png", "http://insurgentescs.tk/0l.png", "Mata 50 veces con Chuchillo", 50},
{"Demente", "http://insurgentescs.tk/m.png", "http://insurgentescs.tk/0m.png", "Logra conseguir 500 kills", 500},
{"Rompe cocos", "http://insurgentescs.tk/o.png", "http://insurgentescs.tk/0o.png", "Mata 100 veces de headshot", 100},
{"Antibomm!", "http://insurgentescs.tk/p.png", "http://insurgentescs.tk/0p.png", "Desarma la c4 antes de que explote", 1},
{"El Salvador", "http://insurgentescs.tk/q.png", "http://insurgentescs.tk/0q.png", "rescata un total de 30 rehenes", 30},
{"Brazuca", "http://insurgentescs.tk/r.png", "http://insurgentescs.tk/0r.png", "Mata a 100 personas usando P90", 100},
{"Por poco", "http://insurgentescs.tk/s.png", "http://insurgentescs.tk/0s.png", "Mata a un ct mientras este desactiva c4", 1}
}
new iLogro[33][sizeof(iLogros)];
new iComplete[33][sizeof(iLogros)];
new iGuard1[sizeof(iLogros)];
new iGuard2[sizeof(iLogros)];
new IsUserDefusing[33]
new g_nombre[33][32]
new g_Guardado;
new SegGuard
new MinGuard
new g_Menu[33]
/*<--------------- || INIT || --------------->*/
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR);
register_clcmd("say /logros", "show_motd_logros");
register_clcmd("say /info_logros", "info_logros");
register_event("DeathMsg", "DeathMsg", "a");
register_logevent("host_Rescued", 3, "2=Rescued_A_Hostage")
register_event( "23", "EventSpray", "a", "1=112" );
g_Guardado = adv_vault_open("LOGROS_CSS", false)
for(new i = 0; i <sizeof iLogros; i++)
{
iGuard1[i] = adv_vault_register_field(g_Guardado, fmt("Logro_%d", i), DATATYPE_ARRAY, 5);
iGuard2[i] = adv_vault_register_field(g_Guardado, fmt("Completado_%d", i), DATATYPE_ARRAY, 5);
}
SegGuard = adv_vault_register_field(g_Guardado, "Segndos", DATATYPE_ARRAY, 5);
MinGuard = adv_vault_register_field(g_Guardado, "Minutos", DATATYPE_ARRAY, 5);
adv_vault_init(g_Guardado)
set_task(300.0, "publicity", TASK)
}
/*<--------------- || PUBLICITY || --------------->*/
public publicity()
{
set_hudmessage(random_num(10, 255), random_num(10, 255), random_num(10, 255), -1.0, 0.10, 2,6.0, 8.0)
show_hudmessage(0, "Sistema de Logros por: Alejandro-.")
client_print_color(0, print_team_default, "%s Sistema de Logros por:^4 Alejandro-.", TAG)
}
/*<--------------- || DISPLAY INFORMATION || --------------->*/
public info_logros(id)
{
new Cuenta_logros[33], For[300];
for(new i = 0; i <sizeof iLogros; i++)
{
if(iLogro[id][i]) Cuenta_logros[id]++
}
new menu = menu_create(fmt("\w%s %s:^n\wLogros:\y %d/%d^n\wPagina:\r", PLUGIN[25], VERSION, Cuenta_logros[id], sizeof(iLogros)), "Hand_Info")
for(new i = 0; i <sizeof iLogros; i++)
{
formatex(For, charsmax(For), "%d/%d", iComplete[id][i], iLogros[i][VECES])
menu_additem(menu, fmt("\w%s [\y%s\w]", iLogros[i][nombre], iLogro[id][i] ? "COMPLETADO" : For ))
}
menu_setprop(menu, MPROP_EXITNAME, "Salir"); menu_setprop(menu, MPROP_NEXTNAME, "Siguiente"); menu_setprop(menu, MPROP_BACKNAME, "Volver")
menu_display(id, menu)
}
public Hand_Info(id, menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(menu)
return PLUGIN_HANDLED;
}
g_Menu[id] = item
Show_InfoLogro(id)
return PLUGIN_HANDLED;
}
public Show_InfoLogro(id)
{
new Cuenta_logros[33];
for(new i = 0; i <sizeof iLogros; i++)
{
if(iLogro[id][i]) Cuenta_logros[id]++
}
new menu = menu_create(fmt("\w\
Logro:\y %s^n\w\
Progreso:\y %d/%d", iLogros[g_Menu[id]][nombre], iComplete[id][g_Menu[id]], iLogros[g_Menu[id]][VECES]), "Hand_ShowInfo")
menu_additem(menu, fmt("\
\wDescripcion:^n\
\w %s", iLogros[g_Menu[id]][DESCRIPSION]))
menu_setprop(menu, MPROP_EXITNAME, "Volver");
menu_display(id, menu)
}
public Hand_ShowInfo(id, menu, item)
{
if(item == MENU_EXIT)
{
info_logros(id)
return PLUGIN_HANDLED;
}
Show_InfoLogro(id)
return PLUGIN_HANDLED;
}
/*<--------------- || PUTIN/DISCONECTED || --------------->*/
public client_putinserver(id)
{
for(new i = 0; i <sizeof iLogros; i++)
{
iLogro[id][i] = false
}
Seg[id] = 0
Min[id] = 0
IsUserDefusing[id] = false
get_user_name(id, g_nombre[id], 31)
Cargar(id)
if(!iLogro[id][10]) set_task(1.0, "Time_Jugador", id+TASK2)
}
public client_disconnected(id)
{
Guardar(id)
remove_task(id+TASK)
remove_task(id+TASK2)
remove_task(id+TASK3)
}
/*<--------------- || EVENTOS || --------------->*/
public Time_Jugador(taskid)
{
new id = TASKID(TASK2)
if(Seg[id] < 60)
{
Seg[id]++
}
else if(Min[id] < 60)
{
Seg[id] = 0
Min[id]++
iComplete[id][10]++
}
if(!iLogro[id][10] && Min[id] >= iLogros[10][VECES])
{
iLogro[id][10] = true
client_print_color(id, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[10][nombre])
}
if(!iLogro[id][1]) set_task(1.0, "Time_Jugador", id+TASK2)
}
public DeathMsg()
{
new Atack = read_data(1)
new Victima = read_data(2)
new hs = read_data(3)
if(Atack == Victima || !is_user_connected(Victima) || !is_user_connected(Atack))
return;
if(!iLogro[Atack][2] && !is_user_alive(Atack))
{
iLogro[Atack][2] = true
iComplete[Atack][2]++
client_print_color(Atack, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[2][nombre])
}
if(!iLogro[Atack][0] && get_user_health(Atack) == 1)
{
iLogro[Atack][0] = true
iComplete[Atack][0]++
client_print_color(Atack, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[0][nombre])
}
switch(get_user_weapon(Atack))
{
case CSW_DEAGLE:
{
if(!iLogro[Atack][6])
{
iComplete[Atack][6]++
if(iComplete[Atack][6] >= iLogros[6][VECES])
{
iLogro[Atack][6] = true
client_print_color(Atack, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[6][nombre])
}
}
}
case CSW_AK47:
{
if(!iLogro[Atack][7])
{
iComplete[Atack][7]++
if(iComplete[Atack][7] >= iLogros[7][VECES])
{
iLogro[Atack][7] = true
client_print_color(Atack, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[7][nombre])
}
}
}
case CSW_HEGRENADE:
{
if(!iLogro[Atack][8])
{
iComplete[Atack][8]++
if(iComplete[Atack][8] >= iLogros[8][VECES])
{
iLogro[Atack][8] = true
client_print_color(Atack, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[8][nombre])
}
}
}
case CSW_M4A1:
{
if(!iLogro[Atack][9])
{
iComplete[Atack][9]++
if(iComplete[Atack][9] >= iLogros[9][VECES])
{
iLogro[Atack][9] = true
client_print_color(Atack, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[9][nombre])
}
}
}
case CSW_KNIFE:
{
if(!iLogro[Atack][11])
{
iComplete[Atack][11]++
if(iComplete[Atack][11] >= iLogros[11][VECES])
{
iLogro[Atack][11] = true
client_print_color(Atack, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[11][nombre])
}
}
}
case CSW_P90:
{
if(!iLogro[Atack][16])
{
iComplete[Atack][16]++
if(iComplete[Atack][16] >= iLogros[16][VECES])
{
iLogro[Atack][16] = true
client_print_color(Atack, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[16][nombre])
}
}
}
}
if(!iLogro[Atack][12])
{
iComplete[Atack][12]++
if(iComplete[Atack][12] >= iLogros[12][VECES])
{
iLogro[Atack][12] = true
client_print_color(Atack, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[12][nombre])
}
}
if(hs)
{
if(!iLogro[Atack][13])
{
iComplete[Atack][13]++
if(iComplete[Atack][13] >= iLogros[13][VECES])
{
iLogro[Atack][13] = true
client_print_color(Atack, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[13][nombre])
}
}
}
if(IsUserDefusing[Victima])
{
if(!iLogro[Atack][17])
{
iComplete[Atack][17]++
iLogro[Atack][17] = true
client_print_color(Atack, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[17][nombre])
}
}
}
public bomb_explode(id)
{
if(!iLogro[id][3])
{
iComplete[id][3]++
iLogro[id][3] = true
client_print_color( id, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[3][nombre] )
}
if(!iLogro[id][5])
{
iComplete[id][5]++
if(iComplete[id][5] >= iLogros[5][VECES])
{
iLogro[id][5] = true
client_print_color( id, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[5][nombre] )
}
}
IsUserDefusing[id] = false
}
public bomb_planted(id)
{
if(task_exists(id+TASK3)) remove_task(id+TASK3)
CountDown = get_cvar_num("mp_c4timer") - 1
set_task(1.0, "fw_countdown", id, _, _,"b")
}
public fw_countdown(taskid)
{
new id = TASKID(TASK3)
if(!CountDown)
{
remove_task(id)
}
CountDown--
}
public bomb_defused(id)
{
if(!iLogro[id][4])
{
iComplete[id][4]++
if(iComplete[id][4] >= iLogros[4][VECES])
{
iLogro[id][4] = true
client_print_color( id, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[4][nombre] )
}
}
if(CountDown <= 5)
{
if(!iLogro[id][14])
{
iComplete[id][14]++
iLogro[id][14] = true
client_print_color( id, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[14][nombre] )
}
}
IsUserDefusing[id] = false
}
public bomb_defusing(id)
{
IsUserDefusing[id] = true
}
public host_Rescued()
{
new id = getLoguserIndex()
if ( !is_user_connected(id) || cs_get_user_team(id) != CS_TEAM_CT ) return
if(!iLogro[id][15])
{
iComplete[id][15]++
if(iComplete[id][15] >= iLogros[15][VECES])
{
iLogro[id][15] = true
client_print_color( id, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[15][nombre])
}
}
}
public EventSpray()
{
new id = read_data(2);
if(!iLogro[id][1])
{
iComplete[id][1]++
if(iComplete[id][1] >= iLogros[1][VECES])
{
iLogro[id][1] = true
client_print_color( id, print_team_default, "%s Completaste el logro:^4 %s", TAG, iLogros[1][nombre])
}
}
}
/*<--------------- || GUARDADO/CARGADO || --------------->*/
public Guardar(id)
{
if( !is_user_connected(id))
return;
adv_vault_set_start(g_Guardado);
for(new i = 0; i <sizeof iLogros; i++)
{
adv_vault_set_field(g_Guardado, iGuard1[i], iLogro[id][i]);
adv_vault_set_field(g_Guardado, iGuard2[i], iComplete[id][i]);
}
adv_vault_set_field(g_Guardado, SegGuard, Seg[id]);
adv_vault_set_field(g_Guardado, MinGuard, Min[id]);
adv_vault_set_end(g_Guardado, 0, g_nombre[id])
}
public Cargar(id)
{
if(!adv_vault_get_prepare(g_Guardado, _, g_nombre[id]))
return;
for(new i = 0; i <sizeof iLogros; i++)
{
adv_vault_get_field(g_Guardado, iGuard1[i], iLogro[id][i], sizeof iLogro[]);
adv_vault_get_field(g_Guardado, iGuard2[i], iComplete[id][i], sizeof iComplete[]);
}
adv_vault_get_field(g_Guardado, SegGuard, Seg[id], sizeof Seg[]);
adv_vault_get_field(g_Guardado, MinGuard, Min[id], sizeof Min[]);
}
/*<--------------- || MOTD || --------------->*/
public show_motd_logros(id)
{
new motd[ 3500 ], rLen = 0, Cuenta_logros[33];
for(new i = 0; i <sizeof iLogros; i++)
{
if(iLogro[id][i]) Cuenta_logros[id]++
}
rLen += formatex( motd, charsmax( motd ), "<body><font><STYLE>body{background:url(^"%s^");color:white;text-shadow:2px 2px 4px black;font-family

ans-serif}table{background:rgba(0,0,0,0.8);width:60%%;font-size:12px;margin:auto}</STYLE>", FONDO );
rLen += formatex( motd[ rLen ], charsmax( motd ) - rLen,"<center><h1>Mis logros %d/%d</h1></center><br>", Cuenta_logros[id], sizeof(iLogros));
rLen += formatex( motd[ rLen ], charsmax( motd ) - rLen,"<table cellpadding=0 cellspacing=0 border=1>" );
for(new i = 0; i <sizeof iLogros; i++)
{
switch(i)
{
case 5:
{
if(iLogro[id][i]) rLen += formatex( motd[ rLen ], charsmax( motd ) - rLen, "<th><p>%s</p><img src=%s><th><tr>", iLogros[i][nombre], iLogros[i][IMG]);
else rLen += formatex( motd[ rLen ], charsmax( motd ) - rLen, "<th><p>%s</p><img src=%s><th><tr>", iLogros[i][nombre], iLogros[i][nIMG]);
}
case 11:
{
if(iLogro[id][i]) rLen += formatex( motd[ rLen ], charsmax( motd ) - rLen, "<th><p>%s</p><img src=%s><th><tr>", iLogros[i][nombre], iLogros[i][IMG]);
else rLen += formatex( motd[ rLen ], charsmax( motd ) - rLen, "<th><p>%s</p><img src=%s><th><tr>", iLogros[i][nombre], iLogros[i][nIMG]);
}
default:
{
if(iLogro[id][i]) rLen += formatex( motd[ rLen ], charsmax( motd ) - rLen, "<th><p>%s</p><img src=%s><th>", iLogros[i][nombre], iLogros[i][IMG]);
else rLen += formatex( motd[ rLen ], charsmax( motd ) - rLen, "<th><p>%s</p><img src=%s><th>", iLogros[i][nombre], iLogros[i][nIMG]);
}
}
}
rLen += formatex(motd[rLen], charsmax( motd ) - rLen, "</table><p align=center>By: Alejandro</p></body>" );
show_motd( id, motd, fmt("%s %s", PLUGIN[25], VERSION) );
}
/*<--------------- || STOCKS || --------------->*/
stock getLoguserIndex()
{
new loguser[80], name[32]
read_logargv(0, loguser, charsmax(loguser))
parse_loguser(loguser, name, charsmax(name))
return get_user_index(name)
}