AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Displaying an image (https://forums.alliedmods.net/showthread.php?t=56452)

Toster v2.1 06-14-2007 05:15

Displaying an image
 
Is there any way to display an image on client's screen (like the freezing img when sinking under water)

Alka 06-14-2007 05:46

Re: Displaying an image
 
Like in this tut? :D =>> http://forums.alliedmods.net/showthread.php?t=52529

Toster v2.1 06-15-2007 08:20

Re: Displaying an image
 
Thx!

-Edit

Is it possible to add a custom sprite?

Styles 06-15-2007 20:56

Re: Displaying an image
 
It should be. I think you can just precatch on and use that.

Toster v2.1 08-15-2007 10:20

Re: Displaying an image
 
1 Attachment(s)
didn't work....

Code:

#include <amxmodx>
#include <fakemeta>


new iconstatus
new spr[] = "sprites/s.spr"

public plugin_init() {
    register_plugin("Status Icon","0.1","SAMURAI")
   
    iconstatus = get_user_msgid("StatusIcon")
   
    register_clcmd("+ico", "show")
    register_clcmd("-ico", "hide") 
}

public plugin_precache()
{
    precache_model(spr)
}

public show(id)
{
    message_begin(MSG_ONE,iconstatus,{0,0,0},id)
    write_byte(1)
    write_string(spr)
    write_byte(0)
    write_byte(255)
    write_byte(0)
    message_end()
   


public hide(id)
{
    message_begin(MSG_ONE,iconstatus,{0,0,0},id)
    write_byte(0)
    write_string(spr)
    write_byte(0)
    write_byte(255)
    write_byte(0)
    message_end()
   
}

Maybe I did something wrong? I made a sprite just like one of the originals... :(

Drak 08-15-2007 14:22

Re: Displaying an image
 
I had problems to, I couldn't get it to work on any other mod besides CS.
What are you trying it on?

Toster v2.1 08-15-2007 15:28

Re: Displaying an image
 
CS....

Drak 08-15-2007 15:31

Re: Displaying an image
 
Well for one, you don't have to precache the sprite, the sprites that you can make show-up on the hud are already defined, and precached.
They have names there defined under, like "dmg_gas, dmg_shock,etc etc".
You have to use thoes names.

So change:
Code:
public show(id) {     message_begin(MSG_ONE,iconstatus,{0,0,0},id)     write_byte(1)     write_string(spr)     write_byte(0)     write_byte(255)     write_byte(0)     message_end()     }
To something like:
Code:
public show(id) {     message_begin(MSG_ONE,iconstatus,{0,0,0},id)     write_byte(1)     write_string("dmg_bio")     write_byte(0)     write_byte(255)     write_byte(0)     message_end()     }

Toster v2.1 08-16-2007 03:47

Re: Displaying an image
 
I know that.... I want to show a custom sprite!

Drak 08-16-2007 15:45

Re: Displaying an image
 
Quote:

Originally Posted by Toster v2.1 (Post 518832)
I know that.... I want to show a custom sprite!

You can't.... There's already been a long discussion about this. It's imposable.
All the sprites that can be shown are already defined.


All times are GMT -4. The time now is 10:29.

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