Jump to content

Variaciones de Comando


0xCiBeR

Recommended Posts

  • MTA Team

Bueno estube preparando esto para un script de puertas para mi servidor, y queria aportarlo a la comunidad para el que lo quiera utilizar..Las coordenadas usadas son aleatorias, por ahi no existen..Es solo a modo de ejemplo para explicar la funcionalidad de una variacion de comando..

Si en algo estoy equivocado, o si de alguna manera quieren corregir mi codigo, pueden hacerlo debajo..Salu2 :D

Esta en ingles porque me manejo mejor con el..Ademas para que los de la seccion en ingles tambien lo entiendan!

--Command Variation Example By GGC|CiBeR 
--Copyright Global Gaming Community 
--Note this example was scripted with random data.Please adapt to your needs.Do not remove copyright! 
----------------------------------------------------------------------------------------- 
entry = createObject(1234,32132,12323,15) --Create the gate------------------------------ 
isOpenEntry = "closed" --Define the global variable to identify the state of the gate---- 
elev = createObject(1234,342543,324234,17) --Create the elevator------------------------- 
isElevatorUp = "down" --Define the global variable to identify the state of the elevator- 
----------------------------------------------------------------------------------------- 
--Init 
function CMD (player,cmd,mode) 
--if isObjectInACLGroup("user.".. getAccountName(getPlayerAccount(player)),"U.T.R") then 
if (mode == "entry") and (isOpenEntry == "closed") then 
      moveObject(entry,5000,34234,43243,15) 
      isOpenEntry = "open" 
      elseif (mode == "entry") and (isOpenEntry == "open") then 
      moveObject(entry,5000,43243,3243,17) 
      isOpenEntry = "closed" 
      elseif (mode == "elevator" and (isElevatorUp == "down") then 
      moveObject(elev,5000,2343,234324,17) 
      isElevatorUp = "up" 
      elseif (mode == "elevator" and (isElevatorUp == "up") then 
      moveObject(elev,5000,2343,234324,17) 
      isElevatorUp = "down" 
end 
end 
end 
--end 
end--End of Function 
addCommandHandler("utrls",CMD)--Define the Command 
-- /utrls entry (Switches the Door) 
-- /utrls elevator (Switches the Elevator) 
--End of Script 

Link to comment
  • Recently Browsing   0 members

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