Sign in to follow this  
Hukaeshi

Ayuda funcion dar armas panel moderador

Recommended Posts

Buen dias chicos, estuve creando un panel de moderador, pero... necesito ayuda con mi funcion de dar armas, lo que quiero hacer es bloquear para que no se le pueda dar Minigun ni Sniper a un jugador solo se lo pueda dar el moderador a si mismo.

 

 function DarArmaF(client, getText)
  player = getPlayerFromName(client)
  if not isElement(player) then return end 
                        local wepID,wepName = getWeaponIDFromName(getText),getWeaponNameFromID(getText) 
                         
                if wepID then 
                id = wepID 
                else 
                id = wepName 
                end 
                 
                     
                if player == source then 
                    amount = 9999 
					outputChatBox("#FF0000Moderador: #55FF00te has dado "..amount.." balas del arma "..id..".", source, 255, 255, 255, true)				
                    else 
                    amount = 90
outputChatBox("#FFFF00Alerta: #55FF00El Moderador #FF0000"..getPlayerName(source).." #55FF00Le ha dado "..amount.." balas del arma " ..id.." al jugador #FF0000"..getPlayerName(player)..".", root, 255, 225, 255, true)	
outputChatBox("#FF0000Moderador: #55FF00Le has dado a "..getPlayerName(player).." "..amount.." balas del arma "..id..".", source, 255, 255, 255, true)				
                end 
                        giveWeapon(player, id,amount, true) 
                        end 
addEvent("DarArma", true) 
addEventHandler("DarArma", getRootElement(), DarArmaF) 

 

Share this post


Link to post

intente de esta manera pero no logro, sigue aun permitiendo dar las armas

 

 function DarArmaF(client, getText)
  local NoArmas = {[38] = true , [34] = true} 
  player = getPlayerFromName(client)
  if not isElement(player) then return end 
                        local wepID,wepName = getWeaponIDFromName(getText),getWeaponNameFromID(getText) 
                         
                if wepID then 
                id = wepID 
                else 
                id = wepName 
                end 
                 
                     
                if player == source then 
                    amount = 9999 
					outputChatBox("#FF0000Moderador: #55FF00te has dado "..amount.." balas del arma "..id..".", source, 255, 255, 255, true)				
                    else 
                    if NoArmas[id] then 
                    outputChatBox("No puedes dar municion de esta arma a usuarios",source,255,0,0)  
                    return end
                    amount = 90
outputChatBox("#FFFF00Alerta: #55FF00El Moderador #FF0000"..getPlayerName(source).." #55FF00Le ha dado "..amount.." balas del arma " ..id.." al jugador #FF0000"..getPlayerName(player)..".", root, 255, 225, 255, true)	
outputChatBox("#FF0000Moderador: #55FF00Le has dado a "..getPlayerName(player).." "..amount.." balas del arma "..id..".", source, 255, 255, 255, true)				
                end 
                        giveWeapon(player, id,amount, true) 
                        end 
addEvent("DarArma", true) 
addEventHandler("DarArma", getRootElement(), DarArmaF) 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.