Hola.
Bueno inicio este tema porque hace poco edite el plugin principal del ZP común (default) , con el AMXmod Studio.
Modifique el zp para que sea por NIVELES x Frags
Pero resulta que no me andubo, mire el plugin de arriba a abajo, y no encontre ningun error, ni ningun bug. Se compilo sin errores, ni warnings. Pero no lo toma, cuando lo testeo en el cs, sigue en el modo comun del ZP
Lo que hize fue:
1. Agregar las variables constantes de los frags zm y hm
2. Las variables globales del nivel y los frags
3. Registrar las natives
4. Agregar el forward
5. Agregar las natives
6. Y por ultimo agregar un public para no sobrepasar el Nivel Maximo.
1.
2.Código PHP:new const FRAGS_HM[5] = { 0, 2, 4, 6, 8 }
new const FRAGS_ZM[5] = { 0, 2, 4, 6, 8 }
3.Código PHP:new g_level[33]
new g_frags_hm[33]
new g_frags_zm[33]
4.Código PHP:public plugin_natives()
{
// Register native LEVEL
register_native("zp_get_user_level", "native_get_user_level", 1)
register_native("zp_set_user_level", "native_set_user_level", 1)
// Register native FRAGS
register_native("zp_get_user_frags_lvl", "native_get_user_frags_lvl", 1)
register_native("zp_set_user_frags_lvl", "native_set_user_frags_lvl", 1)
}
5.Código PHP:public fw_PlayerKilled(victim, attacker, shouldgib)
{
// Matar a un zombie o a un un humano
if(!g_zombie[victim])
update_level(attacker, 1, 0)
else if(g_zombie[victim]
update_level(attacker, 1, 0)
}
Código PHP:public update_level(id, amount, check)
{
if(check) goto check2
// Con esto limita que si es nivel maximo no siga subiendo.
if(g_frags_zm[id] + amount > FRAGS_ZM[sizeof FRAGS_ZM - 1] - 1 ||
g_frags_hm[id] + amount > FRAGS_HM[sizeof FRAGS_HM - 1] - 1)
return PLUGIN_HANDLED
g_frags_hm[id] += amount
g_frags_zm[id] += amount
check2:
{
if(amount < 0)
{
if(g_frags_hm[id] < FRAGS_HM[g_level[id]] || g_frags_zm[id] < FRAGS_ZM[g_level[id]])
{
g_level[id]--
client_print(id, print_center, "[ZP] Bajaste de Nivel !!!")
update_level(id, -1, 1)
}
}
else
{
if(g_frags_hm[id] >= FRAGS_HM[g_level[id]] || g_frags_zm[id] >= FRAGS_ZM[g_level[id]])
{
g_level[id]++
client_print(id, print_center, "[ZP] Subiste de Nivel !!!")
update_level(id, -1, 1)
}
}
return PLUGIN_HANDLED
}
Le agradeceria al que sepa acerca del tema que me de su opinion, y que mas puedo probar para que me funcione.
Saludos![]()





LinkBack URL
About LinkBacks





