<talkaction log="yes" words="/adddays" access="5" event="script" value="adddays.lua"/>
--- Script by Kekox.
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
return true
end
local t = string.explode(param, ",")
t[1] = tonumber(t[1])
if(not t[1]) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires numeric param.")
return true
end
local pid = cid
if(t[2]) then
pid = getPlayerByNameWildcard(t[2])
if(not pid) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[2] .. " not found.")
return true
end
end
if(t[1] > 365) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can only add max 365 vip days.")
return true
end
sender = getPlayerByNameWildcard(cid)
doAddVipDays(pid, t[1])
doPlayerSendTextMessage(cid, "You have added ".. t[1] .." vip days to ".. t[2])
doPlayerSendTextMessage(pid, sender .." just added you ".. t[1] .." vip days.")
return true
end
function onThink(cid, item, fromPosition, toPosition)
for _, name in ipairs(getOnlinePlayers()) do
local player = getPlayerByName(name)
if getCreatureStorage(player,11551) == 1 then
doPlayerSetStorageValue(player,11551,0)
end
end
end
function onThink(cid, item, fromPosition, toPosition)
for _, name in ipairs(getOnlinePlayers()) do
local player = getPlayerByName(name)
if getCreatureStorage(player, 11551) > 1 then
doPlayerSetStorageValue(player, 11551, getCreatureStorage(player) - 1)
end
end
end
Can Anyone Fix Door? it Goes Inside Wall When Use It S:!
-- Credits StreamSide and Empty
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cidPosition = getCreaturePosition(cid)
if (item.actionid == 5788 and getPlayerStorageValue(cid,11551) >= 1) then
if cidPosition.x < toPosition.x then
doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z}, TRUE)
doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
else
doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, TRUE)
doCreatureSay(cid, "Welcome VIP Player!", TALKTYPE_ORANGE_1)
end
return TRUE
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Sorry, but only VIP Players can pass here! Buy VIP on the WEB.")
return TRUE
end
return FALSE
end
doTeleportThing(cid, {x=toPosition.x[B]-1[/B],y=toPosition.y,z=toPosition.z}
doTeleportThing(cid, {x=toPosition.x,y=toPosition.y[B]-1[/B],z=toPosition.z}