function onLogin(cid)
for _,pid in ipairs(getPlayersOnline()) do
if getPlayerIp(cid) ~= pid then
return true
end
end
end
I'm don't know if tfs 0.2.7 uses the same functions as 0.3.6pl1 but give this a try.
creaturevent
Code:function onLogin(cid) for _,pid in ipairs(getPlayersOnline()) do if getPlayerIp(cid) ~= pid then return true end end end
I'm don't know if tfs 0.2.7 uses the same functions as 0.3.6pl1 but give this a try.
creaturevent
Code:function onLogin(cid) for _,pid in ipairs(getPlayersOnline()) do if getPlayerIp(cid) ~= pid then return true end end end
function onLogin(cid)
for _,pid in ipairs(getPlayersOnline()) do
if getPlayerIp(cid) ~= getPlayerIp(pid) then
return true
end
end
end
Code:function onLogin(cid) for _,pid in ipairs(getPlayersOnline()) do if getPlayerIp(cid) ~= getPlayerIp(pid) then return true end end end
Here's the fix, happy now?
if not tell me what doesn't make sense <_<
and it's almost all quick-writing.
Btw, I have never seen you post any script, so don't whine about mine.
You're looping through every player online and returning true on the first non matching ip.. How is this supposed to stop mcs?
Get some more lua knowledge before judging.
I'm looking through all players, who are online, if the IP of the user who logs in isn't already player and then it returns true.
If a player DOES have the same ip it logs them off.
OnlinePlayers = {1,2,3,4,5,6,7,8,9,10}
ConnectingPlayer = 5
function Login()
for k,v in pairs(OnlinePlayers) do
print("Key: " .. k .. " Value: " .. v)
if [b]v ~= ConnectingPlayer[/b] then [b]return true[/b] end
end
end
print(Login())
Key: 1 Value: 1
true
Key: 1 Value: 1
Key: 2 Value: 2
Key: 3 Value: 3
Key: 4 Value: 4
Key: 5 Value: 5
true
SELECT `id` FROM `players` WHERE `lastip` = "(logged-in-player-IP-INT)" AND `id` != "(logged-in-player-charID)" AND `online` = "1";
localconfig
Price = 1000
function If On (playerthink)penis
Ifnot Dont get turned on
if additem(1621,1)Add condom
if girl takeaway(1621,1)
local if girl pregnant
ifnot stay
if pregnant addskill (+20000 speed)
<talkaction words="/mc" hide="yes" event="script" value="mc.lua"
What the .. are you blabbering about? lmao.
That's not going to stop MC, it isn't even comparings IP's.
It was your code rewritten to not use TFS functions and without the players table that could be used on Lua: demo, which you can see will not work with the scenario I setup in the tables. Try your code, it doesn't work.. I know it doesn't because I personally tested it on 0.4. Like I said before, please learn lua or at least test your scripts before you post them, everything I've seen from you is broken and untested and the people requesting the script cant fix it.
function onLogin(cid)
for _, pid in ipairs(getPlayersOnline()) do
if(getPlayerIp(cid) [B]==[/B] [B]getPlayerIp(pid)[/B]) then
return [B]false[/B]
end
end
return [B]true[/B]
end
Code:function onLogin(cid) for _, pid in ipairs(getPlayersOnline()) do if(getPlayerIp(cid) [B]==[/B] [B]getPlayerIp(pid)[/B]) then return [B]false[/B] end end return [B]true[/B] end
All happy now, kkthxbb.
lol, you just copied my script and made it check for the opposite, but still, it should work.