Raised This Month: $151 Target: $400
 37% 

sprite above player / kicks off


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pamaliska
Senior Member
Join Date: Apr 2006
Location: Edinburgh, UK
Old 06-10-2008 , 15:24   sprite above player / kicks off
Reply With Quote #1

What is wrong with this code as it kicks me off my server with an error message:
Code:
No model 26996!
Host_Error: UserMsg: Not Present on Client 22
Code:
///........ new spr[] = "sprites/critical.spr";     ///........ public show_sprite(id,idattacker) {         if(!is_user_connected(idattacker) || !is_user_alive(idattacker)) return PLUGIN_HANDLED                 message_begin(MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,{0,0,0},idattacker)         write_byte(124)         write_byte(id)         write_coord(65)         write_string(spr[idattacker])         write_short(20)         message_end()          return PLUGIN_CONTINUE }   ///..........   public plugin_precache() {         precache_model(spr) }

P.S. The sprite is being precached and downloads just fine.
Pamaliska is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-10-2008 , 15:30   Re: sprite above player / kicks off
Reply With Quote #2

Code:
new g_iSprite; ... g_iSprite = precache_model("sprites/critical.spr"); ...   message_begin(MSG_ALL, SVC_TEMPENTITY); //this show sprite to all. write_byte(TE_PLAYERATTACHMENT); //hax? write_byte(id); //index of player write_coord(65); //z offset write_short(g_iSprite); //this is a pointer for model write_short(2 * 10); //2 sec. in 0.10's message_end();
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Pamaliska
Senior Member
Join Date: Apr 2006
Location: Edinburgh, UK
Old 06-10-2008 , 16:12   Re: sprite above player / kicks off
Reply With Quote #3

Thank you. It works now.
Pamaliska is offline
Pamaliska
Senior Member
Join Date: Apr 2006
Location: Edinburgh, UK
Old 06-11-2008 , 10:09   Re: sprite above player / kicks off
Reply With Quote #4

Hate to double-post but hey.....
How would I show that sprite just to a certain group of players (not one) who are let's say "new bool:able_to_see" true?
Pamaliska is offline
Alka
AMX Mod X Plugin Approver
Join Date: Dec 2006
Location: malloc(null)
Old 06-11-2008 , 10:14   Re: sprite above player / kicks off
Reply With Quote #5

I don't think is possible...
__________________
Still...lovin' . Connor noob! Hello
Alka is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 06-11-2008 , 10:20   Re: sprite above player / kicks off
Reply With Quote #6

This is unrelated to your problem, but there are no circumstances where anyone would ever need to check if is_user_connected() and is_user_alive() because is_user_alive() checks if the the player is connected before checking if they're alive. ;)
__________________
No support via PM.
Lee is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:56.


Powered by vBulletin®
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Theme made by Freecode