• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Lua How to prevent same ip from the reward?

MohamedRefaat

Marketing and Coding
Premium User
Joined
Jan 18, 2014
Messages
991
Solutions
3
Reaction score
232
Location
Egypt
Hello

I made this script to give a reward to players who are online every 1 hour.
But i want to prevent this reward for players with the same ip.
Any help?
TFS 0.3.7 for 8.60
LUA:
local time = 60 * 60 * 1 -- 1 hour

local function AddGift(cid)
    if isPlayer(cid) then
        doPlayerAddItem(cid, 6527, 100, 100)
        doPlayerSendTextMessage(cid, 25, "You have been rewarded by 100 tokens for being online for 1 hour.")
        addEvent(AddGift, time * 1000, cid)
    end
end

function onLogin(cid)
    addEvent(AddGift, time * 1000, cid)
    return true
end
 
I found these functions regarding IP:


Maybe one of these will get the job done.
Yea i know these functions and i saw in some scripts which prevent frag reward for the same ip players, but in these scripts it compare cid with target. What it should be here?
 
I would have helped you if I knew, I've never worked with IP scripts before.
But if I were to work with them, I'd check those functions out, find more scripts that uses them, compare and use the old trial & error.

Someone will pick it up and help you with it if you can't solve it yourself.
Some scripters here do insane stuff.
 
I would have helped you if I knew, I've never worked with IP scripts before.
But if I were to work with them, I'd check those functions out, find more scripts that uses them, compare and use the old trial & error.

Someone will pick it up and help you with it if you can't solve it yourself.
Some scripters here do insane stuff.
Yea and thanks for your help ofc :)
 
Back
Top