I was bored so here we go!
Works like this:
You say /feed Playername and if you have 5k it will give them full nutrition. lol
Code:
function onSay(cid, words, param)
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Name required.")
return TRUE
end
local cost = 5000
local player = getPlayerByNameWildcard(param)
if (getPlayerFood(player) + 72 > 400) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player is Full.")
else
if(doPlayerRemoveMoney(cid, cost) == TRUE) then
doSendAnimatedText(getCreaturePosition(player), "U Got Fed", 64)
doPlayerFeed(player, 72 * 4)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You dont have 5k.")
end
end
return TRUE
end
Code:
<talkaction words="/feed" script="feedtarget.lua"/>
Works like this:
You say /feed Playername and if you have 5k it will give them full nutrition. lol