PauloCascus Posted July 12, 2014 Share Posted July 12, 2014 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 Link to comment
toxicsmoke11 Posted July 12, 2014 Share Posted July 12, 2014 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 Link to comment
vx89 Posted July 12, 2014 Share Posted July 12, 2014 local Whitelist = { "080209AF2E09E389F6C55AFB6B5A5A54" } Hope that was the right syntax. http://lua-users.org/wiki/TablesTutorial Link to comment
PauloCascus Posted July 12, 2014 Author Share Posted July 12, 2014 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 Link to comment
#DRAGON!FIRE Posted July 12, 2014 Share Posted July 12, 2014 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 ) Link to comment
PauloCascus Posted July 12, 2014 Author Share Posted July 12, 2014 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 Link to comment
#DRAGON!FIRE Posted July 12, 2014 Share Posted July 12, 2014 No .. if u connect and u don't in whitelist .. u disconnect and show this msg: "You are not on the whitelist" Link to comment
PauloCascus Posted July 12, 2014 Author Share Posted July 12, 2014 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 Link to comment
MTA Team botder Posted July 12, 2014 MTA Team Share Posted July 12, 2014 Nice work copying my code from the other thread guys. Please provide credits if you do this. Link to comment
#DRAGON!FIRE Posted July 12, 2014 Share Posted July 12, 2014 your welcome @ Necktrox : just i fix the code .. idk from where Link to comment
MTA Team botder Posted July 12, 2014 MTA Team Share Posted July 12, 2014 You only changed the syntax a bit and not the meant functionality. The guy with the request probably did some mess. Link to comment
AirFlexin Scr Posted February 14, 2019 Share Posted February 14, 2019 (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 February 14, 2019 by AirFlexin Link to comment
Mr.Loki Posted February 14, 2019 Share Posted February 14, 2019 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 Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now