Jump to content

need this


Recommended Posts

Posted

Hi I want to do this !!! something like this

a command for do the function BUUUT For the user I say! Check1

if the command is /fuck, i must say /fuck GamerDeMTA for do the function to me! how to do that

Posted

I really don't understand, you want to output when the player uses a command, and which commnd is that?

addEventHandler ( "onPlayerCommand", root, 
    function ( cmd ) 
        outputChatBox ( getPlayerName ( source ) .." used the command /".. cmd ) 
    end 
) 

Posted

ah, imagine the command is /banh how to do that the function goes to the user? For example, with /mute it's the same. I want to do it like that. For example, /warptosanfierro ..

Posted
addCommandHandler ( "hello", 
    function ( thePlayer, _, who ) 
        local playerWho = getPlayerFromName ( who ) -- Get the player from the string entered on the command. 
        if ( playerWho ) then -- If the player really exists... 
            outputChatBox ( getPlayerName ( thePlayer ) .." says hello!", playerWho ) -- Output a chatbox message to him. 
        end 
    end 
) 

Posted

i think u dont understand me :S

I mean, for example, when I write /tep GamerDeMTA, GamerDeMTA gets the function for the commandhandler. For example, GamerDeMTA is warped to somewhere. If I write /tep Castillo, then Castillo goes...

Understand ¿?

Posted

I gave you an example of how to make a command to output a message to the player you fill in the command, now you must change it to do whatever you need.

Posted

thanks but i changed sth. and it didnt work for me :S can u put a example of this?

setElementPosition 

When I say /lv UserName it goes to the Position. [The UserName]

Posted
addCommandHandler ( "warpt", 
    function ( thePlayer, _, who ) 
        local playerWho = getPlayerFromName ( who ) -- Get the player from the string entered on the command. 
        if ( playerWho ) then -- If the player really exists... 
    setElementPosition ( playerWho, x, y, z ) 
        end 
    end 
) 

Posted

\/

function teleportarPlayer (player, CMD, targetName, thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then   
        if not targetName then 
            outputChatBox("Uso Correto: /tep nick", player) 
        else 
            local target = getPlayerFromName (targetName ) 
            if not target then -- check if the name is valit 
                outputChatBox("ERRO: Jogador não encontra-se online!", player) 
            else 
                local x,y,z = getElementPosition ( target ) 
                setElementPosition ( player,x,y,z+1) 
                --setElementPosition ( player, getElementPosition ( target )) 
            end 
        end 
    end 
    addCommandHandler ( "tep", teleportarPlayer  ) 

Posted
\/
function teleportarPlayer (player, CMD, targetName, thePlayer) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then   
        if not targetName then 
            outputChatBox("Uso Correto: /tep nick", player) 
        else 
            local target = getPlayerFromName (targetName ) 
            if not target then -- check if the name is valit 
                outputChatBox("ERRO: Jogador não encontra-se online!", player) 
            else 
                local x,y,z = getElementPosition ( target ) 
                setElementPosition ( player,x,y,z+1) 
                --setElementPosition ( player, getElementPosition ( target )) 
            end 
        end 
    end 
    addCommandHandler ( "tep", teleportarPlayer  ) 

will that do it? why the outputchatboxs?

Posted
addCommandHandler ( "warpt", 
    function ( thePlayer, _, who ) 
        local playerWho = getPlayerFromName ( who ) -- Get the player from the string entered on the command. 
        if ( playerWho ) then -- If the player really exists... 
    setElementPosition ( playerWho, x, y, z ) 
        end 
    end 
) 

Are the "x, y, z" defined smoewhere at the script ?

Posted

try

addCommandHandler ( "warpt", 
    function ( thePlayer, _, who ) 
        local playerWho = getPlayerFromName ( who )  
        if ( playerWho ) then  
        local x, y, z = getElementPosition(playerWho) 
    setElementPosition ( thePlayer, x, y, z ) 
        end 
    end 
) 
  

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