How to create a command

I want to create a command “/health”. Which give a player health for darkrp cash. How do I create something like that because it can’t be just a normal console command?

[editline]29th April 2016[/editline]



	if ( SERVER ) then
	
		hook.Add( "PlayerSay", "playersaywebsite", function( _p, _text, public )
	
			if ( _text == "/health" ) then
				_p:ConCommand( "health" );
				return "";
			elseif ( _text == "/halfheal" ) then
				_p:ConCommand( "halfhealth" );
				return "";
			end	
		end );
	
	else
	
		concommand.Add( "health", function() 
			if (ply:CanAfford(1000) == true) then
			ply:addMoney(1000*-1) then
			ply:SetHealth(100);
			else
				print("You need $1000 to purchase this.")
			
		end );
		
		concommand.Add( "1/2health", function() 
			if (ply:CanAfford(500) == true) then
				ply:addMoney(500*-1) then
				ply:SetHealth(50);
			else
				print("You need $1000 to purchase this.")
		end );
		
	end


This is what I have so far