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

I need a script!

otaf

New Member
Joined
Aug 5, 2009
Messages
135
Reaction score
1
When players advance lvl 100 a box will comming up and say Gratz on your lvl you can kill Demons!

Later when they advance lvl 200 a box will comming up and say Gratz on your lvl you can kill ferumbras!
 
Code:
function onAdvance(cid, skill, oldLevel, newLevel)
	local kurwa = {
		-- [level] = "text"
		[100] = "hello",
		[200] = "goodbye"
	}
	if (oldLevel < newLevel and kurwa[newLevel]) then
		doPlayerPopupFYI(cid, kurwa[newLevel])
	end
	return true
end
 
Please place such config-related things before the function. It makes the script look slightly better and doesn't parse config stuff every time script is called.
 
o_O so this is reason why some guys places config in beginning of file, for me it looks bad, but if it improves performance, I will use it ;d

EDIt: yeah, I know its really small ;d, but always feel better even with so small thing.
I know some guys that says: I don't want stickers on my bike cause it makes it heavier o_O and its sth like this ;d
 
Last edited:
Not really going to "improve performance", but it just will take some stress out of loading the script (its a small one, so no - not going to improve performance).
 
Code:
function onAdvance(cid, skill, oldLevel, newLevel)
	local kurwa = {
		-- [level] = "text"
		[100] = "hello",
		[200] = "goodbye"
	}
	if (oldLevel < newLevel and kurwa[newLevel]) then
		doPlayerPopupFYI(cid, kurwa[newLevel])
	end
	return true
end



where do i gone put this script please!
 
Where should I put it in the login.lua ?? Too many rows..

local config = {
loginMessage = getConfigValue('loginMessage'),
useFragHandler = getBooleanFromString(getConfigValue('useFragHandler'))
}

function onLogin(cid)
local loss = getConfigValue('deathLostPercent')
if(loss ~= nil) then
doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 10)
end

local accountManager = getPlayerAccountManager(cid)
if(accountManager == MANAGER_NONE) then
local lastLogin, str = getPlayerLastLoginSaved(cid), config.loginMessage
if(lastLogin > 0) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
str = "Your last visit was on " .. os.date("%a %b %d %X %Y", lastLogin) .. "."
else
str = str .. " Please choose your outfit."
doPlayerSendOutfitWindow(cid)
end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_DEFAULT, str)
elseif(accountManager == MANAGER_NAMELOCK) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, it appears that your character has been namelocked, what would you like as your new name?")
elseif(accountManager == MANAGER_ACCOUNT) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to manage your account and if you want to start over then type 'cancel'.")
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Hello, type 'account' to create an account or type 'recover' to recover an account.")
end

if(not isPlayerGhost(cid)) then
doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
end

registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "Idle")
if(config.useFragHandler) then
registerCreatureEvent(cid, "SkullCheck")
end
registerCreatureEvent(cid, "ReportBug")
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "advance")
registerCreatureEvent(cid, "ArenaKill")
registerCreatureEvent(cid, "demonOakLogout")
registerCreatureEvent(cid, "demonOakDeath")
registerCreatureEvent(cid, "KillingInTheNameOf")
registerCreatureEvent(cid, "expRate")
-- if he did not make full arena 1 he must start from zero
if getPlayerStorageValue(cid, 42309) < 1 then
for i = 42300, 42309 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 2 he must start from zero
if getPlayerStorageValue(cid, 42319) < 1 then
for i = 42310, 42319 do
setPlayerStorageValue(cid, i, 0)
end
end
-- if he did not make full arena 3 he must start from zero
if getPlayerStorageValue(cid, 42329) < 1 then
for i = 42320, 42329 do
setPlayerStorageValue(cid, i, 0)
end
end
if getPlayerStorageValue(cid, 42355) == -1 then
setPlayerStorageValue(cid, 42355, 0) -- did not arena level
end
setPlayerStorageValue(cid, 42350, 0) -- time to kick 0
setPlayerStorageValue(cid, 42352, 0) -- is not in arena

return true
end
 
Back
Top