I am trying to attach a model to a player, I have the model in both the valve/models directory and cstrike/models called roots2.mdl
Here is the source:
Code:
#include <amxmodx>
#include <amxmisc>
#define TE_PLAYERATTACHMENT 124
new roots
public plugin_init() {
register_plugin("Roots Test", "1.0", "K2mia")
set_task(1.0, "test_sprite", 457)
}
public plugin_precache(){
roots = precache_model("models/roots2.mdl")
}
public test_sprite() {
new players[32], numofplayers, id, i
new origin[3]
get_players(players, numofplayers)
for (i = 0; i < numofplayers; i++){
id = players[i]
get_user_origin(id, origin)
client_print(id, print_chat, "Adding model ")
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_short(TE_PLAYERATTACHMENT)
write_entity(id)
write_coord( origin[2] + 50 )
write_short(roots)
write_short(100)
message_end()
}
set_task(10.0, "test_sprite", 457)
return PLUGIN_HANDLED
}
When the test_sprite() routine is called I see this in console:
No model 1200!
No model 1424!
I know these models exist, I saw the download message when I first connected and the .dml file was precached...
Anyone have the answer?
Thanks
-Mug