Every time I use umsg.hook it runs the client side code for every player. Is there any way to avoid that?
You can set up a RecipientFilter( ) with usermessages.
With net-messages you can target specific players, or set up a table of who to target.
Post your code so we can show you were to add it.
[CODE]
-- http://wiki.garrysmod.com/page/Category:CRecipientFilter
function SendMessage()
local filter = RecipientFilter()
filter:AddAllPlayers()
for k, v in pairs( filter ) do
if ( !v:Alive() and !isValid( v ) ) then
filter:RemovePlayer( v )
end
end
umsg.Start( "message", filter ) -- We only send the message to valid living players.
umsg.SendShort( 1231 )
umsg.End()
end
[/CODE]
[URL="http://wiki.garrysmod.com/page/Category:CRecipientFilter"]RecipientFilter[/URL] also has the ability to do it via [URL="http://wiki.garrysmod.com/page/CRecipientFilter/RemovePVS"]PVS[/URL]
Nice works great, thanks guys!
<3 tucker
Sorry, you need to Log In to post a reply to this thread.