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

Glow


Post New Thread Reply   
 
Thread Tools Display Modes
gubka
Veteran Member
Join Date: Jan 2012
Location: Russia
Old 03-17-2016 , 14:09   Re: Glow
Reply With Quote #11



Now after antidot i see all entities in one place , i chandge code here
Quote:
public Action OnShouldDisplay(int Ent, int Client)
{
return (!gZombie[Client] && IsValidEntity(Ent)) ? Plugin_Handled : Plugin_Continue;
}
__________________
gubka is offline
Send a message via ICQ to gubka
gubka
Veteran Member
Join Date: Jan 2012
Location: Russia
Old 03-17-2016 , 14:30   Re: Glow
Reply With Quote #12

And when i use TAB+ALT (go to descop) and after in the game, wherything is OK ? This is bug?
__________________
gubka is offline
Send a message via ICQ to gubka
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 03-17-2016 , 14:33   Re: Glow
Reply With Quote #13

I'm surprised how does your server work.
There is a big problem with that (server freezes):
int CreatePlayerModelProp(int client, char[] sModel)
{
RemoveSkin(client);
}

Bad practice to remove entity before spawning it quickly. In your case.

You need to get back entity from reference when removing it:
PHP Code:
public void RemoveSkin(int client
{
    
int entity EntRefToEntIndex(gPlayerModels[client]);
    if(
entity != INVALID_ENT_REFERENCE && entity != && IsValidEdict(entity)) 
    {
        
AcceptEntityInput(entity"Kill");
        
gPlayerModels[client] = INVALID_ENT_REFERENCE;
    }

Yours todo list:
+ Teleport entity
+ set target name
+ don't use that removeSkin function everywhere, use it logically
__________________

Last edited by xbatista; 03-17-2016 at 14:49.
xbatista is offline
Send a message via Skype™ to xbatista
gubka
Veteran Member
Join Date: Jan 2012
Location: Russia
Old 03-17-2016 , 14:55   Re: Glow
Reply With Quote #14

Thanks it work better, i used code from here https://forums.alliedmods.net/showthread.php?p=2140384

PHP Code:
public void RemoveSkin(int client
{
    
int entity EntRefToEntIndex(gPlayerModels[client]);
    if(
entity != INVALID_ENT_REFERENCE && entity != && IsValidEdict(entity)) 
    {
        
AcceptEntityInput(entity"Kill");
        
gPlayerModels[client] = INVALID_ENT_REFERENCE;
    }
}  

public 
Action OnShouldDisplay(int Entint Client
{
    if(!
IsValidEdict(Ent))
        return 
Plugin_Handled;
    
    if(
IsPlayerExist(Client) && gZombie[Client])
        return 
Plugin_Continue;

    return 
Plugin_Handled;

Now when i use antidot all entities go to one place on map in the wall , i also check it on cs_italy
when after it , i become zombie all glow entites go to humans' models

Like here
Spoiler
__________________

Last edited by gubka; 03-17-2016 at 15:08.
gubka is offline
Send a message via ICQ to gubka
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 03-17-2016 , 15:16   Re: Glow
Reply With Quote #15

Try to unhook setTransmit before removing entity.
PHP Code:
public void RemoveSkin(int client
{
    
int entity EntRefToEntIndex(gPlayerModels[client]);
    if(
entity != INVALID_ENT_REFERENCE && entity != && IsValidEdict(entity)) 
    {

        
SDKUnhook(entitySDKHook_SetTransmitOnShouldDisplay)        
        
AcceptEntityInput(entity"Kill");
        
gPlayerModels[client] = INVALID_ENT_REFERENCE;
    }

Try checking on SetTransmit(OnShouldDisplay) EntRefToEntIndex(gPlayerModels[Client]) == Ent.

Changing team can cause those bugs, so before changing team remove entity and create new for that player.
It really depends by your mod what do you want to do.
__________________

Last edited by xbatista; 03-17-2016 at 15:38.
xbatista is offline
Send a message via Skype™ to xbatista
gubka
Veteran Member
Join Date: Jan 2012
Location: Russia
Old 03-17-2016 , 15:23   Re: Glow
Reply With Quote #16

Quote:
Originally Posted by xbatista View Post
Try to unhook setTransmit before removing entity.
PHP Code:
public void RemoveSkin(int client
{
    
int entity EntRefToEntIndex(gPlayerModels[client]);
    if(
entity != INVALID_ENT_REFERENCE && entity != && IsValidEdict(entity)) 
    {

        
SDKUnhook(entitySDKHook_SetTransmitOnShouldDisplay)        
        
AcceptEntityInput(entity"Kill");
        
gPlayerModels[client] = INVALID_ENT_REFERENCE;
    }

Try checking on SetTransmit(OnShouldDisplay) gPlayerModels[Client] == Ent.

Changing team can cause those bugs, so before changing team remove entity and create new for that player.
It really depends by your mod what do you want to do.
SDKUnhook is ussless because sdk unhook it automaticcally when entity destoied , also i tiyed and it not help

I delete entity when it change team, but problem in other players entities not in my
__________________
gubka is offline
Send a message via ICQ to gubka
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 03-17-2016 , 16:15   Re: Glow
Reply With Quote #17

EDIT: deleted code, useless

And try to lower max glow distance.
CS:GO has
prop_dynamic_glow, you can play with that too.
__________________

Last edited by xbatista; 03-17-2016 at 16:48.
xbatista is offline
Send a message via Skype™ to xbatista
gubka
Veteran Member
Join Date: Jan 2012
Location: Russia
Old 03-17-2016 , 16:42   Re: Glow
Reply With Quote #18

It is not help , same problem

prop_dynamic_glow might be good, but i dont know about it, it same entity or already glowing?
__________________
gubka is offline
Send a message via ICQ to gubka
xbatista
Veteran Member
Join Date: Mar 2008
Location: Lithuania
Old 03-17-2016 , 16:49   Re: Glow
Reply With Quote #19

I have never used that, test it by yourself
__________________
xbatista is offline
Send a message via Skype™ to xbatista
Mitchell
~lick~
Join Date: Mar 2010
Old 03-17-2016 , 20:07   Re: Glow
Reply With Quote #20

SetTransmit will set the prop to show up at origin 0,0,0 to players that you return Plugin_Handled;
The reason i didn't help you is because i couldn't understand what you wanted and you just posted my code except a butchered up version of it.
Prop_Dynamic_Override works fine for the glow.
I never got why you didnt just stick with the CPS plugin and work from there, once you got it working you could have extracted the code.

Last edited by Mitchell; 03-17-2016 at 20:08.
Mitchell 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 20:50.


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