Siriius Posted March 13, 2016 Share Posted March 13, 2016 local PigZombie = createColRectangle ( 1551.4, -1151.8, 288.57, 312.22 ) function zoneEnter ( thePlayer, matchingDimension ) if matchingDimension and isElement(thePlayer) and getElementType(thePlayer) == "player" then triggerClientEvent(thePlayer, "zoneEnter", thePlayer) WeaponID = { [4] = true, [5] = true, [8] = true, [16] = true, [35] = true, [36] = true, [37] = true, [38] = true, [39] = true, [40] = true, } toggleControl ( thePlayer, "fire", false ) end end addEventHandler ( "onColShapeHit", PigZombie, zoneEnter ) function zoneExit ( thePlayer, matchingDimension ) if matchingDimension and isElement(thePlayer) and getElementType(thePlayer) == "player" then triggerClientEvent(thePlayer, "zoneExit", thePlayer) WeaponID = { [4] = false, [5] = false, [8] = false, [16] = false, [35] = false, [36] = false, [37] = false, [38] = false, [39] = false, [40] = false, } toggleControl ( thePlayer, "fire", true ) end end addEventHandler ( "onColShapeLeave", PigZombie,zoneExit ) addEventHandler ( 'onPlayerWeaponSwitch', getRootElement ( ), function ( previousWeaponID, currentWeaponID ) if ( WeaponID [currentWeaponID] ) then toggleControl ( source, 'fire', false ) --disable the fire button outputChatBox( "**#FFFF00Esta arma no esta permitida en esta area.**",source, 255,0,0, true) else toggleControl ( source, 'fire', true ) --enable it end end ) function Boss () blip = {23} local localPed = exports [ "slothBot" ]:spawnBot ( 1643.2351074219, -1043.0762939453, 23.8984375, 90, math.random ( 38, 38 ), 0, 0, ex, 9, "hunting", true ) local health = exports.extra_health:setElementExtraHealth ( localPed, 100 ) setElementModel ( localPed, 38 ) outputChatBox("#ff0000 El Boss #33ff00PigZombie #ff0000 a aparecido en Los Santos #33ff00RECOMPENSA >[$20,000]< ",getRootElement(),255,0,0,true) setElementData(localPed, "type", "RealBoomer") setPedStat(localPed, 24, 1000) RealBoomer = localPed blip[23] = (createBlipAttachedTo ( localPed, 23 )) triggerClientEvent ( "sound2", root ) end addEventHandler("onResourceStart", resourceRoot, Boss) addEvent("onWitchReady", true) addEventHandler("onPedWasted", getRootElement(), function(ammo, theKiller) if isElement(RealBoomer) then if source == RealBoomer then givePlayerMoney(theKiller,math.random(20000,20000)) local r,g,b = getPlayerNametagColor (theKiller) local chatterName = getPlayerName (theKiller) outputChatBox ( chatterName.." #FF0000 A matado al #33ff00PigZombie #33ff00RECOMPENSA >[$20,000]< *", getRootElement(), r, g, b, true) local x, y, z = getElementPosition(RealBoomer) destroyElement(blip[23]) destroyElement(PigZombie) createExplosion ( x, y, z, 1 ) triggerClientEvent ( "estallido", root ) setTimer(Boss, 1800000 , 1) return end end end ) El sistema anti armas en dicho boss funciona perfectamente, pero... no logro que al derrotar dicha ped (al morir) se destruya el elemento "PigZombie" Es decir la zona que prohíbe las armas. Perdón si no especifico mi error en el script. Link to comment
Siriius Posted March 13, 2016 Author Share Posted March 13, 2016 function Boss () blip = {23} local localPed = exports [ "slothBot" ]:spawnBot ( 1551, -1315.73, 331, 90, math.random ( 300, 303 ), 0, 0, ex, 9, "hunting", true ) local health = exports.extra_health:setElementExtraHealth ( localPed, 5500 ) setElementModel ( localPed, 38 ) setElementParent (localPed, PigZombie) outputChatBox("#ff0000 El Boss #33ff00PigZombie #ff0000 a aparecido en Los Santos #33ff00RECOMPENSA >[$20,000]< ",getRootElement(),255,0,0,true) setElementData(localPed, "type", "RealBoomer") setPedStat(localPed, 24, 1000) RealBoomer = localPed blip[23] = (createBlipAttachedTo ( localPed, 23 )) triggerClientEvent ( "sound2", root ) end addEventHandler("onResourceStart", resourceRoot, Boss) addEvent("onWitchReady", true) addEventHandler("onPedWasted", getRootElement(), function(ammo, theKiller) if isElement(RealBoomer) then if source == RealBoomer then givePlayerMoney(theKiller,math.random(20000,20000)) local r,g,b = getPlayerNametagColor (theKiller) local chatterName = getPlayerName (theKiller) outputChatBox ( chatterName.." #FF0000 A matado al #33ff00PigZombie #33ff00RECOMPENSA >[$20,000]< *", getRootElement(), r, g, b, true) local x, y, z = getElementPosition(RealBoomer) local PigZombie = getElementParent(RealBoomer) destroyElement(blip[23]) destroyElement(PigZombie) createExplosion ( x, y, z, 5 ) triggerClientEvent ( "estallido", root ) setTimer(Boss, 1200000 , 1) end end end ) No sé si esta bien así, al ser así.... Si destruye la zona pero, prohíbe las armas en todos lados. Link to comment
Recommended Posts