Ulysses

General => Off-Topic => Topic started by: jay209015 on July 17, 2008, 01:29:00 PM

Title: GAMEMODE:AddNotify
Post by: jay209015 on July 17, 2008, 01:29:00 PM
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.
Title: Re: GAMEMODE:AddNotify
Post by: Megiddo on July 17, 2008, 01:41:48 PM
http://code.garrysmod.com/?show=/garrysmod/gamemodes/sandbox/gamemode/cl_notice.lua#18

It's used for those tips that popup.
Title: Re: GAMEMODE:AddNotify
Post by: jay209015 on July 17, 2008, 04:18:42 PM
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: [Select]
attempt to index global 'Dev' (a nil value)
==EDIT==

Looked into ULib's code and figured out that it was table, "Duh:S"  .
Title: Re: GAMEMODE:AddNotify
Post by: Sc00by22 on July 24, 2008, 03:36:32 PM
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)