• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

!premiumdays command

Cris2387

Member
Joined
Dec 30, 2013
Messages
177
Reaction score
9
hello i almost have the perfect premium system hehe here's what i have:
Code:
function onSay(cid, words, param)
local player = getPlayerByName(param)  
local t = string.explode(param, ",")  
if words == "/checkdays" then  

if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end

if not isPlayer(player) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") return true end

return doPlayerPopupFYI(cid, "Player checked have "..getPlayerPremiumDays(player).." days of Premium Account!")  
end

if words == "/addpremium" then  

local t = string.explode(param, ",")  
local player = getPlayerByNameWildcard(t[1])

if not tonumber(t[2]) then  
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end  

if(not player)then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") return true end

doPlayerAddPremiumDays(player, tonumber(t[2]))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You has been added "..tonumber(t[2]).." days of Premium Account to the player! ")  
doRemoveCreature(player)
end

if words == "/removedays" then
local t = string.explode(param, ",")  
local player = getPlayerByNameWildcard(t[1])

if not tonumber(t[2]) then  
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end  

if(not player)then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") return true end

doPlayerRemovePremiumDays(player, tonumber(t[2]))
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You has been removed "..tonumber(t[2]).." Premium Account Days of the player!")  

end
return true
end
it works perfectly and all but i want a command that allows the players to see how many premium days they have in game not in the login screen, i really need this to complete my system, i want something like this: when they say !premiumdays, or /premiumdays they get the message ex: You have 10 premium days. < -- in default chat box , thank you for helping
 
I don't mean to sound rude but what you are asking for is already in the command you just showed us. All you would have to do is take that part out and put it into a new command that the player can use. Also if a player can just press ctrl+g to see their premium days then what is the point of the command?
 
as Xagul said the command is here in "Your" system
Code:
return doPlayerPopupFYI(cid, "Player checked have "..getPlayerPremiumDays(player).." days of Premium Account!") 
end

But i dont udnerstand why you cant just use ctrl + g either lol
 
I don't mean to sound rude but what you are asking for is already in the command you just showed us. All you would have to do is take that part out and put it into a new command that the player can use. Also if a player can just press ctrl+g to see their premium days then what is the point of the command?
o.0 lmao :(((((( i okay haha im such a nub sorry i dont know much about scripting but i will definitely try and share it with you guys
 
I don't mean to sound rude but what you are asking for is already in the command you just showed us. All you would have to do is take that part out and put it into a new command that the player can use. Also if a player can just press ctrl+g to see their premium days then what is the point of the command?
aaaaaaaaghhhhhhhh i tried and i tried and this is what i get :
Code:
[27/5/2015 22:37:23] [Error - TalkAction Interface]
[27/5/2015 22:37:23] data/talkactions/scripts/checkdays.lua:onSay
[27/5/2015 22:37:23] Description:
[27/5/2015 22:37:23] data/talkactions/scripts/checkdays.lua:3: attempt to concatenate global 'getPlayerPremiumDays' (a function value)
[27/5/2015 22:37:23] stack traceback:
[27/5/2015 22:37:23]    data/talkactions/scripts/checkdays.lua:3: in function <data/talkactions/scripts/checkdays.lua:1>
this is the script im using:
PHP:
function onSay(cid, words, param)
     trueMsg = "You do not have any premium days in your current account."
     falseMsg = "You currently have "..getPlayerPremiumDays.." premium days!"
if isPremium(cid) then
doPlayerPopupFYI(cid, tileConfig.trueMsg)
else
doPlayerPopupFYI(cid, tileConfig.cancelMsg)
return end
end
 
Code:
function onSay(cid, words, param)
    local premDays = getPlayerPremiumDays(cid)
    if(premDays > 0) then
        doPlayerPopupFYI(cid, "You currently have ".. premDays .." premium day".. ((premDays == 1 and "") or "s"))
    else
        doPlayerPopupFYI(cid, "You are not premium.")
    end
    return true
end
 
Back
Top