I was Wondering if there Was An alternative Instead Of Using concommands To Run a Function Thats can be accesed by a derma panel
Yes. If it's clientside and in the same file you can just call it. Make it global on the client, and you can call it. If it's serverside you can use the net library.
Stop Writing Like this. And as crazyscouter said. You can also use usermessage.
[B]Edit[/B]
Why so many disagrees. All I stated was that he [U]CAN[/U] use usermessages.
Yes As The People Before Me Have Said Use Net Messages ServerSide And A Function Either Global Or Local ClientSide
[QUOTE=Icejjfish;45621378]Stop Writing Like this. And as crazyscouter said. You can also use usermessage.[/QUOTE]
Usermessages are deprecated and only still useful in a very few specific circumstances.
Unless you know what these circumstances are, use the net library.
How can I use the net library it seems interesting
[URL="http://wiki.garrysmod.com/page/Net_Library_Usage"]By Googling how to use the net library gmod.[/URL]
[QUOTE=DeadShotKillz;45621428]How can I use the net library it seems interesting[/QUOTE]
Google Is A Good Friend Of Yours.
I checked the Wiki Page out, But It looked like it Could only send strings and other simple stuff But not to run a client side function
You would send a net message that when received runs a function. Net messages are name specific so if I sent a net message with the name pie and my system was set to add me to admin if it received a message with the name apple it would do nothing.
[QUOTE=DeadShotKillz;45622849]I checked the Wiki Page out, But It looked like it Could only send strings and other simple stuff But not to run a client side function[/QUOTE]
Its really easy to run a function out of a net message.
[CODE]--Server Side Code
util.AddNetworkString("NAMEOFTHEMESSAGE")
local function RunOnClient(ply)
if not IsValid(ply) then return end
net.Start("NAMEOFTHEMESSAGE")
net.WriteString("Hi Mom!!!") -- Depending on what your sending you don't even need to write a string
net.Send(ply)
end
[/CODE]
[CODE]
-- Client Side Code
net.Receive("NAMEOFTHEMESSAGE", function(l,c)
print(net.ReadString())
-- Run what ever client side function you want here
end)
[/CODE]
Could this Message Be Triggered by A Chat Command?
[QUOTE=DeadShotKillz;45623080]Could this Message Be Triggered by A Chat Command?[/QUOTE]
Impossibru
[sp]Seriously go read the wiki and find out, you need to be a independent learner if you wanna survive in the programming world[/sp]
Sorry, you need to Log In to post a reply to this thread.