Julian09123 Posted March 15, 2013 Share 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? Link to comment
Castillo Posted March 15, 2013 Share 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. Link to comment
Julian09123 Posted March 15, 2013 Author Share Posted March 15, 2013 Si pero Yo no quiero una tabla osea quiero Que ponga /dararma all mp5 o /dararma julian mp5 haci Link to comment
Castillo Posted March 15, 2013 Share Posted March 15, 2013 La manera que te dije es la unica para dar un arma a todos los jugadores. Link to comment
Julian09123 Posted March 15, 2013 Author Share Posted March 15, 2013 Ah ok y solo esa funcion tendria que usar? U otras mas? Link to comment
Plate Posted March 15, 2013 Share Posted March 15, 2013 giveWeapon getPlayerFromName --Para eso de /dararma julian mp5 Link to comment
Castillo Posted March 15, 2013 Share Posted March 15, 2013 Para obtener los jugadores online en una tabla, si, esa. Link to comment
Julian09123 Posted March 15, 2013 Author Share 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 ) Link to comment
Plate Posted March 15, 2013 Share Posted March 15, 2013 giveWeapon (getRootElement(),weapon) dijo que uses un for-loop de getElementsByType Link to comment
Julian09123 Posted March 15, 2013 Author Share Posted March 15, 2013 osea como? xdddd haci giveWeapon (getElementsByType() ( "player" ) ? Link to comment
Julian09123 Posted March 15, 2013 Author Share Posted March 15, 2013 Nop dijo un for-loop Me puedes ayudar ? Link to comment
Plate Posted March 15, 2013 Share Posted March 15, 2013 for i, v in ipairs(getElementsByType("player")) do Link to comment
Sasu Posted March 15, 2013 Share Posted March 15, 2013 Y usa tonumber para verificar que es la supuesta ID es un numero. Link to comment
Julian09123 Posted March 16, 2013 Author Share 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 ) Link to comment
Sasu Posted March 16, 2013 Share 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 ) Link to comment
JuliDiablo Posted March 16, 2013 Share Posted March 16, 2013 Perdón mi ignorancia, ¿el parámetro "_" previo a weapon qué representa? Link to comment
Renkon Posted March 16, 2013 Share 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 Link to comment
Julian09123 Posted March 16, 2013 Author Share 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 Link to comment
Plate Posted March 16, 2013 Share Posted March 16, 2013 Te falto la ammo despues del tonumber(weapon) Link to comment
StanMarsh Posted May 3, 2013 Share Posted May 3, 2013 Para eso Dale un arma al q quieras con el admin panel Link to comment
FraN-724 Posted May 3, 2013 Share 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. Link to comment
Recommended Posts