• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

0.3.4 PL2 --> Login.lua bug

pawelzion

New Member
Joined
May 5, 2009
Messages
132
Reaction score
0
Location
Poland
Hello,
On my ots when player dead on 100 lvl he is dowgnraded to 1 lvl.Hof fix it?
This is my file login.lua

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

registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "Pacccheck")
return TRUE
end

function onLogin(cid)
local premStorage = 5598
if isPremium(cid) == TRUE and getPlayerStorageValue(cid, premStorage) == -1 then
setPlayerStorageValue(cid, premStorage, 1)
elseif isPremium(cid) == FALSE and getPlayerStorageValue(cid, premStorage) == 1 then
setPlayerStorageValue(cid, premStorage, -1)
elseif isPremium(cid) == FALSE and getPlayerStorageValue(cid, premStorage) == 1 and getPlayerVocation(cid) > 4 then
doPlayerSetVocation(cid, getPlayerVocation(cid) -4)
end
return TRUE
end
 
Hello,
On my ots when player dead on 100 lvl he is dowgnraded to 1 lvl.Hof fix it?
This is my file login.lua

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

registerCreatureEvent(cid, "Mail")
registerCreatureEvent(cid, "GuildMotd")
registerCreatureEvent(cid, "PlayerDeath")
registerCreatureEvent(cid, "Pacccheck")
return TRUE
end

function onLogin(cid)
local premStorage = 5598
if isPremium(cid) == TRUE and getPlayerStorageValue(cid, premStorage) == -1 then
setPlayerStorageValue(cid, premStorage, 1)
elseif isPremium(cid) == FALSE and getPlayerStorageValue(cid, premStorage) == 1 then
setPlayerStorageValue(cid, premStorage, -1)
elseif isPremium(cid) == FALSE and getPlayerStorageValue(cid, premStorage) == 1 and getPlayerVocation(cid) > 4 then
doPlayerSetVocation(cid, getPlayerVocation(cid) -4)
end
return TRUE
end

Change:
LUA:
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 2)

To:
LUA:
		doPlayerSetLossPercent(cid, PLAYERLOSS_EXPERIENCE, loss * 7)

Also, check the config.lua
Untouched:
LUA:
	deathLostPercent = 10

That should be at 10.

Last place to check is vocations. If those are all set, then you shouldn't have anymore problems I think. (Untested) Just a theory since I haven't touched my death loss percents yet.
 
Back
Top