I have this Code, used to enhance the messages in SvenCoop.
(In CS that would be things like "Fire in the Hole!")
Also, I want a sprite to appear above the players head,
which is the part which does not work. Please have a look someone:
Code:
#include <amxmodx>
#include <amxmisc>
#define VERSION "1.0"
new bool:g_blocked[33]
new g_whatis_scvao_followme
public plugin_init()
{
register_plugin("SC Talk AddOn",VERSION,"Silencer")
register_concmd("scvao_followme","SCVAO_FollowMe")
g_whatis_scvao_followme=precache_model("sprites/scvao_followme.spr")
}
public plugin_precache()
{
precache_model("sprites/scvao_followme.spr")
precache_sound("speech/scvao_followme.wav")
}
public SCVAO_ReAllow(id)
{
g_blocked[id]=false
}
public SCVAO_UnFollowMe(id)
{
message_begin(MSG_ALL,SVC_TEMPENTITY)
write_byte(125)
write_byte(id)
message_end()
}
public SCVAO_FollowMe(id)
{
if(!g_blocked[id])
{
message_begin(MSG_ALL,SVC_TEMPENTITY)
write_byte(124)
write_byte(id)
write_coord(65)
write_short(g_whatis_scvao_followme)
write_short(600)
message_end()
emit_sound(id,CHAN_STATIC,"speech/scvao_followme.wav",VOL_NORM,ATTN_NORM,0,PITCH_NORM)
set_task(2.0,"SCVAO_UnFollowMe",id)
set_task(4.0,"SCVAO_ReAllow",id)
}
else
{
client_print(id,print_notify,"You have to wait 4 seconds before performing this action again.")
}
}
The *.wav plays, but the sprite does not appear. It says "No Model 0.",
as a notify message in the upper right corner of the screen.
__________________