Overkillz Posted January 24, 2016 Share Posted January 24, 2016 Hey dear community, I have a little doubt, well, lets start with it. Im trying to create an ignore system, well, the problem is that when I insert their names in the table, the table can be check by everybody. well, there is a way to do it just for the local player ? ignorePlayers = {} function setIgnore(thePlayer,cmd,playerIgnored) table.insert(ignorePlayers, playerIgnored) outputChatBox("#ff8800[ignore] #ffffffYou marked as an ignored player to: #ffffff"..playerIgnored,thePlayer,255,255,255,true) end addCommandHandler("ignore",setIgnore) function checkIgnore(thePlayer) for i,v in ipairs(ignorePlayers) do outputChatBox("#04B431#"..i.."#ffffff - Player: #04B431"..v, thePlayer, 255, 255, 255, true) end end addCommandHandler("check",checkIgnore) Thanks for reading, regards. Link to comment
Castillo Posted January 24, 2016 Share Posted January 24, 2016 Create a sub-table using the player element as index. if ( not ignorePlayers [ thePlayer ] ) then ignorePlayers [ thePlayer ] = { } end table.insert ( ignorePlayers [ thePlayer ], playerIgnored ) Link to comment
Overkillz Posted January 24, 2016 Author Share Posted January 24, 2016 Create a sub-table using the player element as index. if ( not ignorePlayers [ thePlayer ] ) then ignorePlayers [ thePlayer ] = { } end table.insert ( ignorePlayers [ thePlayer ], playerIgnored ) Gracias dude Link to comment
Overkillz Posted January 24, 2016 Author Share Posted January 24, 2016 Another little doubt, If I want to trigger the table, Can I trigger it as a normal value right ? I have this doubt because I have different chatbox functions which uses a different system because are old scripts when I was even more noob at scripting. it should be: triggerEvent ( "onLaconcha", getRootElement(), ignorePlayers [ thePlayer ]) --or triggerEvent ( "onLaconcha", getRootElement(), ignorePlayers) Link to comment
Castillo Posted January 24, 2016 Share Posted January 24, 2016 It depends if you want to send everyone's ignored players or a specific player's. Link to comment
Overkillz Posted January 24, 2016 Author Share Posted January 24, 2016 It depends if you want to send everyone's ignored players or a specific player's. All ignored players will be triggered. 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