• 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!

talckaction [premium]

Elexonic

Well-Known Member
Joined
Jun 18, 2008
Messages
1,920
Reaction score
59
I need a script to do the following.

Add Player premium days --> /addpremium [nameplayer],Day --/addpremium elexonic,5



Remove player premium days-->/removepremium [nameplayer],day--/removeplayer elexonic,5


Vip see player days-->/vip premium,[playername]

Acces 5+

Thx!
 
Last edited:
would be something like but not complete as I want.

Code:
function onSay(cid, words, param) 
    local idgroup = 5 --Min Group Access 
    if getPlayerGroupId(cid) < idgroup then 
        doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "You can not use this command.") 
    elseif param ~= "" then 
        if string.find(param, ',') ~= nil then 
            local sep1 = string.find(param, ',') 
            local param1 = string.sub(param, 1, sep1-1) 
            local param2 = string.sub(param,sep1+1,string.len(param)) 
            local target = getPlayerByName(param1) 
            if target == FALSE then 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "A player with that name is not online.") 
            elseif param1 == "" then 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "You must type a player.") 
            elseif (param2 == "") then 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "You must type an amount of days.") 
            elseif isNumber(param2) == FALSE then 
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Days have to be a number.") 
            elseif words == "/premium" then 
                local player = getCreatureName(target) 
                local days = param2 
                if days ~= 0 or days == 1 then 
                    doPlayerAddPremiumDays(target, days) 
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "You have added "..days.." day of premium to "..player..".") 
                    doPlayerSendTextMessage(target, MESSAGE_STATUS_DEFAULT, "You have been given "..days.." day of premium account.") 
                elseif days ~= 0 or days > 1 then 
                    doPlayerAddPremiumDays(target, days) 
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "You have added "..days.." days of premium to "..player..".") 
                    doPlayerSendTextMessage(target, MESSAGE_STATUS_DEFAULT, "You have been given "..days.." days of premium account.") 
                else 
                    doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, "Days have to be higher than 0.") 
                   end 
               end 
           end 
       end   
   end 
end
 
moredays.lua
LUA:
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] > 350) then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You can only add max 350 premium days.")
                return true
        end
 
        sender = getPlayerByNameWildcard(cid)
 
    doPlayerAddPremiumDays(pid, t[1])
    doPlayerSendTextMessage(cid, "You have added ".. t[1] .." vip days to ".. t[2])
    doPlayerSendTextMessage(pid, sender .." just added you ".. t[1] .." premium days.")    
        return true
end
talkactions.xml add
Code:
	<talkaction log="yes" words="/moredays" access="5" event="script" value="moredays.lua"/>

removedays.lua
LUA:
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 premium days.")
                return true
        end
 
        sender = getPlayerByNameWildcard(cid)
 
    doPlayerRemovePremiumDays(pid, t[1])
    doPlayerSendTextMessage(cid, "You have removed ".. t[1] .." premium days to ".. t[2])
    doPlayerSendTextMessage(pid, sender .." just removed you ".. t[1] .." premium days.")    
        return true
end
talkactions.xml add
Code:
	<talkaction log="yes" words="/removedays" access="5" event="script" value="removedays.lua"/>
Rep++

Those are just modifed vip talkactions so they are not tested.
 
Up: Thx
and to see the days of a player you are vip?

It could make all in the same script? Thx if it does not matter separately:)
 
LUA:
function onSay(cid, words, param, channel)
        if(param == '') then
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
                return true
        end
    
                pid = getPlayerByNameWildcard(param)
                if(not pid) then
                        doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
                        return true
               end
        
 sender = getPlayerByNameWildcard(param)
        doPlayerSendTextMessage(cid, sender.." have "..getPlayerPremiumDays(sender).." premium days left.")
   return true
end
 
Haven't tested
LUA:
function onSay(cid, words, param)
local player = getPlayerByNameWildcard(param)
	if(param == "") then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Please input a Name.")
		return TRUE
	end	
	    doPlayerSendTextMessage(cid, "" .. getCreatureName(player) .. " has " ..getPlayerPremiumDays(player).. " premium days left.")
	return TRUE
end
Rep++ if works
 
Back
Top