PauloCascus Posted July 12, 2014 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
toxicsmoke11 Posted July 12, 2014 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
vx89 Posted July 12, 2014 Posted July 12, 2014 local Whitelist = { "080209AF2E09E389F6C55AFB6B5A5A54" } Hope that was the right syntax. http://lua-users.org/wiki/TablesTutorial
PauloCascus Posted July 12, 2014 Author 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
#DRAGON!FIRE Posted July 12, 2014 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 ) To Contact Me at Skype : [email protected]
PauloCascus Posted July 12, 2014 Author 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
#DRAGON!FIRE Posted July 12, 2014 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" To Contact Me at Skype : [email protected]
PauloCascus Posted July 12, 2014 Author 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
MTA Team botder Posted July 12, 2014 MTA Team Posted July 12, 2014 Nice work copying my code from the other thread guys. Please provide credits if you do this. GitHub: Debug Console • MTA-Discord Relay Scripting: How to draw a line chart with DirectX functions? • Doppler Effect in MTA • Get the client's FPS • Customizable Blur Shader
#DRAGON!FIRE Posted July 12, 2014 Posted July 12, 2014 your welcome @ Necktrox : just i fix the code .. idk from where To Contact Me at Skype : [email protected]
MTA Team botder Posted July 12, 2014 MTA Team 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. GitHub: Debug Console • MTA-Discord Relay Scripting: How to draw a line chart with DirectX functions? • Doppler Effect in MTA • Get the client's FPS • Customizable Blur Shader
AirFlexin Scr Posted February 14, 2019 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
Mr.Loki Posted February 14, 2019 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 [REL]Cinema Experience Beta 2.0 [TUT]Object offsets with OOP. [TUT] Adding a Discord bot to your server. Discord: Loki#7355
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