!Donate command help

using


function donateCommand( pl, text, teamonly )
		    if (text == "!donate") then 
			    pl:SendLua([[gui.OpenURL("http://spodergaming.enjin.com/forum/m/14993935/viewthread/7658059-dark-rp-rules/post/last#last")]]) -- Change ADDRESS to your chosen page.
			    for k, v in pairs(player.GetAll()) do v:ChatPrint( "Player " .. pl:Nick() .. " has donated to the server via !donate" )

		end
	end
end
hook.Add( "PlayerSay", "Chat", donateCommand

inside of lua/autorun/server, and it’s not working when I type the command.
I just want it to bring up a menu kind of like ULX MOTD does.

[LUA]
hook.Add( “PlayerSay”, “Chat”, donateCommand
[/LUA]

You forgot the ‘)’ at the end of that^

[LUA]
hook.Add( “PlayerSay”, “Chat”, donateCommand )
[/LUA]

Suggestion:

[lua]
if (string.lower(text) == “!donate”) then
[/lua]

Now it’s not case sensitive.

Did both, still nothing besides !donate in chat.

[editline]2nd July 2013[/editline]

Not a thing changed.



hook.Add( "PlayerSay", "Chat", "donateCommand" function( ply, text, teamonly )
	if (string.sub(text, 1, 7) == "!donate" then
		 pl:SendLua([[gui.OpenURL("http://spodergaming.enjin.com/forum/m/14993935/viewthread/7658059-dark-rp-rules/post/last#last")]]) -- Change ADDRESS to your chosen page.
		 for k, v in pairs(player.GetAll()) do v:ChatPrint( "Player " .. pl:Nick() .. " has donated to the server via !donate" )
	end
end)


Try this.

I hope you realize you changed the “pl” arg to “ply” when the function itself isn’t even using ply.

[lua]local donate = {
[“URL”] = “”;
};

function donate.CreatePanel( )

local w = 800;  -- Width
local h = 600;  -- Height
local p = 8;    -- Padding

donate.Frame = vgui.Create( "DFrame" );
donate.Frame:SetTitle( "Random videos" );
donate.Frame:SetSize( w + (p * 2), h + (p * 5) );
 
donate.Panel = vgui.Create( "DPanel", donate.Frame );
donate.Panel:SetPos( 8, 32 );
donate.Panel:SetSize( w, h );
 
donate.HTML = vgui.Create( "HTML", donate.Panel );
donate.HTML:SetPos( 8, 8 );
donate.HTML:SetSize( w - (p * 2), h - (p * 2) );
donate.HTML:OpenURL( donate.URL );

donate.Frame:Center();
donate.Frame:MakePopup();

end

hook.Add( “OnPlayerChat”, “donateCommand”, function( ePlayer, sText )

if ( ePlayer ~= LocalPlayer() ) then
	return;
end

if ( string.StartWith( string.lower( sText ), "!donate" ) ) then
    donate.CreatePanel( );
return;
end

end );[/lua]

Goes in lua/autorun/client, I found this from another thread on Facepunch. Change the [“URL”] = to your donate page