Every time an NPC is killed in my gamemode, the player who killed it receives a certain amount of EXP which should be immediately shown on his screen. Players don't need to know the EXP of other players.
I don't know too much about the implemention but I think that there have to be vast differences in terms of server performance eaten by both of the possible solutions.
- Should I use SetNWInt or an usermessage for my problem?
It is possible that there will be up to 2 NPCs killed per second so I think this matters.
Thanks in advance
I've seen loads more people using [B][URL="http://wiki.garrysmod.com/?title=Player.SetPData"]Player.SetPData [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG][/URL]
[/B]Try using this instead of SetNWInt
[QUOTE=HeavyMtl123;22540806]I've seen loads more people using [B][URL="http://wiki.garrysmod.com/?title=Player.SetPData"]Player.SetPData [IMG]http://wiki.garrysmod.com/favicon.ico[/IMG][/URL]
[/B]Try using this instead of SetNWInt[/QUOTE]
But he is asking how he can send it to the client so that it can be used for hud, not for a means of storage.
-snip-
[b]Always[/b] use usermessages, unless data only needs to be set once and [b]needs[/b] to be on the client.
@FlapJack: Thanks for the information
@HeavyMtl123: I didn't know about the builtin-SQLlite feature yet - thanks
[B][/B]
[QUOTE=|FlapJack|;22540949][b]Always[/b] use usermessages, unless data only needs to be set once and [b]needs[/b] to be on the client.[/QUOTE]
Is there really a difference speed wise to change a networked int rather than sending a usermessage with that one int?
[QUOTE=ralle105;22541236]Is there really a difference speed wise to change a networked int rather than sending a usermessage with that one int?[/QUOTE]
I haven't tested it, but depending on the number of NWVars getting set on connect, usermessages will set it faster. The main reason for using usermessages over NWVars is stopping buffer overflows.
don't use NW stuff if you don't need everyone to know the value
Sorry, you need to Log In to post a reply to this thread.