function onSay(player, words, param)
if(param == '') then
player:sendTextMessage(MESSAGE_STATUS_WARNING, "Param...")
return false
end
local t = string.explode(param, ",")
if(not t[3] and t[2] ~= 'get') then
player:sendTextMessage(MESSAGE_STATUS_WARNING, "Not enought params...\nParam List: add, get, remove...")
return false
end
local target = Creature(param[1]) -- /points playername
if target == nil then
player:sendTextMessage(MESSAGE_STATUS_WARNING, "Creature not found.")
return false
end
if(param[2] == 'add') then -- /points playername, add
target:addPoints(param[3]) -- /points playername, add, amount
player:sendTextMessage(MESSAGE_STATUS_WARNING, "You added "..param[3].." points to "..target:getName()..".")
print(""..player:getName().." added "..param[3].." points to "..target:getName()..".")
elseif(param[2] == 'get') then -- /points playername, get
player:sendTextMessage(MESSAGE_STATUS_WARNING, ""..target:getName().." has "..target:getPoints().." points.")
print(""..player:getName().." checked "..target:getName().." points. Result was: "..target:getPoints().."...")
elseif(param[2] == 'remove') then -- /points playername, remove
target:removePoints(param[3]) -- /points playername, remove, amount
player:sendTextMessage(MESSAGE_STATUS_WARNING, "You removed "..param[3].." points from "..target:getName()..".")
print(""..player:getName().." removed "..param[3].." points from "..target:getName()..".")
else
player:sendTextMessage(MESSAGE_STATUS_WARNING, "ERROR ROCKET CRASHED")
print("ERROR ROCKET CRASHED")
end
return true
end