07/05/2014, 04:00 PM
(Última modificación: 14/05/2014, 10:15 PM por Evil Spiret.)
Esta guia la saque de AM.net pero le faltaba el chaleco para cada clase y simplemente dejo la guia completa como la dejaron en AM + el chaleco
AUTOR : LA BANDA
MEJORA : EVIL SPIRET
Dejo todo mas que nada por que algunos no pueden entrar en el am.net
LISTO LA PARTE DE CODEAR
Bueno ahora solo les hace falta agregar las natives al include para crear las clases humanas desde afuera para eso abrimos nuestro zombieplague.inc
que se en cuentra dentro de la carpeta include
Agregamos estas lineas
Guardan y ya pueden compilar sus clases humanas mediante plugin externo.
Tambien editar el zombie_plague.txt que se encuentra en amxmodx/data/lang
y escribir dentro de el
Bueno , mucho trabajo tengo los ojos cuadrados te ver que no me equivoque , si pasa algo me avisan saludos.
AUTOR : LA BANDA
MEJORA : EVIL SPIRET
Dejo todo mas que nada por que algunos no pueden entrar en el am.net
Debajo de
Despues nos vamos a
y colocamos
Luego debajo de
Colocamos
En player vars
Luego buscamos
Y reemplazamos el 8 por un 9
Abajo de
colocamos
Debajo de
Agregan
luego buscar // CVAR pointers y ponen
Debajo de
colocan
Debajo de
colocan
abajo de
colocan
Vamos a los menus
debajo de
colocan
Debajo de
colocan
Vamos a public fw_PlayerSpawn_Post(id) y reemplazamos esto
por esto
Unas lineas mas abajo veran esto
Lo reemplazan por esto
Mas abajo veran esto
y lo reemplazan por esto
Código PHP:
const MAX_ZOMBIE_CLASSSES = 20
Código PHP:
const MAX_HUMAN_CLASSSES = 20
Despues nos vamos a
Código PHP:
// For zombie class menu handlers
#define ZCLASSES_STARTID g_menu_data[id][7]
#define ZCLASSES_SELECTION (g_menu_data[id][7]+key)
y colocamos
Código PHP:
// For human class menu handlers
#define HCLASSES_STARTID g_menu_data[id][8]
#define HCLASSES_SELECTION (g_menu_data[id][8]+key)
Luego debajo de
Código PHP:
// Zombie classes
const ZCLASS_NONE = -1
Colocamos
Código PHP:
// Human classes
const HCLASS_NONE = -1
En player vars
Código PHP:
new g_humanclass[33]
new g_humanclassnext[33]
Luego buscamos
Código PHP:
new g_menu_data[33][8] // data for various menus
Abajo de
Código PHP:
new db_zombieclass[MAX_STATS_SAVED] // zombie class
colocamos
Código PHP:
new db_humanclass[MAX_STATS_SAVED] // human class
Debajo de
Código PHP:
// Zombie Classes vars
new g_zclass_name[MAX_ZOMBIE_CLASSSES][32] // name
new g_zclass_info[MAX_ZOMBIE_CLASSSES][32] // description
new g_zclass_model[MAX_ZOMBIE_CLASSSES][32] // player model
new g_zclass_modelindex[MAX_ZOMBIE_CLASSSES] // model index
new g_zclass_clawmodel[MAX_ZOMBIE_CLASSSES][32] // claw model
new g_zclass_hp[MAX_ZOMBIE_CLASSSES] // health
new g_zclass_spd[MAX_ZOMBIE_CLASSSES] // speed
new Float:g_zclass_grav[MAX_ZOMBIE_CLASSSES] // gravity
new Float:g_zclass_kb[MAX_ZOMBIE_CLASSSES] // knockback
new g_zclass_i // loaded zombie classes counter
Agregan
Código PHP:
// Human Classes vars
new g_hclass_name[MAX_HUMAN_CLASSSES][32] // name
new g_hclass_info[MAX_HUMAN_CLASSSES][32] // description
new g_hclass_model[MAX_HUMAN_CLASSSES][32] // player model
new g_hclass_modelindex[MAX_HUMAN_CLASSSES] // model index
new g_hclass_clawmodel[MAX_HUMAN_CLASSSES][32] // claw model
new g_hclass_hp[MAX_HUMAN_CLASSSES] // health
new g_hclass_spd[MAX_HUMAN_CLASSSES] // speed
new Float:g_hclass_grav[MAX_HUMAN_CLASSSES] // gravity
new g_hclass_i // loaded human classes counter
luego buscar // CVAR pointers y ponen
Código PHP:
, cvar_hclasses
Debajo de
Código PHP:
// No zombie classes?
if (!g_zclass_i) set_fail_state("No zombie classes loaded!")
colocan
Código PHP:
// No human classes?
if (!g_hclass_i) set_fail_state("No human classes loaded!")
Debajo de
Código PHP:
register_native("zp_set_user_zombie_class", "native_set_user_zombie_class", 1)
colocan
Código PHP:
register_native("zp_get_user_human_class", "native_get_user_human_class", 1)
register_native("zp_set_user_human_class", "native_set_user_human_class", 1)
abajo de
Código PHP:
register_native("zp_register_zombie_class", "native_register_zombie_class", 1)
colocan
Código PHP:
register_native("zp_register_human_class", "native_register_human_class", 1)
Vamos a los menus
debajo de
Código PHP:
register_menu("Zombie Class Menu", KEYSMENU, "menu_zclass")
colocan
Código PHP:
register_menu("Human Class Menu", KEYSMENU, "menu_hclass")
Debajo de
Código PHP:
cvar_zclasses = register_cvar("zp_zombie_classes", "1")
colocan
Código PHP:
cvar_hclasses = register_cvar("zp_human_classes", "1")
Vamos a public fw_PlayerSpawn_Post(id) y reemplazamos esto
Código PHP:
// Set health and gravity
fm_set_user_health(id, get_pcvar_num(cvar_humanhp))
set_pev(id, pev_gravity, get_pcvar_float(cvar_humangravity))
por esto
Código PHP:
// Set selected human class
g_humanclass[id] = g_humanclassnext[id]
if (g_humanclass[id] == HCLASS_NONE) g_humanclass[id] = 0
// Set health and gravity
fm_set_user_health(id, g_hclass_hp[g_humanclass[id]])
set_pev(id, pev_gravity, g_hclass_grav[g_humanclass[id]])
Unas lineas mas abajo veran esto
Código PHP:
// Set the right model
if (get_pcvar_num(cvar_adminmodelshuman) && get_user_flags(id) & ACCESS_FLAG3)
copy(g_playermodel[id], sizeof g_playermodel[] - 1, model_admin[random_num(0, sizeof model_admin -1)])
else
copy(g_playermodel[id], sizeof g_playermodel[] - 1, model_human[random_num(0, sizeof model_human -1)])
Lo reemplazan por esto
Código PHP:
// Set the right model
if (get_pcvar_num(cvar_adminmodelshuman) && get_user_flags(id) & ACCESS_FLAG3)
copy(g_playermodel[id], sizeof g_playermodel[] - 1, model_admin[random_num(0, sizeof model_admin -1)])
else
copy(g_playermodel[id], sizeof g_playermodel[] - 1, g_hclass_model[g_humanclass[id]])
Mas abajo veran esto
Código PHP:
}
else
{
for (i = 0; i < sizeof model_human; i++)
if (equal(model_human[i], currentmodel)) already_has_model = true;
if (!already_has_model)
{
iRand = random_num(0, sizeof model_human -1)
copy(g_playermodel[id], sizeof g_playermodel[] - 1, model_human[iRand])
#if defined SET_MODELINDEX_OFFSET
fm_set_user_model_index(id, g_modelindex_human[iRand])
#endif
}
}
y lo reemplazan por esto
Código PHP:
}
else
{
if (equal(g_hclass_model[g_humanclass[id]], currentmodel)) already_has_model = true;
if (!already_has_model)
{
copy(g_playermodel[id], sizeof g_playermodel[] - 1, g_hclass_model[g_humanclass[id]])
#if defined SET_MODELINDEX_OFFSET
fm_set_user_model_index(id, g_hclass_modelindex[g_humanclass[id]])
#endif
}
}
Ahora vamos a public fw_PlayerPreThink(id)
Veran esto
Reemplazan la linea
por esta
Buscan
y reemplazan esto
por esto
Ahora el menu , debajo del todo en
osea despues de la llave
Colocan
Buscamos
y lo reemplazamos por
Ahora debajo de este public
colocamos
Veran esto
Código PHP:
}
else
{
if (g_survivor[id])
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_survspd))
else
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_humanspd))
}
}
Reemplazan la linea
Código PHP:
set_pev(id, pev_maxspeed, get_pcvar_float(cvar_humanspd))
por esta
Código PHP:
set_pev(id, pev_maxspeed, float(g_hclass_spd[g_humanclass[id]]))
Buscan
Código PHP:
// Game Menu
show_menu_game(id)
y reemplazan esto
Código PHP:
// 3. Zombie class
if (get_pcvar_num(cvar_zclasses))
len += formatex(menu[len], sizeof menu - 1 - len, "\r3.\w %L^n", id,"MENU_ZCLASS")
else
len += formatex(menu[len], sizeof menu - 1 - len, "\d3. %L^n", id,"MENU_ZCLASS")
por esto
Código PHP:
// 3. Zombie class || Human class
if (g_zombie[id])
len += formatex(menu[len], sizeof menu - 1 - len, "\r3.\w %L^n", id,"MENU_ZCLASS")
else
len += formatex(menu[len], sizeof menu - 1 - len, "\r3.\w %L^n", id,"MENU_HCLASS")
Ahora el menu , debajo del todo en
Código PHP:
// Zombie Class Menu
public show_menu_zclass(id)
Colocan
Código PHP:
// Human Class Menu
public show_menu_hclass(id)
{
// Player disconnected
if (!is_user_connected(id))
return;
// Bots pick their zombie class randomly
if (is_user_bot(id))
{
g_humanclassnext[id] = random_num(0, g_hclass_i - 1)
return;
}
static menu[400], len, class
len = 0
// Title
len += formatex(menu[len], sizeof menu - 1 - len, "\y%L \r[%d-%d]^n^n", id, "MENU_HCLASS_TITLE", HCLASSES_STARTID+1, min(HCLASSES_STARTID+7, g_hclass_i))
// 1-7. Class List
for (class = HCLASSES_STARTID; class < min(HCLASSES_STARTID+7, g_hclass_i); class++)
{
if (class == g_humanclassnext[id])
len += formatex(menu[len], sizeof menu - 1 - len, "\d%d. %s %s^n", class-HCLASSES_STARTID+1, g_hclass_name[class], g_hclass_info[class])
else
len += formatex(menu[len], sizeof menu - 1 - len, "\r%d.\w %s\y %s^n", class-HCLASSES_STARTID+1, g_hclass_name[class], g_hclass_info[class])
}
// 8. Back - 9. Next - 0. Exit
len += formatex(menu[len], sizeof menu - 1 - len, "^n\r8.\w %L^n\r9.\w %L^n^n\r0.\w %L", id, "MENU_BACK", id, "MENU_NEXT", id, "MENU_EXIT")
show_menu(id, KEYSMENU, menu, -1, "Human Class Menu")
}
Buscamos
Código PHP:
case 2: // Zombie Classes
{
// Zombie classes enabled?
if (get_pcvar_num(cvar_zclasses))
show_menu_zclass(id)
else
zp_colored_print(id, "^x04[ZP]^x01 %L", id ,"CMD_NOT_ZCLASSES")
}
y lo reemplazamos por
Código PHP:
case 2: // Zombie Classes || Human Classes
{
// Zombie classes enabled?
if (g_zombie[id])
show_menu_zclass(id)
else
show_menu_hclass(id)
}
Ahora debajo de este public
Código PHP:
// Zombie Class Menu
public menu_zclass(id, key)
colocamos
Código PHP:
// Human Class Menu
public menu_hclass(id, key)
{
// Special keys / items list exceeded
if (key >= MENU_KEY_BACK || HCLASSES_SELECTION >= g_hclass_i)
{
switch (key)
{
case MENU_KEY_BACK: // back
{
if (HCLASSES_STARTID-7 >= 0) HCLASSES_STARTID -= 7
}
case MENU_KEY_NEXT: // next
{
if (HCLASSES_STARTID+7 < g_hclass_i) HCLASSES_STARTID += 7
}
case MENU_KEY_EXIT: // exit
{
return PLUGIN_HANDLED;
}
}
// Show extra items menu again
show_menu_hclass(id)
return PLUGIN_HANDLED;
}
// Store selection for the next infection
g_humanclassnext[id] = HCLASSES_SELECTION;
// Show selected zombie class info and stats
zp_colored_print(id, "^x04[ZP]^x01 %L: %s", id, "HUMAN_SELECT", g_hclass_name[g_humanclassnext[id]])
zp_colored_print(id, "^x04[ZP]^x01 %L: %d %L: %d %L: %d", id, "HUMAN_ATTRIB1", g_hclass_hp[g_humanclassnext[id]], id, "HUMAN_ATTRIB2", g_hclass_spd[g_humanclassnext[id]],
id, "HUMAN_ATTRIB3", floatround(g_hclass_grav[g_humanclassnext[id]]*800))
return PLUGIN_HANDLED;
}
Vamos a
Reemplazamos esto
por esto
Ahora vamos a
debajo veran esto
y debajo colocan
Mas abajo
Reemplazan la linea
por esta
Luego reemplazan esto
por esto
Reemplazan esto
por esto
Todabia en el humanme , reemplazan esto
por esto
Código PHP:
case 1: // Humans
Reemplazamos esto
Código PHP:
}
case 1: // Humans
{
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2")
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_A", get_pcvar_num(cvar_humanhp))
if (get_pcvar_num(cvar_humanlasthp) > 0) len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_B", get_pcvar_num(cvar_humanlasthp))
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_C", get_pcvar_num(cvar_humanspd))
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_D", floatround(get_pcvar_float(cvar_humangravity)*800))
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_E", id, get_pcvar_num(cvar_infammo) > 0 ? get_pcvar_num(cvar_infammo) > 1 ? "MOTD_AMMO_CLIP" : "MOTD_AMMO_BP" : "MOTD_LIMITED")
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_F", get_pcvar_num(cvar_ammodamage))
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_G", id, get_pcvar_num(cvar_firegrenades) ? "MOTD_ENABLED" : "MOTD_DISABLED")
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_H", id, get_pcvar_num(cvar_frostgrenades) ? "MOTD_ENABLED" : "MOTD_DISABLED")
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_I", id, get_pcvar_num(cvar_flaregrenades) ? "MOTD_ENABLED" : "MOTD_DISABLED")
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_J", id, get_pcvar_num(cvar_knockback) ? "MOTD_ENABLED" : "MOTD_DISABLED")
show_motd(id, motd)
}
por esto
Código PHP:
}
case 1: // Humans
{
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2")
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_A", g_hclass_hp[0])
if (get_pcvar_num(cvar_humanlasthp) > 0) len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_B", get_pcvar_num(cvar_humanlasthp))
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_C", g_hclass_spd[0])
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_D", floatround(g_hclass_grav[0]*800))
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_E", id, get_pcvar_num(cvar_infammo) > 0 ? get_pcvar_num(cvar_infammo) > 1 ? "MOTD_AMMO_CLIP" : "MOTD_AMMO_BP" : "MOTD_LIMITED")
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_F", get_pcvar_num(cvar_ammodamage))
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_G", id, get_pcvar_num(cvar_firegrenades) ? "MOTD_ENABLED" : "MOTD_DISABLED")
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_H", id, get_pcvar_num(cvar_frostgrenades) ? "MOTD_ENABLED" : "MOTD_DISABLED")
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_I", id, get_pcvar_num(cvar_flaregrenades) ? "MOTD_ENABLED" : "MOTD_DISABLED")
len += formatex(motd[len], sizeof motd - 1 - len, "%L", id, "MOTD_INFO2_J", id, get_pcvar_num(cvar_knockback) ? "MOTD_ENABLED" : "MOTD_DISABLED")
show_motd(id, motd)
}
Ahora vamos a
Código PHP:
// Function Human Me (player id, turn into a survivor)
humanme(id, survivor)
debajo veran esto
Código PHP:
// Pre user humanize forward
ExecuteForward(g_fwUserHumanized_pre, g_fwDummyResult, id)
y debajo colocan
Código PHP:
// Set selected human class
g_humanclass[id] = g_humanclassnext[id]
// If no class selected yet, use the first (default) one
if (g_humanclass[id] == HCLASS_NONE) g_humanclass[id] = 0
Mas abajo
Código PHP:
// Set Health [0 = auto]
if (survhealth == 0)
{
if (survbasehealth == 0)
fm_set_user_health(id, get_pcvar_num(cvar_humanhp)*fnGetAlive())
else
fm_set_user_health(id, survbasehealth*fnGetAlive())
}
else
fm_set_user_health(id, survhealth)
Reemplazan la linea
Código PHP:
fm_set_user_health(id, get_pcvar_num(cvar_humanhp)*fnGetAlive())
por esta
Código PHP:
fm_set_user_health(id, g_hclass_hp[0]*fnGetAlive())
Luego reemplazan esto
Código PHP:
// Human taking an antidote
// Set health
fm_set_user_health(id, get_pcvar_num(cvar_humanhp))
// Set gravity, unless frozen
if (!g_frozen[id]) set_pev(id, pev_gravity, g_hclass_grav[g_humanclass[id]])
por esto
Código PHP:
// Human taking an antidote
// Set health
fm_set_user_health(id, g_hclass_hp[g_humanclass[id]])
// Set gravity, unless frozen
if (!g_frozen[id]) set_pev(id, pev_gravity, g_hclass_grav[g_humanclass[id]])
Reemplazan esto
Código PHP:
// Set the right model
if (g_survivor[id])
copy(g_playermodel[id], sizeof g_playermodel[] - 1, model_survivor[random_num(0, sizeof model_survivor -1)])
else
{
if (get_pcvar_num(cvar_adminmodelshuman) && get_user_flags(id) & ACCESS_FLAG3)
copy(g_playermodel[id], sizeof g_playermodel[] - 1, model_admin[random_num(0, sizeof model_admin -1)])
else
copy(g_playermodel[id], sizeof g_playermodel[] - 1, model_human[random_num(0, sizeof model_human -1)])
}
por esto
Código PHP:
// Set the right model
if (g_survivor[id])
copy(g_playermodel[id], sizeof g_playermodel[] - 1, model_survivor[random_num(0, sizeof model_survivor -1)])
else
{
if (get_pcvar_num(cvar_adminmodelshuman) && get_user_flags(id) & ACCESS_FLAG3)
copy(g_playermodel[id], sizeof g_playermodel[] - 1, model_admin[random_num(0, sizeof model_admin -1)])
else
copy(g_playermodel[id], sizeof g_playermodel[] - 1, g_hclass_model[g_humanclass[id]])
}
Todabia en el humanme , reemplazan esto
Código PHP:
else
{
for (i = 0; i < sizeof model_human; i++)
if (equal(model_human[i], currentmodel)) already_has_model = true;
if (!already_has_model)
{
iRand = random_num(0, sizeof model_human -1)
copy(g_playermodel[id], sizeof g_playermodel[] - 1, model_human[iRand])
#if defined SET_MODELINDEX_OFFSET
fm_set_user_model_index(id, g_modelindex_human[iRand])
#endif
}
}
}
por esto
Código PHP:
else
{
if (equal(g_hclass_model[g_humanclass[id]], currentmodel)) already_has_model = true;
if (!already_has_model)
{
copy(g_playermodel[id], sizeof g_playermodel[] - 1, g_hclass_model[g_humanclass[id]])
#if defined SET_MODELINDEX_OFFSET
fm_set_user_model_index(id, g_hclass_modelindex[g_humanclass[id]])
#endif
}
}
}
Luego reemplazamos esto
por esto
Buscan esto
y lo reemplazan por esto
Buscamos esto
Y agregamos al igual que los ZM
HUD ahora , buscan
y reemplazan
por esto
Vamos al public // Last Zombie Check -check for last zombie and set its flag-
public fnCheckLastZombie()
Buscamos esto
remplazamos esto
por esto
Buscamos esto
Donde cierra la llave y termina el public ponemos esto
Abajo de
colocamos
abajo de
Colocamos
Buscan esto // Bingo!
Abajo de esto
ponen
Debajo de todo este public
colocamos
Ahora eliminamos cosas que no sirven
Vamos a
y borramos
En CVAR pointer tambien eliminamos esto
Eliminamos
Eliminamos
tambien esto
Eliminamos
En // CVARS - Humans
Elimianos
Código PHP:
// Restore normal gravity
if (g_zombie[id])
set_pev(id, pev_gravity, g_zclass_grav[g_zombieclass[id]])
else
set_pev(id, pev_gravity, get_pcvar_float(cvar_humangravity))
por esto
Código PHP:
// Restore normal gravity
if (g_zombie[id])
set_pev(id, pev_gravity, g_zclass_grav[g_zombieclass[id]])
else
set_pev(id, pev_gravity, g_hclass_grav[g_humanclass[id]])
Buscan esto
Código PHP:
else // Humans
{
set_pev(id, pev_viewmodel2, model_vknife_human)
set_pev(id, pev_weaponmodel2, "models/p_knife.mdl")
}
y lo reemplazan por esto
Código PHP:
else // Humans
{
static mdl[100]
formatex(mdl, sizeof mdl - 1, "models/zombie_plague/%s", g_hclass_clawmodel[g_humanclass[id]])
set_pev(id, pev_viewmodel2, mdl)
set_pev(id, pev_weaponmodel2, "")
}
Buscamos esto
Código PHP:
if (resetall)
{
g_ammopacks[id] = 0
g_zombieclass[id] = ZCLASS_NONE
g_zombieclassnext[id] = ZCLASS_NONE
g_damagedealt[id] = 0
WPN_AUTO_ON = 0
}
Y agregamos al igual que los ZM
Código PHP:
g_humanclass[id] = HCLASS_NONE
g_humanclassnext[id] = HCLASS_NONE
HUD ahora , buscan
Código PHP:
else // humans
{
red = 0
green = 0
blue = 255
if (g_survivor[id])
formatex(class, sizeof class - 1, "%L", ID_SHOWHUD,"CLASS_SURVIVOR")
else
formatex(class, sizeof class - 1, "%L", ID_SHOWHUD,"CLASS_HUMAN")
}
y reemplazan
Código PHP:
formatex(class, sizeof class - 1, "%L", ID_SHOWHUD,"CLASS_HUMAN")
por esto
Código PHP:
copy(class, sizeof class - 1, g_hclass_name[g_humanclass[id]])
Vamos al public // Last Zombie Check -check for last zombie and set its flag-
public fnCheckLastZombie()
Buscamos esto
Código PHP:
// Last human
if (!g_zombie[id] && !g_survivor[id] && is_user_alive(id) && fnGetHumans() == 1)
{
// Reward extra hp for last human?
if (!g_lasthuman[id]) fm_set_user_health(id, pev(id, pev_health)+get_pcvar_num(cvar_humanlasthp))
g_lasthuman[id] = true
}
else
g_lasthuman[id] = false
remplazamos esto
Código PHP:
if (!g_lasthuman[id]) fm_set_user_health(id, pev(id, pev_health)+get_pcvar_num(cvar_humanlasthp))
por esto
Código PHP:
if (!g_lasthuman[id]) fm_set_user_health(id, g_hclass_hp[g_humanclass[id]]+get_pcvar_num(cvar_humanlasthp))
Buscamos esto
Código PHP:
// Native: zp_register_zombie_class
Donde cierra la llave y termina el public ponemos esto
Código PHP:
// Native: zp_register_human_class
public native_register_human_class(const name[], const info[], const model[], const clawmodel[], hp, speed, Float:gravity)
{
// Reached human classes limit
if (g_hclass_i >= sizeof g_hclass_name)
return -1;
// Strings passed byref
param_convert(1)
param_convert(2)
param_convert(3)
param_convert(4)
// Add the class
copy(g_hclass_name[g_hclass_i], sizeof g_hclass_name[] - 1, name)
copy(g_hclass_info[g_hclass_i], sizeof g_hclass_info[] - 1, info)
copy(g_hclass_model[g_hclass_i], sizeof g_hclass_model[] - 1, model)
copy(g_hclass_clawmodel[g_hclass_i], sizeof g_hclass_clawmodel[] - 1, clawmodel)
g_hclass_hp[g_hclass_i] = hp
g_hclass_spd[g_hclass_i] = speed
g_hclass_grav[g_hclass_i] = gravity
// Precache custom models and retrieve the modelindex
new prec_mdl[100]
formatex(prec_mdl, sizeof prec_mdl - 1, "models/player/%s/%s.mdl", model, model)
g_hclass_modelindex[g_zclass_i] = engfunc(EngFunc_PrecacheModel, prec_mdl)
formatex(prec_mdl, sizeof prec_mdl - 1, "models/zombie_plague/%s", clawmodel)
engfunc(EngFunc_PrecacheModel, prec_mdl)
// Increase registered classes counter
g_hclass_i++
// Return id under which we registered the class
return g_hclass_i-1;
}
Abajo de
Código PHP:
db_zombieclass[db_slot_i] = db_zombieclass[id]
colocamos
Código PHP:
db_humanclass[db_slot_i] = db_humanclass[id]
abajo de
Código PHP:
db_zombieclass[id] = g_zombieclassnext[id] // zombie class
Colocamos
Código PHP:
db_humanclass[id] = g_humanclassnext[id] // human class
Buscan esto // Bingo!
Abajo de esto
Código PHP:
g_zombieclass[id] = db_zombieclass[i]
g_zombieclassnext[id] = db_zombieclass[i]
ponen
Código PHP:
g_humanclass[id] = db_humanclass[i]
g_humanclassnext[id] = db_humanclass[i]
Debajo de todo este public
Código PHP:
// Native: zp_set_user_zombie_class
public native_set_user_zombie_class(id, classid)
colocamos
Código PHP:
// Native: zp_get_user_human_class
public native_get_user_human_class(id)
{
return g_humanclass[id];
}
// Native: zp_set_user_human_class
public native_set_user_human_class(id, classid)
{
g_humanclassnext[id] = classid
}
Ahora eliminamos cosas que no sirven
Vamos a
Código PHP:
// Custom player models
y borramos
Código PHP:
for (i = 0; i < sizeof model_human; i++)
{
formatex(playermodel, sizeof playermodel - 1, "models/player/%s/%s.mdl", model_human[i], model_human[i])
g_modelindex_human[i] = engfunc(EngFunc_PrecacheModel, playermodel)
}
En CVAR pointer tambien eliminamos esto
Código PHP:
cvar_humanhp
Código PHP:
cvar_humanspd
Código PHP:
cvar_humangravity
Eliminamos
Código PHP:
new const model_human[][] = { "arctic", "guerilla", "leet", "terror", "gign", "gsg9", "sas", "urban" } // Human
Eliminamos
Código PHP:
new const model_vknife_human[] = { "models/v_knife.mdl" }
tambien esto
Código PHP:
new g_modelindex_human[MAX_MODELS_HUMAN]
Eliminamos
Código PHP:
engfunc(EngFunc_PrecacheModel, model_vknife_human)
En // CVARS - Humans
Elimianos
Código PHP:
cvar_humanspd = register_cvar("zp_human_speed", "240")
cvar_humanhp = register_cvar("zp_human_health", "100")
cvar_humangravity = register_cvar("zp_human_gravity", "1.0")
AHORA EL CHALECO
Debajo de // Set user healt and gravity ponemos
Buscamos
abajo de // set healt
Buscamos la linea y la dejamos asi
Masa abajo // Add the class agregamos abajo de la gravedad
en // Human Classes vars agregamos
Código PHP:
public fw_PlayerSpawn_Post(id)
Debajo de // Set user healt and gravity ponemos
Código PHP:
set_user_armor(id, g_hclass_armor[g_humanclass[id]])
Buscamos
Código PHP:
humanme(id, survivor)
abajo de // set healt
Código PHP:
set_user_armor(id, g_hclass_armor[g_humanclass[id]])
Buscamos la linea y la dejamos asi
Código PHP:
public native_register_human_class(const name[], const info[], const model[], const clawmodel[], hp, speed, Float:gravity, armor)
{
Masa abajo // Add the class agregamos abajo de la gravedad
Código PHP:
g_hclass_armor[g_hclass_i] = armor
en // Human Classes vars agregamos
Código PHP:
new g_hclass_armor[MAX_HUMAN_CLASSSES] // armor
LISTO LA PARTE DE CODEAR
Bueno ahora solo les hace falta agregar las natives al include para crear las clases humanas desde afuera para eso abrimos nuestro zombieplague.inc
que se en cuentra dentro de la carpeta include
Agregamos estas lineas
Cita:native zp_get_user_human_class(id)
native zp_set_user_human_class(id, classid)
native zp_register_human_class(const name[], const info[], const model[], const clawmodel[], health, speed, Float:gravity, armor)
native zp_get_human_class_id(const name[])
Guardan y ya pueden compilar sus clases humanas mediante plugin externo.
Tambien editar el zombie_plague.txt que se encuentra en amxmodx/data/lang
y escribir dentro de el
Cita:MENU_HCLASS = Elegir Clases Humanas
MENU_HCLASS_TITLE = Clases de Humanos
CMD_NOT_HCLASSES = Las Clases de Humanos estan deshabilitadas.
HUMAN_ATTRIB1 = Vida
HUMAN_ATTRIB2 = Velocidad
HUMAN_ATTRIB3 = Gravedad
HUMAN_ATTRIB4 = Chaleco
Bueno , mucho trabajo tengo los ojos cuadrados te ver que no me equivoque , si pasa algo me avisan saludos.