Julian09123 Posted March 15, 2013 Posted March 15, 2013 Hola quisiera saber como hacer un comando que le de armas a todos los players ademas de giveweapon que mas tendria que utilizar y si me pueden dar una idea de esto? Skype: Juliang09123
Castillo Posted March 15, 2013 Posted March 15, 2013 getElementsByType Usa esa funcion para obtener una tabla con todos los jugadores, luego usa un for-loop para obtener cada uno. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Julian09123 Posted March 15, 2013 Author Posted March 15, 2013 Si pero Yo no quiero una tabla osea quiero Que ponga /dararma all mp5 o /dararma julian mp5 haci Skype: Juliang09123
Castillo Posted March 15, 2013 Posted March 15, 2013 La manera que te dije es la unica para dar un arma a todos los jugadores. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Julian09123 Posted March 15, 2013 Author Posted March 15, 2013 Ah ok y solo esa funcion tendria que usar? U otras mas? Skype: Juliang09123
Plate Posted March 15, 2013 Posted March 15, 2013 giveWeapon getPlayerFromName --Para eso de /dararma julian mp5 Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted March 15, 2013 Posted March 15, 2013 Para obtener los jugadores online en una tabla, si, esa. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Julian09123 Posted March 15, 2013 Author Posted March 15, 2013 algo asi no no?? addCommandHandler ( "giveall", function (thePlayer,_,weapon ) local name = getPlayerName(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then giveWeapon (getRootElement(),weapon) outputChatBox ( "#5555FFThe #00FF00Admin #5555FF" .. name .. "#00FF00 Has #5555FFGive #00FF00All #5555FFPlayers #00FF00".. weapon .."#5555FF$", getRootElement(), 255, 0, 0, true ) end end ) Skype: Juliang09123
Plate Posted March 15, 2013 Posted March 15, 2013 giveWeapon (getRootElement(),weapon) dijo que uses un for-loop de getElementsByType Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Julian09123 Posted March 15, 2013 Author Posted March 15, 2013 osea como? xdddd haci giveWeapon (getElementsByType() ( "player" ) ? Skype: Juliang09123
Plate Posted March 15, 2013 Posted March 15, 2013 Nop dijo un for-loop Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Julian09123 Posted March 15, 2013 Author Posted March 15, 2013 Nop dijo un for-loop Me puedes ayudar ? Skype: Juliang09123
Plate Posted March 15, 2013 Posted March 15, 2013 for i, v in ipairs(getElementsByType("player")) do Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Sasu Posted March 15, 2013 Posted March 15, 2013 Y usa tonumber para verificar que es la supuesta ID es un numero. State: Inactive
Julian09123 Posted March 16, 2013 Author Posted March 16, 2013 Me lo pueden corregir? addCommandHandler ( "giveall", function (thePlayer,_,weapon ) local name = getPlayerName(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then for i, v in ipairs(getElementsByType("player")) do outputChatBox ( "#5555FFThe #00FF00Admin #5555FF" .. name .. "#00FF00 Has #5555FFGive #00FF00All #5555FFPlayers #00FF00".. weapon .."#5555FF$", getRootElement(), 255, 0, 0, true ) end end ) Skype: Juliang09123
Sasu Posted March 16, 2013 Posted March 16, 2013 addCommandHandler ( "giveall", function (thePlayer,_,weapon ) local name = getPlayerName(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then for i, v in ipairs(getElementsByType("player")) do if weapon then giveWeapon(v, tonumber(weapon)) outputChatBox ( "#5555FFThe #00FF00Admin #5555FF" .. name .. "#00FF00 Has #5555FFGive #00FF00All #5555FFPlayers #00FF00".. weapon .."#5555FF$", getRootElement(), 255, 0, 0, true ) end end end end ) State: Inactive
JuliDiablo Posted March 16, 2013 Posted March 16, 2013 Perdón mi ignorancia, ¿el parámetro "_" previo a weapon qué representa? Programador de Pawn, PHP, MySQL. Aprendiz de Lua.
Renkon Posted March 16, 2013 Posted March 16, 2013 Perdón mi ignorancia, ¿el parámetro "_" previo a weapon qué representa? Quiere decir que se dropea la variable, es decir, no se le da uso y se dropea
Julian09123 Posted March 16, 2013 Author Posted March 16, 2013 addCommandHandler ( "giveall", function (thePlayer,_,weapon ) local name = getPlayerName(thePlayer) local accName = getAccountName ( getPlayerAccount ( thePlayer ) ) if isObjectInACLGroup ("user."..accName, aclGetGroup ( "Admin" ) ) then for i, v in ipairs(getElementsByType("player")) do if weapon then giveWeapon(v, tonumber(weapon)) outputChatBox ( "#5555FFThe #00FF00Admin #5555FF" .. name .. "#00FF00 Has #5555FFGive #00FF00All #5555FFPlayers #00FF00".. weapon .."#5555FF$", getRootElement(), 255, 0, 0, true ) end end end end ) Sasuke Y como seria para ponerle el commandhandler /dararma Id y all o los jugadores Skype: Juliang09123
Plate Posted March 16, 2013 Posted March 16, 2013 Te falto la ammo despues del tonumber(weapon) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
StanMarsh Posted May 3, 2013 Posted May 3, 2013 Para eso Dale un arma al q quieras con el admin panel En el foro se me conocia Como alexmercer1998 y Ezio Auditore esta es mi nuevo nombre para que esten informados
FraN-724 Posted May 3, 2013 Posted May 3, 2013 Para eso Dale un arma al q quieras con el admin panel Alex, es que no se trata de eso, esto es que con el comando giveall le des arma a todos y no se estén dando la paja de dar a través del panel admin.
Recommended Posts