General > Off-Topic

GAMEMODE:AddNotify

(1/1)

jay209015:
I've been looking all over the garrysmod wiki, but have yet to find any documentation on this. I know it must be out there, because it's getting used a quite a few scripts. So, it would be greatly appreciated if someone could point in the right direction.

Megiddo:
http://code.garrysmod.com/?show=/garrysmod/gamemodes/sandbox/gamemode/cl_notice.lua#18

It's used for those tips that popup.

jay209015:
Thank you, been looking for that for a while.

One more question, how do you make functions like you did with ULib ?

like

ULib.kick(ply, reason )

if I try and create a function with Dev.function( stuff here) it says

--- Code: ---attempt to index global 'Dev' (a nil value)
--- End code ---

==EDIT==

Looked into ULib's code and figured out that it was table, "Duh:S"  .

Sc00by22:
You could use this


--- Quote ---function DisplayNotify(msg)
   local txt = msg:ReadString()
   GAMEMODE:AddNotify(txt, msg:ReadShort(), msg:ReadLong())

   -- Log to client console
   print(txt)
end
usermessage.Hook("_Notify", DisplayNotify)
--- End quote ---

Navigation

[0] Message Index

Go to full version