14/01/2014, 11:57 AM
Bueno gente les voy a dejar una forma facil de hacer hats por reset, aunque no sea la mejor sirve ya que vi varios post sobre el tema...
Empecemos:
Aca les dejo algunos models de hats para los que necesiten:
http://www.mediafire.com/download/z0tppx...3/hats.rar
Eso es todo y espero que les haya sido de utilidad
Empecemos:
Código PHP:
// Primero agregamos estas variables que vendrian a ser la entidad y los modelos de nuestros hats
new g_ent[33]
new const hat_1[] = { "models/hats/dunce.mdl" }
new const hat_2[] = { "models/hats/headphones.mdl" }
new const hat_3[] = { "models/hats/pbbears.mdl" }
Código PHP:
// Despues nos vamos al public plugin_precache() y precacheamos los modelos
engfunc(EngFunc_PrecacheModel, hat_1)
engfunc(EngFunc_PrecacheModel, hat_2)
engfunc(EngFunc_PrecacheModel, hat_3)
Código PHP:
// De ahi nos vamos a public fw_PlayerSpawn_Post(id) y agregamos los siguiente arriba de // Show custom buy menu?
new ent = g_ent[id]
new infotarget = engfunc(EngFunc_AllocString, "info_target")
if (!pev_valid(ent))
{
engfunc(EngFunc_RemoveEntity, ent)
g_ent[id] = ent = engfunc (EngFunc_CreateNamedEntity, infotarget)
set_pev(ent, pev_movetype, MOVETYPE_FOLLOW)
set_pev(ent, pev_aiment, id)
// Aca indicamos que a partir del primer reset en adelante use el hat_1, luego a partir del reset 3 en adelante use el hat_2 y a partir del reset 5 use el hat_3
if (g_isalive[id]) // Nos fijamos si el usuario que lo va a utilizar esta vivo
{
if (g_reset[id] >= 1)
engfunc(EngFunc_SetModel, ent, hat_1)
if (g_reset[id] >= 3)
engfunc(EngFunc_SetModel, ent, hat_2)
if (g_reset[id] >= 5)
engfunc(EngFunc_SetModel, ent, hat_3)
}
}
Aca les dejo algunos models de hats para los que necesiten:
http://www.mediafire.com/download/z0tppx...3/hats.rar
Eso es todo y espero que les haya sido de utilidad