hi @ all
I have a problem with the function.
admin: send text message ("" ..pName .. "your hunger & thirst was quenched by" ..aName);
The message does not reach pName but at aName
Where is the error?
I would like to:
admin sended text message to player ...
Not !!!
admin sended text message to admin
can you help me?
[lua]elseif cmd[1] == "/hunger" then
-- Checking if admin :
if not event.player:isAdmin() then return msgAccessDenied(event.player) end
-- Checking if there's an argument
if not cmd[2] then return msgInvalidUsage(event.player) end
-- Checking if targeted player exist
if not server:findPlayerByID(cmd[2]) then return msgBadID(event.player) end
local target = server:findPlayerByID(cmd[2]);
hunger(event.player, target)[/lua]
[lua]function hunger(admin, player)
local aName = admin:getPlayerName();
local pName = player:getPlayerName();
admin:sendTextMessage(" "..pName.." dein Hunger&Durst wurden gestillt von "..aName);
player:setPlayerHunger(100)
player:setPlayerThirst(100)
end[/lua]