Raised This Month: $32 Target: $400
 8% 

ShadowIdX


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
safetymoose
Senior Member
Join Date: Feb 2015
Old 11-26-2015 , 18:23   ShadowIdX
Reply With Quote #1

So i'm using ShadowIdX to remove the shadows of the players using the following code:

PHP Code:
msg_shadow get_user_msgid ("ShadowIdx"
PHP Code:
message_begin (MSG_ONE_UNRELIABLEmsg_shadow_id);
write_long (0);
message_end (); 
Now the problem i am facing is that the console starts flooding sprite errors after i enable shadows again through:

PHP Code:
message_begin (MSG_ONE_UNRELIABLEmsg_shadow_id);
write_long (1);
message_end (); 
The console floods this error:
PHP Code:
Sprite:  no pSprite!!!
Sprite:  no pSprite!!!
Sprite:  no pSprite!!!
Sprite:  no pSprite!!! 
And the players dont have their shadows restored. What am i doing wrong?

Last edited by safetymoose; 11-26-2015 at 18:24.
safetymoose is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 11-26-2015 , 18:35   Re: ShadowIdX
Reply With Quote #2

Shouldn't you send this message to all players? Currently you are hiding only for the one person.
__________________

NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
safetymoose
Senior Member
Join Date: Feb 2015
Old 11-26-2015 , 18:38   Re: ShadowIdX
Reply With Quote #3

Yes i am sending it to all players. All players receive the message, but the problem is it fails to restore the shadows and spits out messages that sprites are missing. I'm guessing that the sprite missing is the shadow sprite?

The current code was my second method, the first method i used MSG_BROADCAST and 0 as id.
PHP Code:
message_begin (MSG_BROADCASTmsg_shadow_0);
write_long (1);
message_end (); 
still the same result...

Last edited by safetymoose; 11-26-2015 at 18:40.
safetymoose is offline
safetymoose
Senior Member
Join Date: Feb 2015
Old 11-27-2015 , 13:15   Re: ShadowIdX
Reply With Quote #4

I have confirmed that the "Sprite: no pSprite!!!" error happens when i try toggle the shadows back on using
PHP Code:
message_begin (MSG_BROADCASTmsg_shadow_0);
write_long (1);
message_end (); 
Is there something wrong with this function, does it unprecache the shadow sprite? Can anyone help me get around this?
safetymoose is offline
NiHiLaNTh
Way Past Expiration
Join Date: May 2009
Location: Latvia
Old 11-27-2015 , 19:41   Re: ShadowIdX
Reply With Quote #5

looking to the reverse-engineered client.dll, it seems that the only message param is sprite index.
It means, that when you want to hide it, you need to send 0 as a param.
But when you need to show it, you need to send sprite (sprites/shadow_circle.spr) index.

Also it seems I was mistaken at the beginning. You can safely send it to the one player, instead of sending to everyone.
__________________


Last edited by NiHiLaNTh; 11-27-2015 at 19:42.
NiHiLaNTh is offline
Send a message via Skype™ to NiHiLaNTh
safetymoose
Senior Member
Join Date: Feb 2015
Old 11-27-2015 , 21:32   Re: ShadowIdX
Reply With Quote #6

You're right, i precached the shadow sprite and i set it as a parameter, and it works perfectly. This also brings an opportunity to introduce custom shadow sprites.

Thank you very much NiHiLaNTh
safetymoose is offline
wicho
Veteran Member
Join Date: Feb 2012
Location: GuateAmala
Old 01-15-2016 , 02:52   Re: ShadowIdX
Reply With Quote #7

Sorry to revive but i use a code to hide the players shadows but i have the same problem as safetymoose the console start flooding this message Sprite: no pSprite!!!, how I can fix it?

code:

PHP Code:
#include < amxmodx > 

#pragma semicolon 1 

#define PLUGIN "No Shadows" 
#define VERSION "0.0.1" 

public plugin_init() 

    
register_pluginPLUGINVERSION"ConnorMcLeod" ); 

    
set_msg_block(get_user_msgid("ShadowIdx"), BLOCK_SET); 

wicho is offline
safetymoose
Senior Member
Join Date: Feb 2015
Old 01-15-2016 , 14:55   Re: ShadowIdX
Reply With Quote #8

I got that error message when it tried to activate the shadows again using the wrong sprite index.

Here is how you should enable/disable player's shadows correctly:

PHP Code:
// Get the path of the shadow sprite
new shadow_spr[] = "sprites/shadow_circle.spr"
new gShadowSpr
new msg_shadow

// In plugin_precache, precache the sprite to get the index
public plugin_precache()
{
          
msg_shadow get_user_msgid ("ShadowIdx")
          
gShadowSpr precache_model(shadow_spr)
}


// And when you want to enable/disable shadows, just send the correct message
message_begin (MSG_BROADCASTmsg_shadow_0);
write_long (0);  // 0 - disable, gShadowSpr - enable
message_end (); 

Last edited by safetymoose; 01-15-2016 at 14:59.
safetymoose 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 21:25.


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