HamTheKratos
Member
My First Script ^^
command to add or remove curse:
Effect on curse player
data/creaturescripts/scripts/curse.lua
GUYS IT IS MY FIRST SCRIPT.
comment&rep please
command to add or remove curse:
LUA:
function onSay(cid,words,param)
local requiredGroup = 3
local curStorageValue = 11111
local target = getPlayerByName(param)
if words == '/addcur' then
if target > 0 then
if getPlayerGroupId(cid) >= requiredGroup and param ~= "" and getPlayerStorageValue(target, curStorageValue) == -1 then
adminName = getPlayerName(cid)
setPlayerStorageValue(target, curStorageValue, 1)
doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'You are now CURSED'..adminName..'Cursed You.')
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You Cursed "..param..".")
elseif getPlayerGroupId(cid) < requiredGroup then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't CURSE anyone.")
elseif getPlayerStorageValue(target, curStorageValue) ~= -1 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player is already CURSED.")
end
else
doPlayerSendTextMessage(cid, 21, "This player doesn't exists or is not online.")
end
elseif words == '/takecur' then
if target > 0 then
if getPlayerGroupId(cid) >= requiredGroup and param ~= "" and getPlayerStorageValue(target, curStorageValue) == 1 then
adminName = getPlayerName(cid)
setPlayerStorageValue(target, curStorageValue, -1)
doPlayerSendTextMessage(target, MESSAGE_STATUS_CONSOLE_BLUE, 'You are now a normal player. '..adminName..' Removed your CURSE')
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You removed the CURSE of "..param..".")
elseif getPlayerGroupId(cid) < requiredGroup then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can't remove CURSE of anyone.")
elseif getPlayerStorageValue(target, curStorageValue) ~= 1 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "This player is not CURSED.")
end
else
doPlayerSendTextMessage(cid, 21, "This player doesn't exists or is not online.")
end
end
end
Effect on curse player
data/creaturescripts/scripts/curse.lua
LUA:
local timeEffect = 60 -- Seconds for effects
local status = 11111 -- Storage for curse
local playercur = getPlayerStorageValue(cid, status)
function onLogin(cid)
if getPlayerStorageValue(cid, status) == TRUE then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "CURSED PLAYER")
addEvent(special, timeEffect * 1000)
end
return TRUE
end
local function special()
if playercur == TRUE then
doSendAnimatedText(getCreaturePosition(cid), "CURSED!", TEXTCOLOR_RED)
doPlayerAddHealth(cid,-1000)
doPlayerAddMana(cid, -1000)
end
end
GUYS IT IS MY FIRST SCRIPT.
comment&rep please
Last edited: