Jump to content

Problem with table


Overkillz

Recommended Posts

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

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

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...