function onSay(cid,words,param)
params = string.explode(param, ",")
playerid = getCreatureByName(params[1])
if(params[2]) then
days = params[2]
else
days = 0
end
if days > 0 then
doPlayerAddPremiumDays(playerid, days)
doPlayerPopupFYI(playerid, "You received "..days.." premium days.\nPlease, logout to take effect.")
doPlayerPopupFYI(cid, "Player "..params[1].." received "..days.." premium days.")
else
doPlayerPopupFYI(cid, "You didn't stablished how many days to give.")
end
return TRUE
end
<talkaction words="/prem" access="4" event="script" value="giveprem.lua"/>
/prem player, days
local days = 0
function onSay(cid,words,param)
params = string.explode(param, ",")
playerid = getCreatureByName(params[1])
if(params[2]) then
days = params[2]
end
if days > 0 then
doPlayerAddPremiumDays(playerid, days)
doPlayerPopupFYI(playerid, "You received "..days.." premium days.\nPlease, logout to take effect.")
doPlayerPopupFYI(cid, "Player "..params[1].." received "..days.." premium days.")
else
doPlayerPopupFYI(cid, "You didn't stablished how many days to give.")
end
return TRUE
end
function onSay(cid, words, param)
local param, playerid, days = string.explode(param, ","), getCreatureByName(params[1]), tonumber(params[2])
if(isPlayer(playerid) == TRUE and days) then
doPlayerAddPremiumDays(playerid, days)
doPlayerSendTextMessage(playerid, MESSAGE_INFO_DESCR, "You have just received ".. days .." premium days. Please re-login for the premium account to take effect.")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Player ".. params[1] .." received ".. days .." premium days.")
else
doPlayerSendCancel(cid, "Either the first param isn't an online player or the second param isn't a number.")
end
return TRUE
end
[10/01/2010 10:43:15] Lua Script Error: [TalkAction Interface]
[10/01/2010 10:43:15] data/talkactions/scripts/premmy.luanSay
[10/01/2010 10:43:15] data/talkactions/scripts/premmy.lua:2: attempt to index global 'params' (a nil value)
[10/01/2010 10:43:15] stack traceback:
[10/01/2010 10:43:15] data/talkactions/scripts/premmy.lua:2: in function <data/talkactions/scripts/premmy.lua:1>
function onSay(cid, words, param)
local param, playerid, days = string.explode(param, ","), getPlayerByNameWildcard(param[1]), tonumber(params[2])
if(isPlayer(playerid) == TRUE and days) then
doPlayerAddPremiumDays(playerid, days)
doPlayerSendTextMessage(playerid, MESSAGE_INFO_DESCR, "You have just received ".. days .." premium days. Please re-login for the premium account to take effect.")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Player ".. params[1] .." received ".. days .." premium days.")
else
doPlayerSendCancel(cid, "Either the first param isn't an online player or the second param isn't a number.")
end
return TRUE
end
[10/01/2010 10:52:03] Lua Script Error: [TalkAction Interface]
[10/01/2010 10:52:03] data/talkactions/scripts/premmy.luanSay
[10/01/2010 10:52:03] data/talkactions/scripts/premmy.lua:2: attempt to index global 'params' (a nil value)
[10/01/2010 10:52:03] stack traceback:
[10/01/2010 10:52:03] data/talkactions/scripts/premmy.lua:2: in function <data/talkactions/scripts/premmy.lua:1>
function onSay(cid, words, param)
local param, playerid, days = string.explode(param, ","), getPlayerByNameWildcard(param[1]), tonumber(param[2])
if(isPlayer(playerid) == TRUE and days) then
doPlayerAddPremiumDays(playerid, days)
doPlayerSendTextMessage(playerid, MESSAGE_INFO_DESCR, "You have just received ".. days .." premium days. Please re-login for the premium account to take effect.")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Player ".. params[1] .." received ".. days .." premium days.")
else
doPlayerSendCancel(cid, "Either the first param isn't an online player or the second param isn't a number.")
end
return TRUE
end
function onSay(cid, words, param)
local param, playerid, days = string.explode(param, ","), getCreatureByName(param[1]), tonumber(param[2])
if(isPlayer(playerid) == TRUE and days) then
doPlayerAddPremiumDays(playerid, days)
doPlayerSendTextMessage(playerid, MESSAGE_INFO_DESCR, "You have just received ".. days .." premium days. Please re-login for the premium account to take effect.")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Player ".. params[1] .." received ".. days .." premium days.")
else
doPlayerSendCancel(cid, "Either the first param isn't an online player or the second param isn't a number.")
end
return TRUE
end
function onSay(cid, words, param)
local param, playerid, days = string.explode(param, ","), getPlayerByNameWildcard(param[1]), tonumber(param[2])
if(isPlayer(playerid) == TRUE and days) then
doPlayerAddPremiumDays(playerid, days)
doPlayerSendTextMessage(playerid, MESSAGE_INFO_DESCR, "You have just received ".. days .." premium days. Please re-login for the premium account to take effect.")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Player ".. params[1] .." received ".. days .." premium days.")
else
doPlayerSendCancel(cid, "Either the first param isn't an online player or the second param isn't a number.")
end
return TRUE
end
Either the first param isn't an online player or the second param isn't a number.
[10/01/2010 10:59:15] data/talkactions/scripts/premmy.lua:2: attempt to index global 'params' (a nil value)
[10/01/2010 10:59:15] stack traceback:
[10/01/2010 10:59:15] data/talkactions/scripts/premmy.lua:2: in function <data/talkactions/scripts/premmy.lua:1>
function onSay(cid, words, param)
local param, playerid, days = string.explode(param, ","), getCreatureByName(param[1]), tonumber(param[2])
if(isPlayer(playerid) == TRUE and days) then
doPlayerAddPremiumDays(playerid, days)
doPlayerSendTextMessage(playerid, MESSAGE_INFO_DESCR, "You have just received ".. days .." premium days. Please re-login for the premium account to take effect.")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Player ".. param[1] .." received ".. days .." premium days.")
else
doPlayerSendCancel(cid, "Either the first param isn't an online player or the second param isn't a number.")
end
return TRUE
end
function onSay(cid, words, param)
local param = string.explode(param, ",")
local player = getPlayerByNameWildcard(param[1])
local days = tonumber(param[2])
if isPlayer(player) and days then
doPlayerAddPremiumDays(player, param[2])
doPlayerSendTextMessage(player, MESSAGE_INFO_DESCR, "You have just received ".. days .." premium days. Please re-login for the premium account to take effect.")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Player ".. param[1] .." received ".. days .." premium days.")
else
doPlayerSendCancel(cid, "Either the first param isn't an online player or the second param isn't a number.")
end
return true
end
function onSay(cid, words, param)
local param = string.explode(param, ",")
local playerid, days = getCreatureByName(param[1]), tonumber(param[2])
if(isPlayer(playerid) == TRUE and days) then
doPlayerAddPremiumDays(playerid, days)
doPlayerSendTextMessage(playerid, MESSAGE_INFO_DESCR, "You have just received ".. days .." premium days. Please re-login for the premium account to take effect.")
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Player ".. param[1] .." received ".. days .." premium days.")
else
doPlayerSendCancel(cid, "Either the first param isn't an online player or the second param isn't a number.")
end
return TRUE
end
local days = 5
function onSay(cid,words,param)
params = string.explode(param, ",")
playerid = getCreatureByName(params[1])
if(params[2]) then
days = params[2]
end
doPlayerAddPremiumDays(playerid, days)
doPlayerPopupFYI(playerid, "You received "..days.." premium days.\nPlease, logout to take effect.")
doPlayerPopupFYI(cid, "Player "..params[1].." received "..days.." premium days.")
return TRUE
end