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

login.lua

Kozi

Search Hosting
Joined
Dec 24, 2008
Messages
259
Reaction score
0
Location
Poland !
Hello everybody

I need fixed login.lua i readed something about return TRUE ...

I have two kill event and just one is working ...(down)

my creaturescripts.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
	<event type="login" name="PlayerLogin" script="login.lua"/>
	<event type="login" name="FirstItems" script="firstitems.lua"/>
	<event type="death" name="PlayerDeath" script="playerdeath.lua"/>
	<event type="death" name="inquisition" script="inquisition.lua"/>
	<event type="death" name="azerus" script="azerus.lua"/>
	<event type="kill" name="pythiusquest" script="pythiusquest.lua"/>
	<event type="kill" name="PlayerKill" script="kill.lua"/>  

</creaturescripts>

login.lua

Code:
function onLogin(cid)
	registerCreatureEvent(cid, "PlayerDeath")
        registerCreatureEvent(cid, "inquisition") 
        	registerCreatureEvent(cid, "azerus")
        	registerCreatureEvent(cid, "pythiusquest")
        	    registerCreatureEvent(cid, "PlayerKill")
    if (InitArenaScript ~= 0) then
    InitArenaScript = 1
    -- make arena rooms free
        for i = 42300, 42309 do
            setGlobalStorageValue(i, 0)
            setGlobalStorageValue(i+100, 0)
        end
    end
    -- 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
return TRUE

For help rep+
 
Try this one:
Code:
function onLogin(cid)
	registerCreatureEvent(cid, "PlayerDeath")
        registerCreatureEvent(cid, "inquisition") 
        registerCreatureEvent(cid, "azerus")
        registerCreatureEvent(cid, "pythiusquest")
        registerCreatureEvent(cid, "PlayerKill")


  if (InitArenaScript ~= 0) then
    InitArenaScript = 1
    -- libera as salas da arena
        for i = 42300, 42309 do
            setGlobalStorageValue(i, 0)
            setGlobalStorageValue(i+100, 0)
        end
    end
    -- senão completou arena 1 começa do zero
    if getPlayerStorageValue(cid, 42309) < 1 then
        for i = 42300, 42309 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- senão completou arena 2 começa do zero
    if getPlayerStorageValue(cid, 42319) < 1 then
        for i = 42310, 42319 do
            setPlayerStorageValue(cid, i, 0)
        end
    end
    -- senão completou arena 3 começa do 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) -- não fez arena
    end
    setPlayerStorageValue(cid, 42350, 0) -- tempo pra kick 0
    setPlayerStorageValue(cid, 42352, 0) -- não está na arena

  local loss = getConfigValue('deathLostPercent')
  if(loss ~= nil) then
    for i = PLAYERLOSS_EXPERIENCE, PLAYERLOSS_ITEMS do
      doPlayerSetLossPercent(cid, i, loss)
    end
  end

  if(InitHistory == 0) then
    local historyPage = addEvent(historyPage, 60000, {})
    InitHistory = historyPage
   end
  return TRUE
end
 
When was

Code:
  local loss = getConfigValue('deathLostPercent')
  if(loss ~= nil) then
    for i = PLAYERLOSS_EXPERIENCE, PLAYERLOSS_ITEMS do
      doPlayerSetLossPercent(cid, i, loss)
    end
  end

  if(InitHistory == 0) then
    local historyPage = addEvent(historyPage, 60000, {})
    InitHistory = historyPage
   end

i cannot login to game so i deleted it and again just 1 kill event working ;/
 
Code:
function onKill(cid, target)
if (getCreatureName(target) == "Pythius The Rotten") then
setGlobalStorageValue(5544, -1)
doTeleportThing(cid, {x=34923,y=32205,z=15})
end
end
 
Try this one:
Code:
function onDeath(cid, corpse, killer)
    local position = getCreaturePosition(cid)
        if Pythius The Rotten == getCreatureName(cid) then
               setGlobalStorageValue(5544, -1)
               doTeleportThing(cid, {x=34923,y=32205,z=15})
        end
    return TRUE
end

Or if this one doesnt work:
Code:
function onDeath(cid, corpse, killer)
    local position = getCreaturePosition(cid)
        if "Pythius The Rotten" == getCreatureName(cid) then
               setGlobalStorageValue(5544, -1)
               doTeleportThing(cid, {x=34923,y=32205,z=15})
        end
    return TRUE
end
 
Back
Top