Raised This Month: $ Target: $400
 0% 

Hud Sprite Not Working


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 07-30-2017 , 08:35   Hud Sprite Not Working
Reply With Quote #1

Why hud sprite deosnt work. When i call function nothing happens, no error console/logs.
Sprite precaches but this function doesnt work. It's working only in CSO?

P.S.I used client print to debug and the lines in the function are parsed from start to end but there nothing appears on screen.
It doesnt even show in log or console some kind of error like "invalid message id .." or something. Just nothing happens like the lines are empty....

PHP Code:
public DisplaySprite(id, const iSprite) {    
    if(!
is_user_connected(id))
    return 
PLUGIN_CONTINUE;
    
    static 
origin[3];
    
get_user_origin(idorigin);
    
    
message_begin(MSG_PVSSVC_TEMPENTITYorigin);
    
write_byte(TE_SPRITE);
    
write_coord(origin[0]);
    
write_coord(origin[1]);
    
write_coord(origin[2]+65);
    
write_short(iSprite); 
    
write_byte(10);
    
write_byte(250);
    
message_end();
    
    return 
PLUGIN_CONTINUE;


Last edited by siriusmd99; 07-30-2017 at 08:47.
siriusmd99 is offline
TBagT
Member
Join Date: Aug 2016
Location: Lithuania
Old 07-30-2017 , 10:57   Re: Hud Sprite Not Working
Reply With Quote #2

Not too much to go on, but for starters, do you call this function by set_task ?
Next try:
PHP Code:
public DisplaySprite(id, const iSprite) { 

PHP Code:
public DisplaySprite(id, const iSprite[ ]) { 
If you're using set_task

PHP Code:
public DisplaySprite( const iSprite[ ], id ) { 
Check how many frames does your sprite have, because TE_SPRITE only plays one cycle of the sprite.
TBagT is offline
siriusmd99
Veteran Member
Join Date: Oct 2013
Location: Republic of Moldova
Old 07-30-2017 , 14:46   Re: Hud Sprite Not Working
Reply With Quote #3

Quote:
Originally Posted by TBagT View Post
Next try:
PHP Code:
public DisplaySprite(id, const iSprite) { 

PHP Code:
public DisplaySprite(id, const iSprite[ ]) { 
If you're using set_task

PHP Code:
public DisplaySprite( const iSprite[ ], id ) { 
Your script is wrong. write_short is writing byte here, not string. It writes precached model's id.
I'm not using task and whats the point of reversing parameters order?

Quote:
Check how many frames does your sprite have, because TE_SPRITE only plays one cycle of the sprite.
Only one frame.

Last edited by siriusmd99; 07-30-2017 at 14:46.
siriusmd99 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-31-2017 , 09:50   Re: Hud Sprite Not Working
Reply With Quote #4

Show the sprite your trying to play it might depends on the frames and on how the function is called

write_short(iSprite);
write_byte(10); and try enlarging the scale to 50...
write_byte(250);
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-31-2017 at 09:58.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 22:44.


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