Destroyer.- Posted July 25, 2014 Share Posted July 25, 2014 Hola hay alguna forma de reemplazar tantos ifs .. else.. if (ap == 10) then givePlayerMoney(player, 10000) outputChatBox("[iNFO]BONUS: $10.000",player,0,255,255) elseif (ap == 20) then givePlayerMoney(player, 20000) outputChatBox("[iNFO]BONUS: $20.000",player,0,255,255) elseif (ap == 30) then givePlayerMoney(player, 30000) outputChatBox("[iNFO]BONUS: $30.000",player,0,255,255) end end Gracias :c Link to comment
alex17 Posted July 25, 2014 Share Posted July 25, 2014 prueva con algo como esto no estoi seguro de lo que ise if ( ap ) then data= tonumber((ap*100)) --- si ap = 10 te va a dar 10000 si es igual a 20 te va a dar 20000 y asi ... --- givePlayerMoney(player, data) outputChatBox("[iNFO]BONUS: $"..data,player,0,255,255) end end Link to comment
Destroyer.- Posted July 25, 2014 Author Share Posted July 25, 2014 prueva con algo como estono estoi seguro de lo que ise if ( ap ) then data= tonumber((ap*100)) --- si ap = 10 te va a dar 10000 si es igual a 20 te va a dar 20000 y asi ... --- givePlayerMoney(player, data) outputChatBox("[iNFO]BONUS: $"..data,player,0,255,255) end end Si pero lo que necesito es especificamente de 10 en 10 o de 20 en 20 pero eso me da plata bonus en todos los arrestos Link to comment
Recommended Posts