General > Developers Corner

ulx module/ulx help

<< < (4/7) > >>

lampman13:
i thought it was in the developers corner and i know that it does but i only have one comma and it i suppoesed to be there but i even tryed to remove the comma so i could test it and it didnt work but i got it to work on client but not on a server for some reason and it is in addon format

lynx:
Remove the string concatinator (..) after the comma, and GetText is a function value so it needs to have (). So:

--- Code: ---chat.AddText( Color( 0, 255, 0 ), "(ADMIN)", Color( 0, 255, 0 ), ..TextEntry:GetText )
--- End code ---

Should be:

--- Code: ---chat.AddText( Color( 0, 255, 0 ), "(ADMIN)", Color( 0, 255, 0 ), TextEntry:GetText() )
--- End code ---

lampman13:
yeah i have that right now but it only works client side lol i did this last night i forgot i already had a thread and now i have a new one
but when i put it in a server it doesnt work can anyone help me with making it a ulx ! command and a "ulx    " command?

lynx:
Derma (textentry, etc) is all clientside. As is chat.AddText. If you want it to be distributed to clients, you need to either set up a net message (suggested) or a usermessage.

Net messages:
http://wiki.garrysmod.com/page/Net_Library_Usage

Send the text to the server (net.SendToServer) then process it to the clients you want (RecipientFilter) then send it back to the clients using a second net message, which the receive function would then process using chat.AddText

lampman13:
so my whole code wont work?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version