MTA Team 0xCiBeR Posted February 25, 2013 MTA Team Share Posted February 25, 2013 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
Alexs Posted February 25, 2013 Share Posted February 25, 2013 Usa: isObjectInACLGroup Link to comment
MTA Team 0xCiBeR Posted February 25, 2013 Author MTA Team Share Posted February 25, 2013 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
AlvareZ_ Posted February 25, 2013 Share Posted February 25, 2013 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
NodZen Posted February 25, 2013 Share Posted February 25, 2013 Ese es el script completo? Porque que objeto va a mover si no existe, a no ser que no sea todo el script completo. Link to comment
MTA Team 0xCiBeR Posted February 27, 2013 Author MTA Team Share Posted February 27, 2013 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
Recommended Posts