Edittry this
@edit should beCode:and not isInRange
Lua:function onLogin(cid) addEvent(pzAutoLeveler, 1000, cid, 0) return true end local function pzAutoLeveler(cid, count) if not isPlayer(cid) return false end if getTilePzInfo(getPlayerPosition(cid)) == false and not isInRange(getThingPos(cid), config.fromPos, config.toPos) then addEvent(pzAutoLeveler, 1000, cid, 0) return true end if counter == 60 then doPlayerAddLevel(cid, 1) doPlayerSendTextMessage(cid, 19, "Omm, server gifted you 1 level!") return true end...
local function pzAutoLeveler(cid, counter)
if isPlayer(cid) then
if not getTilePzInfo(getPlayerPosition(cid)) then
addEvent(pzAutoLeveler, 1000, cid, 0)
else
if counter == 60 then
counter = 0
doPlayerAddLevel(cid, 1)
end
addEvent(pzAutoLeveler, 1000, cid, counter + 1)
end
end
end
function onLogin(cid)
addEvent(pzAutoLeveler, 1000, cid, 0)
return true
end
local config = {
fromPos = {x=999,y=998,z=7},
toPos = {x=1005,y=1003,z=7},
}
local function pzAutoLeveler(cid, counter)
if isPlayer(cid) then
if(isInRange(getThingPos(cid), config.fromPos, config.toPos)) then
doPlayerSendTextMessage(cid, 19, "Omm, you are in the place!")
else
doPlayerSendTextMessage(cid, 19, "Omm, you are not in the place!")
end
if not getTilePzInfo(getPlayerPosition(cid)) < 1 then
addEvent(pzAutoLeveler, 1000, cid, 0)
else
if counter == 60 then
counter = 0
doPlayerAddLevel(cid, 1)
doPlayerSendTextMessage(cid, 19, "Omm, server gifted you 1 level!")
end
addEvent(pzAutoLeveler, 1000, cid, counter + 1)
end
end
end
function onLogin(cid)
addEvent(pzAutoLeveler, 1000, cid, 0)
return true
end
local config = {
fromPos = {x=999,y=998,z=7},
toPos = {x=1005,y=1003,z=7},
}
local function pzAutoLeveler(cid, counter)
if isPlayer(cid) then
if getTilePzInfo(getPlayerPosition(cid)) == false and not isInRange(getThingPos(cid), config.fromPos, config.toPos) then
addEvent(pzAutoLeveler, 1000, cid, 0)
else
if counter == 60 then
counter = 0
doPlayerAddLevel(cid, 1)
doPlayerSendTextMessage(cid, 19, "Omm, server gifted you 1 level!")
end
addEvent(pzAutoLeveler, 1000, cid, counter + 1)
end
end
end
function onLogin(cid)
addEvent(pzAutoLeveler, 1000, cid, 0)
return true
end
and not isInRange
function onLogin(cid)
addEvent(pzAutoLeveler, 1000, cid, 0)
return true
end
local function pzAutoLeveler(cid, count)
if not isPlayer(cid)
return false
end
if getTilePzInfo(getPlayerPosition(cid)) == false and not isInRange(getThingPos(cid), config.fromPos, config.toPos) then
addEvent(pzAutoLeveler, 1000, cid, 0)
return true
end
if counter == 60 then
doPlayerAddLevel(cid, 1)
doPlayerSendTextMessage(cid, 19, "Omm, server gifted you 1 level!")
return true
end
addEvent(pzAutoLeveler, 1000, cid, count + 1)
return true
end
what about ur momLua:function onLogin(cid) addEvent(pzAutoLeveler, 1000, cid, 0) return true end local function pzAutoLeveler(cid, count) if not isPlayer(cid) return false end if getTilePzInfo(getPlayerPosition(cid)) == false and not isInRange(getThingPos(cid), config.fromPos, config.toPos) then addEvent(pzAutoLeveler, 1000, cid, 0) return true end if counter == 60 then doPlayerAddLevel(cid, 1) doPlayerSendTextMessage(cid, 19, "Omm, server gifted you 1 level!") return true end addEvent(pzAutoLeveler, 1000, cid, count + 1) return true end
Easier to read imo
She very proud, thanks for askingwhat about ur mom
Edittry this
@edit should beCode:and not isInRange
You are ending the script prematurely and it won't loop.Lua:function onLogin(cid) addEvent(pzAutoLeveler, 1000, cid, 0) return true end local function pzAutoLeveler(cid, count) if not isPlayer(cid) return false end if getTilePzInfo(getPlayerPosition(cid)) == false and not isInRange(getThingPos(cid), config.fromPos, config.toPos) then addEvent(pzAutoLeveler, 1000, cid, 0) return true end if counter == 60 then doPlayerAddLevel(cid, 1) doPlayerSendTextMessage(cid, 19, "Omm, server gifted you 1 level!") return true end addEvent(pzAutoLeveler, 1000, cid, count + 1) return true end
Easier to read imo
You can add another value and check your script against that value.Ok thanks all and how to add messages when player joined to the place and leave?
local config = {
fromPos = {x = 999, y = 998, z = 7},
toPos = {x = 1005, y = 1003, z = 7}
}
local function pzAutoLeveler(cid, counter, msg_check)
if isPlayer(cid) then
local cid_pos = getThingPosition(cid)
if getTilePzInfo(cid_pos) == false or not isInRange(cid_pos, config.fromPos, config.toPos) then
if msg_check ~= 0 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You are no longer in a pz zone.")
end
addEvent(pzAutoLeveler, 1000, cid, 0, 0)
else
if msg_check ~= 1 then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "You are now in a pz zone.")
end
if counter == 60 then
counter = 0
doPlayerAddLevel(cid, 1)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, "Omm, server gifted you 1 level!")
end
addEvent(pzAutoLeveler, 1000, cid, counter + 1, 1)
end
end
end
function onLogin(cid)
addEvent(pzAutoLeveler, 1000, cid, 0, 2)
return true
end