Julian09123 Posted September 1, 2013 Share Posted September 1, 2013 Hola, amigos se me ocurrio una idea gracias a un amigo y es que al Entrar a una Zona De Pelea se te quiten las armas y cuando sales se te vuelvan a poner me dirian como hacer eso? Link to comment
Gothem Posted September 2, 2013 Share Posted September 2, 2013 Pueder hacer eso con un elemento de colisión ( ColShape ), aqui hay una lista de funciones para crear colisiones. Funciones de colisión Link to comment
Atouk Posted September 2, 2013 Share Posted September 2, 2013 Podrias usar: createColRectangle onColShapeHit takeWeapon getPedWeapon giveWeapon onColShapeLeave -- y para adornar outputChatBox Link to comment
Julian09123 Posted September 2, 2013 Author Share Posted September 2, 2013 Gracias vere si lo puedo hacer :3 Link to comment
manawydan Posted September 2, 2013 Share Posted September 2, 2013 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
Recommended Posts