adprice = 5
function Advertise(player,cmd,...)
local parametersTable = {...}
local stringWithAllParameters = table.concat( parametersTable, " " )
local money = getPlayerMoney(player)
local pname = getPlayerName(player)
if money >= adprice then
outputChatBox("Ad from "..pname..": "..stringWithAllParameters,root,0,255,0)
outputChatBox("Phone number: 123-2212",root,0,255,0)
takePlayerMoney(player,adprice)
else
outputChatBox("A advertise costs "..adprice.."$ !",player,255,0,0)
end
end
addCommandHandler("ad",Advertise)
I didn't test it, but i think its working.
"/ad [text]"