ty
local config = {
promotion = 1, -- promotion level, default = 1 . Ignore if you don't have new vocations.
minLevel = 20, -- Level needed to buy promotion
cost = 20000, -- Promotion cost in gp
premium = "yes" -- is premium needed to buy promotion?
}
local disabledVocations = {0}
function onSay(cid, words, param)
if(isInArray(disabledVocations, getPlayerVocation(cid)) == TRUE) then
doPlayerSendCancel(cid, "Your vocation cannot buy promotion.")
elseif(config.premium == TRUE and isPremium(cid) == FALSE) then
doPlayerSendCancel(cid, "Voce precisa ser donate para comprar promotion.")
elseif(getPlayerPromotionLevel(cid) >= config.promotion) then
doPlayerSendCancel(cid, "You are already promoted.")
elseif(getPlayerLevel(cid) < config.minLevel) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You need level " .. config.minLevel .. " to get promotion.")
elseif(doPlayerRemoveMoney(cid, config.cost) ~= TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You do not have enought money! (Promotion cost " .. config.cost .. " gp.")
else
setPlayerPromotionLevel(cid, config.promotion)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have been succesful promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".")
end
return TRUE
end
how fix it to tfs 1.2 10.98
[TFS 1.2] Modal Window Helper Lib
- -- The helper lib is used by passing a table value to the ModalWindow function
- local window = ModalWindow {
- title = 'Title',
- message = 'Please, choose the lowest number and press [Ok]'
- }
- local lowestChoice
- for i = 1, 5 do
- local value = math.random(1, 100)
- -- modalWindow:addChoice() returns the choice object that will be passed to the callbacks
- local choice = window:addChoice(value)
- -- This way we can pass extra information to the callback
- choice.value = value
- if not lowestChoice or lowestChoice.value > value then
- lowestChoice = choice
- end
- end
- lowestChoice.correct = true
- -- Add a button with a specific callback
- window:addButton('Ok',
- function(button, choice)
- if choice.correct then
- print('Player selected the correct option.')
- else
- print('Player selected the incorrect option.')
- end
- end
- )
- -- Set this button as the default enter button
where install this file
- window:setDefaultEnterButton('Ok')
- -- Add a button without a specific callback
- window:addButton('Close')
- window:setDefaultEscapeButton('Close')
- -- If a button without a specific callback is pressed, this fucntion will be called
- window:setDefaultCallback(
- function(button, choice)
- print('Default callback, button pressed: ' .. button.text .. ' player choice: ' .. choice.text)
- end
- )
where install this file
TalkAction Offline player to player item trader (Auction System).
TalkAction - Offline player to player item trader (Auction System).
how to use in tfs 1.2