Jump to content

how does .. work?


joedajoester

Recommended Posts

I need it so someone can type, warp me to [a playername]

function sendMessage2( messageclean, messageType, commandName, player2nick, ..name ) 
    if (string.find(messageclean, "warp") and string.find(messageclean, "..name")) then 
        outputChatBox("You asked!", source, 0, 255, 0) 
        executeCommandHandler ( "warp", "..name", source ) 
    end 
end 
addEventHandler("onPlayerChat",root,sendMessage2) 

i just dont understand how the .. works

Link to comment

Like that ?

  
addEventHandler("onPlayerChat", getRootElement(), 
function(message, messageType) 
    if message then 
        if(string.find(message, "warp me to"))then 
            local player = gettok ( message, 4, string.byte(' ') ) 
            outputChatBox("Okey ! Warp now !") 
            executeCommandHandler ( "warp", player, source ) 
             
        end 
    end 
end) 
  

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