Jump to content

Quiero mover el objeto pero que este restringido por acl


0xCiBeR

Recommended Posts

  • MTA Team
addCommandHandler ( "entry", 
    function (player) 
  
if getElementData (ent1, "posent1") == "closedent1" then 
            moveObject( ent1, 5000, 1067.4000244141, 1364.3000488281, 7.300000190735) 
            setElementData ( ent1, "posent1", "openent1" ) 
    outputChatBox( "Entrada : Abierta", player, 0, 0, 255, true ) 
        else 
            moveObject ( ent1, 5000, 1067.4000244141, 1364.3000488281, 12.300000190735) 
            setElementData ( ent1, "posent1", "closedent1" ) 
    outputChatBox( "Entrada : Cerrada", player, 255, 0, 0, true ) 
        end 
    end 
) 

que agrego si quiero que este restringido al acl "Admin" ?? Gracias

Link to comment
  • MTA Team

ok pero como pongo eso en mi script, como va el THEN y eso...Me podes dar un ejemplo con el pedazo de script que te pase?

seria asi?

addCommandHandler ( "entry", 
    function (player) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
if getElementData (ent1, "posent1") == "closedent1" then 
            moveObject( ent1, 5000, 1067.4000244141, 1364.3000488281, 7.300000190735) 
            setElementData ( ent1, "posent1", "openent1" ) 
    outputChatBox( "Entrada : Abierta", player, 0, 0, 255, true ) 
        else 
            moveObject ( ent1, 5000, 1067.4000244141, 1364.3000488281, 12.300000190735) 
            setElementData ( ent1, "posent1", "closedent1" ) 
    outputChatBox( "Entrada : Cerrada", player, 255, 0, 0, true ) 
        end 
    end 
end 
) 

Link to comment

intenta esto:

addCommandHandler ( "entry", 
    function (player) 
  
     local accName = getAccountName ( getPlayerAccount ( player ) ) 
     if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
            moveObject( ent1, 5000, 1067.4000244141, 1364.3000488281, 7.300000190735) 
            setElementData ( ent1, "posent1", "openent1" ) 
    outputChatBox( "Entrada : Abierta", player, 0, 0, 255, true ) 
        else 
            moveObject ( ent1, 5000, 1067.4000244141, 1364.3000488281, 12.300000190735) 
            setElementData ( ent1, "posent1", "closedent1" ) 
    outputChatBox( "Entrada : Cerrada", player, 255, 0, 0, true ) 
        end 
    end 
) 

Link to comment
  • MTA Team

mmmm pues asi es completo :

gRoot = getRootElement () 
gResRoot = getResourceRootElement ( getThisResource () ) 
  
addEventHandler ( "onResourceStart", gResRoot, 
    function () 
         
        cea1 = createObject( 10184, 3073.1000976563, -686.90002441406, 11.699999809265) 
    setElementData ( cea1, "ceapos1", "ceaclosed1" ) 
           end 
) 
  
addCommandHandler ( "ceaentry", 
    function (player) 
local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) 
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then 
if getElementData (cea1, "ceapos1") == "ceaclosed1" then 
            moveObject( cea1, 5000, 3073.1000976563, -686.90002441406, 6.699999809265) 
            setElementData ( cea1, "ceapos1", "ceaopen1" ) 
    outputChatBox( "Entrada CEA : Abierta", player, 0, 0, 255, true ) 
        else 
            moveObject ( cea1, 5000, 3073.1000976563, -686.90002441406, 11.699999809265) 
            setElementData ( cea1, "ceapos1", "ceaclosed1" ) 
    outputChatBox( "Entrada CEA : Cerrada", player, 255, 0, 0, true ) 
        else 
    outputChatBox( "La entrada Aun Se mueve!Espere", player, 255, 0, 0, true )   
        end 
        end 
) 

cual sera el problema?

Link to comment
  • Recently Browsing   0 members

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