I would like to add a player model into my hero, I tryed much and added this ( +the whole other effects of the hero ):
Code:
new gmorphed[SH_MAXSLOTS+1]
//----------------------------------------------------------------------------------------------
{
// NEW ROUND
register_event("ResetHUD","newSpawn","b") //Called on a New Spawn
//Death of Player
register_event("DeathMsg", "jetstream_death", "a")
}
//----------------------------------------------------------------------------------------------
public plugin_precache()
{
precache_model("models/player/JetStream/sh_jetstream.mdl")
}
//----------------------------------------------------------------------------------------------
jetstream_init()
{
if ( hasPowers ) //Check if person selected this hero
{
jetstream_tasks(id)
}
if ( !hasPowers && is_user_connected(id) ) //Check if person dropped this hero
{
//Do stuff to him if he just droppped it
jetstream_unmorph(id)
}
}
//----------------------------------------------------------------------------------------------
public newSpawn(id)
{
if ( gHasjetstreamPower[id] && is_user_alive(id) && shModActive() )
{
jetstream_tasks(id)
}
return PLUGIN_HANDLED
}
//----------------------------------------------------------------------------------------------
public jetstream_tasks(id)
{
set_task(1.0, "jetstream_morph", id)
}
//----------------------------------------------------------------------------------------------
public jetstream_morph(id)
{
if ( gmorphed[id] || !is_user_alive(id) ) return
#if defined AMXX_VERSION
cs_set_user_model(id, "sh_jetstream")
#else
CS_SetModel(id, "sh_jetstream")
#endif
// Message
set_hudmessage(50, 205, 50, -1.0, 0.40, 2, 0.02, 4.0, 0.01, 0.1, 7)
show_hudmessage(id, "You now wear your JetStream armor.")
gmorphed[id] = true
}
//----------------------------------------------------------------------------------------------
public jetstream_unmorph(id)
{
if ( gmorphed[id] ) {
// Message
set_hudmessage(50, 205, 50, -1.0, 0.40, 2, 0.02, 4.0, 0.01, 0.1, 7)
show_hudmessage(id, "You are not wearing your JetStream armor.")
#if defined AMXX_VERSION
cs_reset_user_model(id)
#else
CS_ClearModel(id)
#endif
gmorphed[id] = false
}
}
//----------------------------------------------------------------------------------------------
public jetstream_death()
{
new id = read_data(2)
jetstream_unmorph(id)
}
//----------------------------------------------------------------------------------------------
public client_connect(id)
{
gmorphed[id] = false
}
//----------------------------------------------------------------------------------------------
But still it just doesnt work.. Can someone help me or put the code for add a player model?
__________________