Jump to content

Comando /cuff


Arsilex

Recommended Posts

Hola miren hize este script pero no me funciona

addCommandHandler ( "cuff", 
    function ( player, commandName, otherPlayer ) 
        local cuff = toggleAllControls ( player ) 
        if ( otherPlayer and cuff ) then 
            local other, name = exports.players:getFromName ( player, otherPlayer ) 
            if ( other ) then 
                if ( player ~= other ) then 
                    local x, y, z = getElementPosition ( player ) 
                    if ( getDistanceBetweenPoints3D ( x, y, z, getElementPosition ( other ) ) < 5 ) then 
                        toggleAllControls ( other, true ) 
                        outputChatBox ( " Arrestado por" .. name .. " ".", player, 0, 255, 0 ) 
                        outputChatBox ( getPlayerName ( player ):gsub ( "_", " " ) .. " te arresto.", other, 0, 255, 0 ) 
                    else 
                        outputChatBox ( "Estas lejos de  " .. name .. ".", player, 255, 0, 0 ) 
                    end 
                else 
                    outputChatBox ( "No puedes darte arma a ti mismo.", player, 255, 0, 0 ) 
                end 
            end 
        else 
            outputChatBox ( "Syntax: /" .. commandName .. " [player]", player, 255, 255, 255 ) 
        end 
    end 
) 
 

Al poner cuff tiene que dejar al jugador (other) sin movimiento

Link to comment
Hola miren hize este script pero no me funciona
addCommandHandler ( "cuff", 
    function ( player, commandName, otherPlayer ) 
        local cuff = toggleAllControls ( player ) 
        if ( otherPlayer and cuff ) then 
            local other, name = exports.players:getFromName ( player, otherPlayer ) 
            if ( other ) then 
                if ( player ~= other ) then 
                    local x, y, z = getElementPosition ( player ) 
                    if ( getDistanceBetweenPoints3D ( x, y, z, getElementPosition ( other ) ) < 5 ) then 
                        toggleAllControls ( other, true ) 
                        outputChatBox ( " Arrestado por" .. name .. " ".", player, 0, 255, 0 ) 
                        outputChatBox ( getPlayerName ( player ):gsub ( "_", " " ) .. " te arresto.", other, 0, 255, 0 ) 
                    else 
                        outputChatBox ( "Estas lejos de  " .. name .. ".", player, 255, 0, 0 ) 
                    end 
                else 
                    outputChatBox ( "No puedes darte arma a ti mismo.", player, 255, 0, 0 ) 
                end 
            end 
        else 
            outputChatBox ( "Syntax: /" .. commandName .. " [player]", player, 255, 255, 255 ) 
        end 
    end 
) 
  
  
  
  
 

Al poner cuff tiene que dejar al jugador (other) sin movimiento

Veo que le descativas los controles.

No sería mejor usar

setElementFrozen 

?

Link to comment

Mira esta línea:

outputChatBox ( " Arrestado por" .. name .. " ".", player, 0, 255, 0 ) 
 

y mirala corregida

outputChatBox ( " Arrestado por" .. name .. ".", player, 0, 255, 0 ) --Te sobraban unas comillas que jodían todo el script 

Prueba y comentas si era eso.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...