Raised This Month: $51 Target: $400
 12% 

Sprite Instead Of Model


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
S34Qu4K3
Veteran Member
Join Date: Jan 2010
Location: Galicia
Old 08-31-2010 , 07:23   Sprite Instead Of Model
Reply With Quote #1

I have this code
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <fakemeta_util>
#include <xs>
#include <engine>

#define PLUGIN "Test"
#define VERSION "1.0"
#define AUTHOR "S34"

enum _:Box MinsMaxs };
enum _:Axis XY};

new 
g_classname[] = "env_sprite"
new g_model[] = "sprites/Emi/asd.spr"

public plugin_precache() precache_model(g_model)

public 
plugin_init() 
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /portal""jojo_rlz")
    
    
register_touch(g_classname,"player","Touch")
}

public 
jojo_rlz(id)
{
    new 
Float:origin[3]
    
fm_get_aim_origin(idorigin)
    
    
entidad_solida(originid)
    
    return 
PLUGIN_HANDLED;
}

stock entidad_solida(Float:origin[3], id)
{
    new 
Float:size[Box][Axis], Float:abssize[Box][Axis], entity
    
    entity 
engfunc(EngFunc_CreateNamedEntityengfunc(EngFunc_AllocString"env_sprite"))
    
    
set_pev(entitypev_classnameg_classname)
    
set_pev(entitypev_movetypeMOVETYPE_NONE)
    
    
engfunc(EngFunc_SetOriginentityorigin)
    
    
engfunc(EngFunc_SetModelentityg_model)

    
set_pev(entitypev_solidSOLID_TRIGGER)
    
    
size[Mins] = Float:{ -20.0, -20.0, -20.0 }
    
size[Maxs] = Float:{ 20.020.020.0 }
    
    
engfunc(EngFunc_SetSizeentitysize[Mins], size[Maxs])
    
    
entity_set_edict(entity,EV_ENT_owner,id)
    
    
xs_vec_add(originsize[Mins], abssize[Mins])
    
xs_vec_add(originsize[Maxs], abssize[Maxs])
    
    
set_pev(entitypev_absminabssize[Mins])
    
set_pev(entitypev_absmaxabssize[Maxs])
}  
public 
TouchCar(Ptd,Ptr)
{
    new 
Owner entity_get_edict(Ptd,EV_ENT_owner)
    if(
Owner != Ptr)
        return
   
    
client_print(Ptr,print_chat,"Wait...")

The plugin puts the sprite but it has a black background and is not animated (http://img823.**************/img823/1673/codec.jpg), when i touches it, nothing happens and the sprites are allways inside teh wall

Any help?


PD : Srry for my englisht T_T
__________________

- ASM2SMA: Experimental AMXX Assembly encoder

- Defuse Bar Fix

Quote:
Originally Posted by Arkshine
I DON'T WANT TO SEE NOOOOOOOOOOOOOOO AHHHHH. MY EYES ARE ALREADY HURT.

Last edited by S34Qu4K3; 08-31-2010 at 09:26.
S34Qu4K3 is offline
LiToO
Member
Join Date: Sep 2010
Old 08-01-2011 , 10:23   Re: Sprite Instead Of Model
Reply With Quote #2

wordless

Last edited by LiToO; 08-02-2011 at 17:52.
LiToO is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-01-2011 , 10:45   Re: Sprite Instead Of Model
Reply With Quote #3

You need to set pev_spawnflags to SF_SPRITE_STARTON for animation and set the proper transparency type, alpha or additive to eliminate the black background, try alpha first then additive.


Quote:
Originally Posted by LiToO View Post
WOW Nice plugins, very very God
WTF ?
__________________
Hunter-Digital is offline
avril-lavigne
Banned
Join Date: Apr 2009
Old 08-01-2011 , 13:20   Re: Sprite Instead Of Model
Reply With Quote #4

set_pev(entity, pev_movetype, MOVETYPE_NONE)
try MOVETYPE_TOSS , MOVETIPE_NOCLIP or others
__________________
VDS in Europe 1 gb/s unmetered.Any configurations.
I accept Paypal, Moneybookers,etc
avril-lavigne is offline
abdul-rehman
Veteran Member
Join Date: Jan 2010
Location: Khi, Pakistan
Old 08-01-2011 , 15:27   Re: Sprite Instead Of Model
Reply With Quote #5

You also need to spawn the entity dllfunc(Dllfunc_Spawn, ent)
__________________

My Plugins For ZP

Inactive due to College and Studies
abdul-rehman is offline
Send a message via Yahoo to abdul-rehman Send a message via Skype™ to abdul-rehman
yokomo
Surprise Ascot!
Join Date: May 2010
Location: Malaysia
Old 08-01-2011 , 15:33   Re: Sprite Instead Of Model
Reply With Quote #6

I found this code by prodx he create an entity using .spr
PHP Code:
        set_pev(iEntpev_classname"buntagorila")
        
set_pev(iEnt,pev_originorigin)
        
engfunc(EngFunc_SetModeliEntbunta_spr)
        
set_pev(iEntpev_scaleget_pcvar_float(CVAR_SPR_SCALE))
        
set_rendering(iEntkRenderFxNone000kRenderTransAdd255)
        
set_pev(iEntpev_solidSOLID_TRIGGER)
        
engfunc(EngFunc_SetSizeiEntFloat:{-10.0, -10.00.0}, Float:{10.010.020.0})
        
set_pev(iEntpev_iuser10)
        
set_pev(iEntpev_ownerid
To get rid of black layout you need to add this render:
PHP Code:
set_rendering(iEntkRenderFxNone000kRenderTransAdd255
Hope it will help ya.

**Edited**
Quote:
WOW Nice plugins, very very God
LOLed at this WTF he said very very God. Hurmmm bad boy.
__________________
Team-MMG CS1.6 Servers:
✅ MultiMod -- 103.179.44.152:27016
✅ Zombie Plague -- 103.179.44.152:27015
✅ Zombie Escape -- 103.179.44.152:27017
✅ Klassik Kombat -- 103.179.44.152:27018
✅ Boss-Battle -- 103.179.44.152:27019

Last edited by yokomo; 08-01-2011 at 15:37. Reason: lol for awhile
yokomo 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 16:14.


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