Arsilex Posted July 8, 2012 Share Posted July 8, 2012 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
Alexs Posted July 9, 2012 Share Posted July 9, 2012 si es player debera ser source Eso con eventos, aca es un Comando Link to comment
Carlossg Posted July 9, 2012 Share Posted July 9, 2012 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
Alexs Posted July 9, 2012 Share Posted July 9, 2012 Por que no posteas el recurso "players" que usas, quiza asi se entienda mejor. PD: no puedes usar espacios en las variables Link to comment
Carlossg Posted July 10, 2012 Share Posted July 10, 2012 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
Recommended Posts