Page 1 of 1

netwrite what does it mean?

Posted: 24 Apr 2013, 07:18
by alividerci
for example

Code: Select all

declare netwrite Text Net_Combo_Weapon for UI;
it is declare variable?
I'm just very often it is seen in other scripts

Re: netwrite what does it mean?

Posted: 24 Apr 2013, 11:55
by TGYoshi
If you declare a variable as netwrite (afaik only works with a certain players UI instance) the variable is synchronized with at client-sided scripts as well. If you make an UILayer (also works for UIAll layers) you can use:
declare netread Text Net_Combo_Weapon for UI;
at the client-sided script. In that client-sided script you can use the var Net_Combo_Weapon and it'll be the value the server set it at the netwrite var server-sided.
Like this you don't have to send the whole UI over and over again at every change.

Re: netwrite what does it mean?

Posted: 24 Apr 2013, 13:25
by alividerci
TGYoshi wrote:If you declare a variable as netwrite (afaik only works with a certain players UI instance) the variable is synchronized with at client-sided scripts as well. If you make an UILayer (also works for UIAll layers) you can use:
declare netread Text Net_Combo_Weapon for UI;
at the client-sided script. In that client-sided script you can use the var Net_Combo_Weapon and it'll be the value the server set it at the netwrite var server-sided.
Like this you don't have to send the whole UI over and over again at every change.
thx