Raised This Month: $ Target: $400
 0% 

How to show permanent sprite?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 05-13-2012 , 07:58   How to show permanent sprite?
Reply With Quote #1

Like the title, how to show my custom sprite with origin permanently?
Randomize is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-13-2012 , 07:58   Re: How to show permanent sprite?
Reply With Quote #2

Make an entity with sprite model.
__________________
<VeCo> is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 05-13-2012 , 08:08   Re: How to show permanent sprite?
Reply With Quote #3

The define is TE_MODEL ?

Last edited by Randomize; 05-13-2012 at 08:10. Reason: change post
Randomize is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-13-2012 , 08:14   Re: How to show permanent sprite?
Reply With Quote #4

PHP Code:
static ent
ent  
create_entity("info_target")
if(
ent)
{
entity_set_string(ent,EV_SZ_classname,"info_sprite"// entity classname, put what you want here or leave it info_sprite...
entity_set_model(ent,"sprites/....spr"// path to the sprite
 
entity_set_int(ent,EV_INT_solid,SOLID_NOT// not solid
entity_set_int(ent,EV_INT_movetype,MOVETYPE_NONE// don't move
 
set_rendering(entkRenderFxNoDissipation0,0,0kRenderGlow255// put this to remove the black background of the sprite
 
entity_set_origin(ent,Float:{0.0,0.0,0.0}) // put your origin here : Float:{X , Y , Z}

Something like this, requires engine module.

You should also precache the sprite.
__________________

Last edited by <VeCo>; 05-13-2012 at 08:43.
<VeCo> is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 05-13-2012 , 08:28   Re: How to show permanent sprite?
Reply With Quote #5

okay i will try thanks
Randomize is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 05-13-2012 , 08:58   Re: How to show permanent sprite?
Reply With Quote #6

Well, Help please

Quote:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <engine>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"


public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /sprite","ShowSprite")
}
public plugin_precache()
{
sprite = precache_model("sprites/weapon.spr")
}
public ShowSprite(id){
static ent
ent = create_entity("info_target")
if(ent)
{
entity_set_string(ent,EV_SZ_classname,"info_s prite") // entity classname, put what do you want here or leave it info_sprite...
entity_set_model(ent,"sprites/weapon.spr") // path to the sprite

entity_set_int(ent,EV_INT_solid,SOLID_NOT) // not solid
entity_set_int(ent,EV_INT_movetype,MOVETYPE_N ONE) // don't move

set_rendering(ent, kRenderFxNoDissipation, 0,0,0, kRenderGlow, 255) // put this to remove the black background of the sprite

entity_set_origin(ent,Float:{0.0,0.0,0.0}) // put your origin here : Float:{X , Y , Z}
}
}
Randomize is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-13-2012 , 09:02   Re: How to show permanent sprite?
Reply With Quote #7

Try this:

PHP Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <amxmisc>
#include <engine>
#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "author"
 
public plugin_init() {
register_plugin(PLUGINVERSIONAUTHOR)
register_clcmd("say /sprite","ShowSprite")
}
public 
plugin_precache()
{
precache_model("sprites/weapon.spr"
}
public 
ShowSprite(id){
static 
Float:origin[3]
entity_get_vector(id,EV_VEC_origin,origin)
 
static 
ent
ent 
create_entity("info_target")
if(
ent)
{
entity_set_string(ent,EV_SZ_classname,"info_sprite"// entity classname, put what do you want here or leave it info_sprite...
entity_set_model(ent,"sprites/weapon.spr"// path to the sprite
entity_set_int(ent,EV_INT_solid,SOLID_NOT// not solid
entity_set_int(ent,EV_INT_movetype,MOVETYPE_NONE// don't move
set_rendering(entkRenderFxNoDissipation0,0,0kRenderGlow255// put this to remove the black background of the sprite
entity_set_origin(ent,origin// put your origin here : Float:{X , Y , Z}
}

It will create the sprite at the current player's position.

Also you don't need the "sprite" variable.
__________________

Last edited by <VeCo>; 05-13-2012 at 09:02.
<VeCo> is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 05-13-2012 , 09:11   Re: How to show permanent sprite?
Reply With Quote #8

oh okay.. Tq, i'll try it right now
Randomize is offline
Randomize
BANNED
Join Date: May 2012
Location: in your heart
Old 05-13-2012 , 09:26   Re: How to show permanent sprite?
Reply With Quote #9

it doesn't want to show.. i put this origin entity_set_origin(ent,Float:{-1.0,0.0,0.0})
Randomize is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 05-13-2012 , 09:28   Re: How to show permanent sprite?
Reply With Quote #10

Because this origin is outside the map... My code shows the sprite at the current position of the player, or where/how exaclty do you want it to be shown?
__________________
<VeCo> is offline
Reply



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 00:29.


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