• SetNWEntity Not Working
    13 replies, posted
Is it just me or Entity:SetNWEntity("test") not working. It should clear nw variable, but it doesn't.
Works server-side. Haven't tried client-side yet though.
[QUOTE=thegrb93;47426354]Works server-side. Haven't tried client-side yet though.[/QUOTE] I meant using SetNWEntity serverside and then using GetNWEntity on clientside.
[QUOTE=edgarasf123;47426237]Is it just me or Entity:SetNWEntity("test") not working. It should clear nw variable, but it doesn't.[/QUOTE] SetNW[B]Entity[/B] "test" is a string. That function takes an entity. What are you expecting to happen? If you are trying to clear it then set it to NULL.
[QUOTE=wh1t3rabbit;47426379]SetNW[B]Entity[/B] "test" is a string. That function takes an entity. What are you expecting to happen? If you are trying to clear it then set it to NULL.[/QUOTE] It was working before the update.
[QUOTE=wh1t3rabbit;47426379]SetNW[B]Entity[/B] "test" is a string. That function takes an entity. What are you expecting to happen? If you are trying to clear it then set it to NULL.[/QUOTE] Calling without an argument is the same as passing nil. I'll try client-side now.
[QUOTE=thegrb93;47426415]Calling without an argument is the same as passing nil.[/QUOTE] The default value is already NULL if second argument is not set. [url]http://wiki.garrysmod.com/page/Entity/SetNWEntity[/url]
[QUOTE=edgarasf123;47426413]It was working before the update.[/QUOTE] The nwvar functions were updated to expect the correct types, if you are sending a string use SetNWString [editline]31st March 2015[/editline] Sorry I totally misunderstood,didn't realise test was the NAME of the var
[QUOTE=edgarasf123;47426434]The default value is already NULL if second argument is not set. [url]http://wiki.garrysmod.com/page/Entity/SetNWEntity[/url][/QUOTE] That's what I was telling him.
[QUOTE=wh1t3rabbit;47426438]The nwvar functions were updated to expect the correct types, if you are sending a string use SetNWString [editline]31st March 2015[/editline] Sorry I totally misunderstood,didn't realise test was the NAME of the var[/QUOTE] Any changes to NWVars were reverted in latest hotfix.
Confirmed, it's not working. Can't clear the NW var. Setting it to NULL works, but nil doesn't.
Using NULL as second argument does work, the wiki should be updated, unless it's a bug.
Well since it clears the server NW var, but not the client, there's something very fishy going on. Just pass NULL instead of nil until it gets fixed. I think it actually can't clear the NW var.
I don't see an issue on github about this so I'll make one.
Sorry, you need to Log In to post a reply to this thread.