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

scripters hand please ?

Calon

Experienced Member
Joined
Feb 6, 2009
Messages
1,070
Reaction score
21
hello,

actually i got a teleport leads to a zone while every player enter this tp will get a storage value = 1.

so my question how to make that if some player already joined and got storage value = 1, then he is not allowed to enter with Mc (same ip) anymore?

i've tried by
Code:
 if  getPlayerIp(cid) == getPlayerIp(getPlayerStorageValue(1111) == 1) then
but i got an error by getting <InteralGetPlayerInfo>

any help please ?
 
Code:
local t = {
			a = 11145,
			g = 11146,
			l = 11147,
			u = 11148,
			h = 11149,
			wv = 11150,
			c = 0,
			q = "Rush Event has been started! Enjoy and have fun!",
			f = 15447,
			f_1 = 15448,
			f_2 = 15449,
			d_1 = {x = 32061, y = 32317, z = 7}, -- red temple
			d_2 = {x = 32061, y = 32294, z = 7}, -- blue temple
			x = "Event won't start bacause too few people were willing to participate",
			w = {x = 32135, y = 32328, z = 8},
			lvl = 150,
			v = 2,
			mn = 2,
			m = 40,
			o = "Event was completed, RED TEAM has won Rush Event!",
			y = "Event was completed, BLUE TEAM has won Rush Event!",
			i_1 = 2160,
			i_2 = 10,
			t = 1,
			r = 1,
			timetoclose = 420,
			teleportActionId = 11112, -- Action id of the teleport needed for the movement script
            teleportPosition = {x = 32346, y = 32224, z = 7, stackpos = 1}, -- Where the teleport will be created
            teleportToPosition = {x = 32135, y = 32328, z = 8}, -- Where the teleport will take you
            teleportId = 1387, -- Id of the teleport
			nie = {x=32349, y=32222, z=6}
		}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if  getGlobalStorageValue(t.wv) ~= 1 then
			 if  getPlayerIp(cid) == getPlayerIp(getPlayerStorageValue(t.a) == 1) then
			if getPlayerLevel(cid) >= t.lvl then
			       doTeleportThing(cid,{x=32136, y=32265, z=7},false)
				if getPlayerStorageValue(cid, t.f) == -1 then
						if getGlobalStorageValue(t.c) < t.m then
							setGlobalStorageValue(t.c, getGlobalStorageValue(t.c)+1)
							setPlayerStorageValue(cid, t.a, 1)	
							if getGlobalStorageValue(t.c) == t.m then
								doPlayerSendCancel(cid, "Event is full [" .. getGlobalStorageValue(t.c) .. " players]!")
							else 
                                						
								doTeleportThing(cid,t.w,false)
								doBroadcastMessage("" .. getPlayerName(cid) .. " has joined to Rush Event! Actually we have: " .. getGlobalStorageValue(t.c) .. " players!", MESSAGE_EVENT_DEFAULT)

							end
							setPlayerStorageValue(cid, t.f, 1)
							setPlayerStorageValue(cid, t.h, -1)
							doTeleportThing(cid, t.w)
							doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
							setPlayerStorageValue(cid, t.g, getGlobalStorageValue(t.g))
							setGlobalStorageValue(t.g, tonumber(getGlobalStorageValue(t.g))+1)
						else
							doPlayerSendCancel(cid, "Event is full [" .. getGlobalStorageValue(t.c) .. " players]!")
							doTeleportThing(cid, fromPosition, true)
							return true
						end
				else
					doPlayerSendCancel(cid, "You are already registered in this event.")
												doTeleportThing(cid, fromPosition, true)

					return true
				end
			else
			    doTeleportThing(cid, fromPosition, true)
				doPlayerSendTextMessage(cid,MESSAGE_TYPES["orange"],"Only players of level ".. t.lvl.. "+ can join this event.")
				
				return true
			end  			
		else
			doPlayerSendCancel(cid, "Sorry, MC's not allowed here.")
			doTeleportThing(cid, fromPosition, true)
			return true
		end
				else
			doPlayerSendCancel(cid, "At the moment there are no records for this event.")
			doTeleportThing(cid, fromPosition, true)
			return true
		end
		return true
	end
 
The thing im thinkig now, is that it should check for the players online with that storage or check the area for the same ip.
 
but the second is recommended.

Why is that? Depending on the area it might be better to check all players.

@script:
Next time use variable names like aaaa, aaab, aaac, aaad, aaae so nobody has a clue what it is.
 
Why is that? Depending on the area it might be better to check all players.

@script:
Next time use variable names like aaaa, aaab, aaac, aaad, aaae so nobody has a clue what it is.

:P well how to make the first idea ? could you help ?

i've tried
Code:
 for _, pid in ipairs(getPlayersOnline()) do	
			 if  getPlayerIp(pid) == getPlayerIp(getPlayerStorageValue(t.a) == 1) then
but useless
 
LUA:
for _, pid in pairs(getPlayersOnline()) do	
      if getPlayerStorageValue(pid, t.a) == 1 then
	   if getPlayerIp(cid) == getPlayerIp(pid) then
           end
      end
end
 
lol i cant enter anymore i just walk normally :o

Code:
local t = {
			a = 11145,
			g = 11146,
			l = 11147,
			u = 11148,
			h = 11149,
			wv = 11150,
			c = 0,
			q = "Rush Event has been started! Enjoy and have fun!",
			f = 15447,
			f_1 = 15448,
			f_2 = 15449,
			d_1 = {x = 32061, y = 32317, z = 7}, -- red temple
			d_2 = {x = 32061, y = 32294, z = 7}, -- blue temple
			x = "Event won't start bacause too few people were willing to participate",
			w = {x = 32135, y = 32328, z = 8},
			lvl = 150,
			v = 2,
			mn = 2,
			m = 40,
			o = "Event was completed, RED TEAM has won Rush Event!",
			y = "Event was completed, BLUE TEAM has won Rush Event!",
			i_1 = 2160,
			i_2 = 10,
			t = 1,
			r = 1,
			timetoclose = 420,
			teleportActionId = 11112, -- Action id of the teleport needed for the movement script
            teleportPosition = {x = 32346, y = 32224, z = 7, stackpos = 1}, -- Where the teleport will be created
            teleportToPosition = {x = 32135, y = 32328, z = 8}, -- Where the teleport will take you
            teleportId = 1387, -- Id of the teleport
			nie = {x=32349, y=32222, z=6}
		}

function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
	if  getGlobalStorageValue(t.wv) ~= 1 then
[COLOR="#FF0000"]	        for _, pid in pairs(getPlayersOnline()) do	
      if getPlayerStorageValue(pid, t.a) == 1 then
	   if getPlayerIp(cid) == getPlayerIp(pid) then[/COLOR]

			if getPlayerLevel(cid) >= t.lvl then
			       doTeleportThing(cid,{x=32136, y=32265, z=7},false)
				if getPlayerStorageValue(cid, t.f) == -1 then
						if getGlobalStorageValue(t.c) < t.m then
							setGlobalStorageValue(t.c, getGlobalStorageValue(t.c)+1)
							setPlayerStorageValue(cid, t.a, 1)	
							if getGlobalStorageValue(t.c) == t.m then
								doPlayerSendCancel(cid, "Event is full [" .. getGlobalStorageValue(t.c) .. " players]!")
							else 
                                						
								doTeleportThing(cid,t.w,false)
								doBroadcastMessage("" .. getPlayerName(cid) .. " has joined to Rush Event! Actually we have: " .. getGlobalStorageValue(t.c) .. " players!", MESSAGE_EVENT_DEFAULT)

							end
							setPlayerStorageValue(cid, t.f, 1)
							setPlayerStorageValue(cid, t.h, -1)
							doTeleportThing(cid, t.w)
							doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
							setPlayerStorageValue(cid, t.g, getGlobalStorageValue(t.g))
							setGlobalStorageValue(t.g, tonumber(getGlobalStorageValue(t.g))+1)
						else
							doPlayerSendCancel(cid, "Event is full [" .. getGlobalStorageValue(t.c) .. " players]!")
							doTeleportThing(cid, fromPosition, true)
							return true
						end
				else
					doPlayerSendCancel(cid, "You are already registered in this event.")
												doTeleportThing(cid, fromPosition, true)

					return true
				end
			else
			    doTeleportThing(cid, fromPosition, true)
				doPlayerSendTextMessage(cid,MESSAGE_TYPES["orange"],"Only players of level ".. t.lvl.. "+ can join this event.")
				
				return true
			end  			
		else
			doPlayerSendCancel(cid, "Sorry, MC's not allowed here.")
			doTeleportThing(cid, fromPosition, true)

			return true

      end
	  					end
		           end

				else
			doPlayerSendCancel(cid, "At the moment there are no records for this event.")
			doTeleportThing(cid, fromPosition, true)
			return true
		end
		return true
	end
 
it wont work, you cant use this reference (getPlayerStorageValue(1111) == 1) for CID, it will return a boolean...

what do you want to do?

yes
B
U
M
P

that is what i said :D .... Xxx Totl xxX try to use cid in the reference getPlayerIP

Code:
getPlayerIp(cid, getPlayerStorageValue(cid, storage)
you also may use; {before the previous codes}
Code:
for _, cid in ipairs(getPlayersOnline()) do
if you got any posts here just post again.
 

yes
B
U
M
P

that is what i said :D .... Xxx Totl xxX try to use cid in the reference getPlayerIP

Code:
getPlayerIp(cid, getPlayerStorageValue(cid, storage)
you also may use; {before the previous codes}
Code:
for _, cid in ipairs(getPlayersOnline()) do
if you got any posts here just post again.

also, he could save global storages with ips and check them as a table..
getGlobalStorageValue("ip")

or he will need to check the creatures online for ip matches then table them for a storage check.. (with slaves second code reference...)
 
Back
Top