Try this:
function giveCommand ( source, command, playerToGive, moneyToGive )
if ( playerToGive ) then
if ( moneyToGive ) then
local givingPlayer = getPlayerName ( source )
local thePlayer = getPlayerFromName ( playerToGive )
if ( thePlayer ~= false ) then
local moneyToGive = tonumber ( moneyToGive )
local playersMoney = getPlayerMoney ( source )
if ( playersMoney >= moneyToGive ) then
takePlayerMoney ( source, moneyToGive )
givePlayerMoney ( thePlayer, moneyToGive )
outputChatBox ( givingPlayer .. " has given you $" .. moneyToGive .. ".", thePlayer, 255, 255, 0 )
outputChatBox ( "You have given " .. playerToGive .. " $" .. moneyToGive .. ".", source, 255, 255, 0 )
else
outputChatBox ( "You do not have enough money.", source, 255, 255, 0 )
end
else
outputChatBox ( thePlayer .. " does not exist.", source, 255, 255, 0 )
end
else
outputChatBox ( "Please specify an amount to give the player!", source, 255, 255, 0 )
end
else
outputChatBox ( "Please specify which player to give the money to!", source, 255, 255, 0 )
end
end
addCommandHandler ( "give", giveCommand )