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

Help with alternate time

Ninja Bodil

New Member
Joined
Mar 7, 2009
Messages
116
Reaction score
0
Hey. I need help with this I'll give you an example.
1. player 1 walk in a tp and get x storagevalue
2. player 2 walk in the same tp and get y storagevalue
3. player 3 walk in the same tp and get x storagevalue
2. player 4 walk in the same tp and get y storagevalue
Etc.....
 
It would probably be something like this:

Lua:
local step = 0
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition)
    if step == 0 then
        setPlayerStorageValue(cid, xxxx, x)
        step = 1
        return true
    end

    setPlayerStorageValue(cid, xxxx, x)
    step = 0
    return true
end
 
You don't undertand ?
Alternate player that walk in tp get storagevalue y
the players that walk between thoose player get storagevalue x
 
[Tested on TFS 0.3.6]
Lua:
local step = 0
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition)
    if step == 0 then
        setPlayerStorageValue(cid, xxxx, x)
        step = 1
        return true
    end
    if step == 1 then
    setPlayerStorageValue(cid, xxxx, x)
    step = 0
    return true
end
end
 
[Tested on TFS 0.3.6]
Lua:
local step = 0
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition)
    if step == 0 then
        setPlayerStorageValue(cid, xxxx, x)
        step = 1
        return true
    end
    if step == 1 then
    setPlayerStorageValue(cid, xxxx, x)
    step = 0
    return true
end
end


That should still work without the second check... I know I used that method all the time for less scripting.
 
Back
Top