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

Auto-Promote

Status
Not open for further replies.

Sherlok

Active Member
Joined
Aug 29, 2008
Messages
2,116
Reaction score
44
Location
Poland, Wrocław.
Cześć,
Sięgałem już rad wielu skrypterów, korzystałem z niejednego skryptu, ale wszystko na nic, nadal nie jestem zadowolony z rezultatu.

Dokładniej - chodzi mi o skrypt na auto promocję po osiągnięciu 20 poziomu, ale tutaj pojawia się problem, a dokładniej przy awansie typu You advanced from Level 8 to Level 51 nie dostajemy promocji.

Proszę, aby ktoś kto się na tym zna mi pomógł.


 
auto-promote sprawdzałem, działa.
Dodałeś w login.lua register event?
 
Specjalnie sprawdziłem jeszcze raz, rezultat:

Code:
15:41 You advanced from Level 8 to Level 51.
Code:
15:41 You see yourself. You are a sorcerer.
 
To zrób sobie na storage value, np;

if (skill == 0) and (newlevel >= config.needLevel and newlevel < 100 and getPlayerStorageValue(cid, 1337) == -1 and getPlayerPromotionLevel(cid)<config.promoLevel) then
setPlayerStorageValue(cid, 1337, 1)
~~
~~
 
uproscmy:
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
    if ((skill == 0) and (newlevel >= 20 and getPlayerPromotionLevel(cid)<1)) then       
            setPlayerPromotionLevel(cid, config.promoLevel)
            doPlayerSendTextMessage(cid, 22, "You have been promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".")
    end
    return TRUE
end

a to dziala? jak nie to poprosze co wyjdzie w konsoli dla takiego skryptu przy advance:
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
	print("LVL:" .. newlevel)
	print("Promo:" .. getPlayerPromotionLevel(cid))
    if ((skill == 0) and (newlevel >= 20 and getPlayerPromotionLevel(cid)<1)) then       
            setPlayerPromotionLevel(cid, config.promoLevel)
            doPlayerSendTextMessage(cid, 22, "You have been promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".")
    end
    return TRUE
end
 
uproscmy:
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
    if ((skill == 0) and (newlevel >= 20 and getPlayerPromotionLevel(cid)<1)) then       
            setPlayerPromotionLevel(cid, config.promoLevel)
            doPlayerSendTextMessage(cid, 22, "You have been promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".")
    end
    return TRUE
end

a to dziala? jak nie to poprosze co wyjdzie w konsoli dla takiego skryptu przy advance:
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
	print("LVL:" .. newlevel)
	print("Promo:" .. getPlayerPromotionLevel(cid))
    if ((skill == 0) and (newlevel >= 20 and getPlayerPromotionLevel(cid)<1)) then       
            setPlayerPromotionLevel(cid, config.promoLevel)
            doPlayerSendTextMessage(cid, 22, "You have been promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".")
    end
    return TRUE
end

Ten pierwszy skrypt nie działa, a ten drugi:
ysnqzoou82v76hosxaw.png
 
No to masz:

LUA:
local config = { 
    promoLevel = 1,    -- promotion level : ) 
    needLevel = 20, -- level to get promotion  
    needPremium = "yes" -- need premium (YES/NO)? :D 
} 

function onAdvance(cid, skill, oldlevel, newlevel) 
    if (skill == 0) and (newlevel >= config.needLevel and newlevel < 100 and getPlayerStorageValue(cid, 1337) == -1 and getPlayerPromotionLevel(cid)<config.promoLevel) then 
        if(string.lower(config.needPremium) == "yes" and isPremium(cid) == TRUE) or (string.lower(config.needPremium) == "no") then  
setPlayerStorageValue(cid, 1337, 1)
            setPlayerPromotionLevel(cid, config.promoLevel) 
            doPlayerSendTextMessage(cid, 22, "You have been promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".") 
        end 
    end 
    return TRUE 
end
 
No to masz:

LUA:
local config = { 
    promoLevel = 1,    -- promotion level : ) 
    needLevel = 20, -- level to get promotion  
    needPremium = "yes" -- need premium (YES/NO)? :D 
} 

function onAdvance(cid, skill, oldlevel, newlevel) 
    if (skill == 0) and (newlevel >= config.needLevel and newlevel < 100 and getPlayerStorageValue(cid, 1337) == -1 and getPlayerPromotionLevel(cid)<config.promoLevel) then 
        if(string.lower(config.needPremium) == "yes" and isPremium(cid) == TRUE) or (string.lower(config.needPremium) == "no") then  
setPlayerStorageValue(cid, 1337, 1)
            setPlayerPromotionLevel(cid, config.promoLevel) 
            doPlayerSendTextMessage(cid, 22, "You have been promoted to " .. getVocationInfo(getPlayerVocation(cid)).name .. ".") 
        end 
    end 
    return TRUE 
end

Code:
19:28 You advanced from Level 8 to Level 51.

19:28 You see yourself. You are a sorcerer.
 
Jeśli ktoś też potrzebuje taki skrypt, proszę bardzo.
Code:
  local cost = 0

function onAdvance(cid, skill, oldLevel, newLevel)
        if skill == 8 and newLevel >= 20 then
                if doPlayerRemoveMoney(cid, cost) then
                        doPlayerSetPromotionLevel(cid, 1)
                end
        end
        return true
end


BTW.
Dzięki za chęć pomocy polaczki, ale skusiłem się napisać poza polskim boardem i poskutkowało :*
 
Niom, niestety polacy to takie nooby, ze biora sie za OTS majac zerowe pojecie. :/
 
Jeśli ktoś też potrzebuje taki skrypt, proszę bardzo.
Code:
  local cost = 0

function onAdvance(cid, skill, oldLevel, newLevel)
        if skill == 8 and newLevel >= 20 then
                if doPlayerRemoveMoney(cid, cost) then
                        doPlayerSetPromotionLevel(cid, 1)
                end
        end
        return true
end


BTW.
Dzięki za chęć pomocy polaczki, ale skusiłem się napisać poza polskim boardem i poskutkowało :*

Wiekszosc tych "Polaczkow" nie ma problemow z tak prostymi skryptami jak Ty w tym temacie (Kula testowal, jemu dzialalo, Tobie nie), a juz napewno kazdy "Polaczek" potrafi dodac do skryptu wyswietlanie napisow.

I potem takim polaczkom hakują otsy :(

Wyczuwam, ze to co napisal Chojrak bylo skierowane do Ciebie, no ale moze tylko ja to odczuwam :<
 
Jeśli ktoś też potrzebuje taki skrypt, proszę bardzo.
Code:
  local cost = 0

function onAdvance(cid, skill, oldLevel, newLevel)
        if skill == 8 and newLevel >= 20 then
                if doPlayerRemoveMoney(cid, cost) then
                        doPlayerSetPromotionLevel(cid, 1)
                end
        end
        return true
end

BTW.
Dzięki za chęć pomocy polaczki, ale skusiłem się napisać poza polskim boardem i poskutkowało :*

brawo, tylko teraz z każdym levelem gracz będzie dostawał promocję, a nie raz. Ja dodałem do skryptu Kuli to samo, tylko kurwa, użyłem CONST SKILL__LEVEL, czego Ty pewnie nie masz, skoro działa Ci na czystej liczbie. Gdybym wiedział, że nawet POLACZKU nie masz pełnego constant.lua, to bym od razu Ci kazał ustawić 8, bo SKILL__LEVEL == 8.

Code:
if(SKILL__LEVEL == nil) then
error("Fix your constant.lua, noob!")
end

function onAdvance(cid, skill, oldLevel, newLevel)
        if skill == SKILL__LEVEL and newLevel >= 20 and getPlayerPromotionLevel(cid) == 0 then
                doPlayerSetPromotionLevel(cid, 1)
        end
        return true
end

Skrypt dla tych, którzy dbają o swój serwer.
 
Status
Not open for further replies.
Back
Top