Donation command

i need to make a command to where when you type /donate or !donate it opens my donation page which is metrogaming.hostoi.com/donate

any help?

thanks,
Metro :quagmire:


-- Run clientside
hook.Add( "OnPlayerChat", "DonationPage", function( ply, text )
   if ( text == "/donate" or text == "!donate" ) then
      gui.OpenURL( "http://metrogaming.hostoi.com/donate" )
   end
end )

ty so much!

[editline]18th August 2014[/editline]

so this goes in lua/autorun/client or lua/autorun/server or lua/autorun

Read the comment at the top of the code.

alright thanks

[editline]18th August 2014[/editline]

so in a lua file this should work?

if ( SERVER ) then

hook.Add( “OnPlayerChat”, “DonationPage”, function( ply, text )
if ( text == “/donate” or text == “!donate” ) then
gui.OpenURL( “http://metrogaming.hostoi.com/donate” )
end
end )

[editline]18th August 2014[/editline]

or can i remove the if server then?

Read the comment again. Paste my code EXACTLY.

alright

how do you find the power to help all those kind of guys