Jump to content

Whitelist [HELP]


Recommended Posts

Posted

hey guys i want to create whitelist, but when resource started, debugscrip output this:

malformed number near '080209AF2E09E389F6C55AFB6B5A5A54'

so i can't create table with serial numbers ?

  
local whitelist = { 
[080209AF2E09E389F6C55AFB6B5A5A54] 
} 
  
  
addEventHandler("onPlayerConnect", root, setWhiteList ) 
function setWhiteList ( source, serial, allow ) 
local serial = getPlayerSerial ( source ) 
if serial then 
local allow = unpack ( whitelist [serialNumber] ) 
if ( serial == allow ) then 
end 
if ( serial ~= allow ) then 
kick( source, getThisResource(), "You are not in whitelist" ) 
end 
end 
end 
end 
  

Posted
local Whitelist = { 
    ["080209AF2E09E389F6C55AFB6B5A5A54"] = true 
} 
  
addEventHandler("onPlayerConnect", root, 
    function (_, _, _, serial) 
        if (not Whitelist[serial]) then 
            return cancelEvent(true, "You are not on the whitelist") 
        end 
    end 
end 

Posted
local Whitelist = { 
    ["080209AF2E09E389F6C55AFB6B5A5A54"] = true 
} 
  
addEventHandler("onPlayerConnect", root, 
    function (_, _, _, serial) 
        if (not Whitelist[serial]) then 
            return cancelEvent(true, "You are not on the whitelist") 
        end 
    end 
end 

do not work :(

Posted
local Whitelist = { 
    ["080209AF2E09E389F6C55AFB6B5A5A54"] = true 
} 
  
addEventHandler("onPlayerConnect", root, 
    function (_, _, _, serial) 
        if (not Whitelist[serial]) then 
            return cancelEvent(true, "You are not on the whitelist") 
        end 
    end 
end 

X

..

local Whitelist = { 
  ["080209AF2E09E389F6C55AFB6B5A5A54"] = true, 
} 
  
addEventHandler( "onPlayerConnect", root, function (_, _, _, serial) 
      if not ( Whitelist[ serial ] ) then 
        cancelEvent( true, "You are not on the whitelist" ) 
    end 
end ) 
Posted
local Whitelist = { 
    ["080209AF2E09E389F6C55AFB6B5A5A54"] = true 
} 
  
addEventHandler("onPlayerConnect", root, 
    function (_, _, _, serial) 
        if (not Whitelist[serial]) then 
            return cancelEvent(true, "You are not on the whitelist") 
        end 
    end 
end 

X

..

local Whitelist = { 
  ["080209AF2E09E389F6C55AFB6B5A5A54"] = true, 
} 
  
addEventHandler( "onPlayerConnect", root, function (_, _, _, serial) 
      if not ( Whitelist[ serial ] ) then 
        cancelEvent( true, "You are not on the whitelist" ) 
    end 
end ) 

idk maybe i have stupid server, but it's now working too

Posted
No .. if u connect and u don't in whitelist .. u disconnect and show this msg: "You are not on the whitelist"

oh you set my serial on the white list lol

nice it's working

ty guys

  • MTA Team
Posted

Nice work copying my code from the other thread guys. Please provide credits if you do this.

  • MTA Team
Posted

You only changed the syntax a bit and not the meant functionality. The guy with the request probably did some mess.

  • 4 years later...
Posted (edited)

local Whitelist = { 
  ["SERIAL"] = true,
  ["SERIAL"] = true,


  
addEventHandler( "onPlayerConnect", root, function (_, _, _, serial) 
      if not ( Whitelist[ serial ] ) then 
        cancelEvent( true, "Você não está na whitelist" ) 
    end 
end ) 

Edited by AirFlexin
Posted
3 hours ago, AirFlexin Scr said:

local Whitelist = { 
  ["SERIAL"] = true,
  ["SERIAL"] = true,


  
addEventHandler( "onPlayerConnect", root, function (_, _, _, serial) 
      if not ( Whitelist[ serial ] ) then 
        cancelEvent( true, "Você não está na whitelist" ) 
    end 
end ) 

Posted July 11, 2014

I think you're 5 years too late dude ?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...