Atouk Posted February 19, 2013 Share Posted February 19, 2013 Hola quería preguntar como se podría hacer una puerta que se abra con un comando y se cierre co el mismo, pero si ejecutas ese comando y no sos del team te sale un mensaje diciendo que este comando se utiliza solo para los miembros de ese team... Espero respuestas, gracias.. Link to comment
FraN-724 Posted February 19, 2013 Share Posted February 19, 2013 addCommandHandler Si lo quieres por grupo de acl para prohibir el cmd a los que no estan en 'x' grupo, utiliza: isObjectInACLGroup Y si lo quieres por el nombre del team, utiliza : getPlayerTeam getTeamName Link to comment
Atouk Posted February 20, 2013 Author Share Posted February 20, 2013 fran como ago para que el comando sea con un espacio. por ejemplo: /zsg entrada Link to comment
Atouk Posted February 20, 2013 Author Share Posted February 20, 2013 Asi esta bien??? puerta = createObject ( 980, -3131.3000488281, 467.5, 7.5999999046326, 0, 0, 270.99975585938 ) function abrir ( thePlayer, seat, jacked ) if ( source == puerta ) and ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "ZS~Gamers" ) then outputChatBox("Solo los del clan ZS~Gamers pueden abrir esta puerta.", thePlayer, 255,90,0, true) isObjectInACLGroup ( puerta, "Console" ) isObjectInACLGroup ( puerta, "Admin" ) isObjectInACLGroup ( puerta, "SuperModerator" ) isObjectInACLGroup ( puerta, "Moderator" ) moveObject ( puerta, 1500, -3131.3000488281, 467.5, 3.5999999046326 ) end end addCommandHandler ( "test1" , abrir ) function cerrar ( thePlayer, seat, jacked ) if ( source == puerta ) and ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "ZS~Gamers" ) then moveObject ( puerta, 3000, -3131.3000488281, 467.5, 7.5999999046326, 0, 0, 270.99975585938 ) end end addCommandHandler ( "test2" , abrir ) Link to comment
Plate Posted February 20, 2013 Share Posted February 20, 2013 Lo de los acl esta mal tenes que usar un for-loop puerta = createObject ( 980, -3131.3000488281, 467.5, 7.5999999046326, 0, 0, 270.99975585938 ) function abrir ( thePlayer, seat, jacked ) -- seat, jacked WTF? local playerAcc = getPlayerAccount ( source ) if ( source == puerta ) and ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "ZS~Gamers" ) then outputChatBox("Solo los del clan ZS~Gamers pueden abrir esta puerta.", thePlayer, 255,90,0, true) for _, group in ipairs ( { "Admin", "Moderator", "SuperModerator", "Console" } ) do if isObjectInACLGroup ( "user.".. getAccountName ( playerAcc ), aclGetGroup ( group ) ) then moveObject ( puerta, 1500, -3131.3000488281, 467.5, 3.5999999046326 ) end end end addCommandHandler ( "test1" , abrir ) function cerrar ( thePlayer, seat, jacked ) -- quita los argumentos de seat jacked if ( source == puerta ) and ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "ZS~Gamers" ) then moveObject ( puerta, 3000, -3131.3000488281, 467.5, 7.5999999046326, 0, 0, 270.99975585938 ) end end addCommandHandler ( "test2" , abrir ) despues nose lo demas si esta bien jaja Link to comment
Atouk Posted February 20, 2013 Author Share Posted February 20, 2013 Emm, tengo un error en el debug me dice.. WARNING: puerta/entradaZSG.lua:4: Bad argument @ "getPlayerAccount" [Expected element at argument 1, got string "test1"] el script: puerta = createObject ( 980, -3131.3000488281, 467.5, 7.5999999046326, 0, 0, 270.99975585938 ) function abrir ( thePlayer, source ) -- seat, jacked WTF? local playerAcc = getPlayerAccount ( source ) if ( source == puerta ) and ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "ZS~Gamers" ) then outputChatBox("Solo los del clan ZS~Gamers pueden abrir esta puerta.", thePlayer, 255,90,0, true) for _, group in ipairs ( { "Admin", "Moderator", "SuperModerator", "Console" } ) do if isObjectInACLGroup ( "user.".. getAccountName ( playerAcc ), aclGetGroup ( group ) ) then moveObject ( puerta, 1500, -3131.3000488281, 467.5, 3.5999999046326 ) end end end end addCommandHandler ( "test1" , abrir ) function abrir1 ( thePlayer ) -- quita los argumentos de seat jacked if ( source == puerta ) and ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "ZS~Gamers" ) then moveObject ( puerta, 3000, -3131.3000488281, 467.5, 7.5999999046326, 0, 0, 270.99975585938 ) end end addCommandHandler ( "test2" , abrir1 ) Link to comment
Alexs Posted February 20, 2013 Share Posted February 20, 2013 El segundo parámetro de addCommandHandler es el comando que se uso, no el jugador: puerta = createObject ( 980, -3131.3000488281, 467.5, 7.5999999046326, 0, 0, 270.99975585938 ) function abrir ( thePlayer ) -- seat, jacked WTF? local playerAcc = getPlayerAccount ( thePlayer ) if ( source == puerta ) and ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "ZS~Gamers" ) then outputChatBox("Solo los del clan ZS~Gamers pueden abrir esta puerta.", thePlayer, 255,90,0, true) for _, group in ipairs ( { "Admin", "Moderator", "SuperModerator", "Console" } ) do if isObjectInACLGroup ( "user.".. getAccountName ( playerAcc ), aclGetGroup ( group ) ) then moveObject ( puerta, 1500, -3131.3000488281, 467.5, 3.5999999046326 ) end end end end addCommandHandler ( "test1" , abrir ) function abrir1 ( thePlayer ) -- quita los argumentos de seat jacked if ( source == puerta ) and ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "ZS~Gamers" ) then moveObject ( puerta, 3000, -3131.3000488281, 467.5, 7.5999999046326, 0, 0, 270.99975585938 ) end end addCommandHandler ( "test2" , abrir1 ) No mire bien el código pruebalo. PD: 'addCommandHandler' no tiene 'source'. Link to comment
Atouk Posted February 20, 2013 Author Share Posted February 20, 2013 Emm, la puerta ni baja ni sube.. en el debug no me dice nada Link to comment
Alexs Posted February 20, 2013 Share Posted February 20, 2013 (edited) Intenta: puerta = createObject ( 980, -3131.3000488281, 467.5, 7.5999999046326, 0, 0, 270.99975585938 ) function abrir ( thePlayer ) -- seat, jacked WTF? local playerAcc = getPlayerAccount ( thePlayer ) if ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "ZS~Gamers" ) then outputChatBox("Solo los del clan ZS~Gamers pueden abrir esta puerta.", thePlayer, 255,90,0, true) for _, group in ipairs ( { "Admin", "Moderator", "SuperModerator", "Console" } ) do if isObjectInACLGroup ( "user.".. getAccountName ( playerAcc ), aclGetGroup ( group ) ) then moveObject ( puerta, 1500, -3131.3000488281, 467.5, 3.5999999046326 ) end end end end addCommandHandler ( "test1" , abrir ) function abrir1 ( thePlayer ) -- quita los argumentos de seat jacked if ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "ZS~Gamers" ) then moveObject ( puerta, 3000, -3131.3000488281, 467.5, 7.5999999046326, 0, 0, 270.99975585938 ) end end addCommandHandler ( "test2" , abrir1 ) No estoy muy seguro de ese loop. Edited February 20, 2013 by Guest Link to comment
Atouk Posted February 20, 2013 Author Share Posted February 20, 2013 en el debug me dice WARNING: puerta/entradaZSG.lua:4: Bad argument @ "getPlayerAccount" [Expected element at argument 1, got string "test1"] Link to comment
Alexs Posted February 20, 2013 Share Posted February 20, 2013 Error mio, copia el código otra vez. Link to comment
Atouk Posted February 20, 2013 Author Share Posted February 20, 2013 Ni poniendo los 2 comandos se mueven, nos se mueve. Link to comment
Alexs Posted February 20, 2013 Share Posted February 20, 2013 Duda aparte, si tu pregunta fue: Hola quería preguntar como se podría hacer una puerta que se abra con un comando y se cierre co el mismo, pero si ejecutas ese comando y no sos del team te sale un mensaje diciendo que este comando se utiliza solo para los miembros de ese team...Espero respuestas, gracias.. Por que metiste el ACL? Esto esta sin lo del ACL, ya que no estoy seguro de ese for-loop. puerta = createObject ( 980, -3131.3000488281, 467.5, 7.5999999046326, 0, 0, 270.99975585938 ) function abrir ( thePlayer ) -- seat, jacked WTF? if ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "ZS~Gamers" ) then outputChatBox("Solo los del clan ZS~Gamers pueden abrir esta puerta.", thePlayer, 255,90,0, true) else moveObject ( puerta, 1500, -3131.3000488281, 467.5, 3.5999999046326 ) end end addCommandHandler ( "test1" , abrir ) function abrir1 ( thePlayer ) -- quita los argumentos de seat jacked if ( getPlayerTeam(thePlayer) and getTeamName(getPlayerTeam(thePlayer)) ~= "ZS~Gamers" ) then moveObject ( puerta, 3000, -3131.3000488281, 467.5, 7.5999999046326, 0, 0, 270.99975585938 ) end end addCommandHandler ( "test2" , abrir1 ) Link to comment
Atouk Posted February 20, 2013 Author Share Posted February 20, 2013 Lo ise para que solo los admins, mods, smods y la console la puedan abrir. Link to comment
Recommended Posts