Jump to content

Ayuda Zona


Julian09123

Recommended Posts

  
local TWeapon = {} 
local ColShape = createColRectangle (fX,fY,fWidth,fHeight)  
  
function ColHit(Element) 
 if getElementType(Element) == "player" then 
 if ( not TWeapon [ Element ] ) then 
            TWeapon [ Element ] = { } 
            end 
 for slot = 0, 12 do 
    local weapon = getPedWeapon ( Element, slot ) 
        if ( weapon > 0 ) then 
        local ammo = getPedTotalAmmo ( Element, slot ) 
            if ( ammo > 0 ) then 
                    TWeapon [ Element ] [ weapon ] = ammo 
                end 
            end 
        end 
    end 
end 
addEventHandler("onColShapeHit",ColShape,ColHit) 
  
function ColLeave(Element) 
 if getElementType(Element) == "player" then 
  if (TWeapon [ Element ]) then 
   for weapon, ammo in pairs ( TWeapon [ Element ] ) do 
                giveWeapon ( Element, tonumber ( weapon ), tonumber ( ammo ) ) 
            end 
        end 
    end 
    TWeapon [ Element ] = nil 
end 
addEventHandler("onColShapeLeave",ColShape,ColLeave) 
  

gracias por el ejemplo SolidSnake14

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...