Jump to content

outputChatBox & addCommandHandler


Recommended Posts

Hey i want create a blacklist for the server

but my script doesn't work

  
function blacklist(thePlayer, command) 
local blacklist = outputChatBox(thePlayer) 
if (outputChatBox ) then 
outputChatBox("ignore this i 'll put the names later", thePlayer,255,255,255,true) 
addCommandHandler("blacklist", blacklist, thePlayer) 
    end 
end) 
  

i tried but i fail.

Link to comment
It's blacklist .. simple

when you type in chat or f8 / blacklist then show the people names in blacklist ...

blacklist and people names? hahaha funny

You just put a mess code that make no sense and totally wrong.

Link to comment
BlackList need Php and lot of work :(

Haha.

The only thing that it needs is an XML file or a database to store the blacklisted users, but the OP could start with account data.

function blacklist( ) 
    for i, v in ipairs ( getElementsByType ( "player" ) ) do 
        if getAccountData ( getPlayerAccount ( v ), "blacklisted" ) == true then 
            outputChatBox( "Blacklisted users:" .. getPlayerName ( v ), getRootElement ( ),255,255,255 ) 
        else 
            outputChatBox ( "There is no blacklisted users", source, 255,255,255 ) 
        end 
    end 
end 
addCommandHandler( "blacklist", getRootElement ( ), blacklist ) 

So, your command handler was inside the function and you had one more ' ) '

Edited by Guest
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...