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

Lua OnLogin if playerid = array

tavax

New Member
Joined
Apr 29, 2009
Messages
17
Reaction score
2
Hello, i try make this script but when the first player login no one more can login in the server.....

i don't found solution and i dont found problem....

Code:
function onLogin(cid)

		for i = 0, 3, 1 do
			Result2 = db.getResult("SELECT `level`,`id`  FROM  `players` ORDER BY  `players`.`level` DESC LIMIT ".. k.." , ".. k ..";")
			PID[i] = Result2:getDataInt("id")
			k=k+1
		end
		
		for j = 0, 3, 1 do
		if (getPlayerGUID(cid) == PID[j] and getPlayerSex(cid) == 0) then
		        
                              MORE CODE...

		end
		if (getPlayerGUID(cid) == PID[j] and getPlayerSex(cid) == 1) then

                              MORE CODE...

		end
		end
		
			
        return TRUE
end
 
Lua:
local idArray = {1, 2, 3}
function onLogin(cid)
  if isInArray(idArray, getPlayerGUID(cid)) then
    if getPlayerSex(cid) == 0 then
      -- More Code?
    else
      -- More Code?
    end 
  end 

  return true
end
 
Last edited:
Back
Top