AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Showing a sprite above player? (https://forums.alliedmods.net/showthread.php?t=49173)

hlstriker 12-29-2006 01:55

Showing a sprite above player?
 
Hi, I was wondering how I could show a sprite above a players head for about 2 seconds. I saw in another plugins code they did the same thing. I need to know how to make the sprite show for only 2 seconds though. Here is the code from the other plugin...

Code:
public showspr(id){     if(!is_user_connected(id) || !is_user_alive(id)) return PLUGIN_HANDLED     new i     new players = get_maxplayers()     message_begin(MSG_ALL,SVC_TEMPENTITY)     write_byte(125)     write_byte(id)     message_end()     for (i = 0 ; i < players ; i++)         {         if(i != id && is_user_connected(i))             {             message_begin(MSG_ONE_UNRELIABLE,SVC_TEMPENTITY,{0,0,0},i)             write_byte(124)             write_byte(id)             write_coord(65)             write_short(spritename)             write_short(9)             message_end()         }     }     set_task(0.8,"showspr",id)     return PLUGIN_CONTINUE }

jim_yang 12-29-2006 02:04

Re: Showing a sprite above player?
 
message_begin(MSG_ALL,SVC_TEMPENTITY)
write_byte(124)
write_byte(id)
write_coord(65)
write_short(spritename)
write_short(20)
message_end()

hlstriker 12-29-2006 02:10

Re: Showing a sprite above player?
 
Thanks very much :)


All times are GMT -4. The time now is 22:27.

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