AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   No Model 0. (https://forums.alliedmods.net/showthread.php?t=48430)

Silencer123 12-11-2006 17:42

No Model 0.
 
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.

P34nut 12-11-2006 17:44

Re: No Model 0.
 
Code:
public plugin_precache() {     precache_model("sprites/scvao_followme.spr")     precache_sound("speech/scvao_followme.wav") }
Replace it with
Code:
public plugin_precache() {     g_whatis_scvao_followme = precache_model("sprites/scvao_followme.spr")     precache_sound("speech/scvao_followme.wav") }

Silencer123 12-11-2006 17:46

Re: No Model 0.
 
So that will set g_whatis_scvao_followme to whatever the precache_model thing is
and actually also precache the sprite file? Weird! Thanks, I will try!
;-)


All times are GMT -4. The time now is 06:58.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.