Jump to content

adwyer434

Members
  • Posts

    7
  • Joined

  • Last visited

Details

  • Gang
    Mafia

adwyer434's Achievements

Newbie

Newbie (4/54)

0

Reputation

  1. Can anyone at all help me with this?!
  2. Hello I am trying to use "lFalke" Resource Crying Witch on my MTA DayZ Server Iv'e tried to change the witched damage from Health/HP to Blood but can't seem to get her to kill me Any ideas? Thanks Azza Server Side --[[ ########################################################################## ## ## ## COMPLETE VERSION ## ## Project: 'Witch of L4D 2' - resource for MTA: San Andreas ## ## ## ########################################################################## [C] Copyright 2013-2014, Falke and [COD]Plate ]] RealWitch = nil function findRotation(x1,y1,x2,y2) local t = -math.deg(math.atan2(x2-x1,y2-y1)) if t < 0 then t = t + 360 end; return t; end function getPointFromDistanceRotation(x, y, dist, angle) local a = math.rad(90 - angle); local dx = math.cos(a) * dist; local dy = math.sin(a) * dist; return x+dx, y+dy; end Witch = nil function getPlayerNearestToPosition(x, y, z) local nearestPlayer = nil local nearestDistance = nil for i, players in ipairs(getElementsByType("player")) do local px, py, pz = getElementPosition(players) local distance = getDistanceBetweenPoints3D(px, py, pz, x, y, z) if nearestPlayer == nil then nearestPlayer = players nearestDistance = distance elseif distance < nearestDistance then nearestDistance = distance nearestPlayer = players end end if nearestPlayer == nil then return false else return nearestPlayer end end function Boss () blip = {} local localPed = createPed( 33, 2952, -1933, 1.4 ) local health = exports.extra_health:setElementExtraHealth ( localPed, 1500 ) setElementModel ( localPed, 33 ) setPedAnimation(localPed, "CRACK", "crckidle3", -1, true, true, false) setElementData(localPed, "type", "RealWitch") setPedStat(localPed, 24, 1000) RealWitch = localPed blip[1] = (createBlipAttachedTo ( localPed, 0 )) triggerClientEvent ( "witchsound", root ) setElementData(localPed, "currenthealth", exports.extra_health:getElementExtraHealth(RealWitch)) setElementData(localPed, "Witch", true) end addEventHandler("onResourceStart", resourceRoot, Boss) addEvent("onWitchReady", true) addEvent("witchatack", true) addEventHandler ( "witchatack", root, function ( ) local Health = exports.extra_health:getElementExtraHealth(localPed) if Health < 1499 or Health == 1499 then setPedAnimation(localPed, "ped", "sprint_Wuzi", -1, true, true, false) triggerClientEvent ( "chillido", root ) end end ) addEvent("witchatackxd", true) addEventHandler ( "witchatackxd", root, function ( ) setPedAnimation(localPed, "ped", "sprint_Wuzi", -1, true, true, false) end ) addEventHandler("onPedWasted", getRootElement(), function(ammo, killer) if isElement(RealWitch) then if source == RealWitch then local x, y, z = getElementPosition(RealWitch) destroyElement(RealWitch) destroyElement(blip[1]) setTimer(Boss, 30000, 1) triggerClientEvent ( "chillido", root ) end end end ) setTimer( function() localPed = RealWitch if isElement(RealWitch) then local x, y, z = getElementPosition(RealWitch) local player = getPlayerNearestToPosition(x, y, z) if player then local px, py, pz = getElementPosition(player) if getDistanceBetweenPoints3D(x, y, z, px, py, pz) < 130 then if isElementInWater(RealWitch) then setPedAnimation(RealWitch, "CRACK", "crckidle3", -1, true, true, false) local healthxd = exports.extra_health:setElementExtraHealth ( RealWitch, 1500 ) end local rotZ = findRotation(x, y, px, py) setPedRotation(RealWitch, rotZ) if getDistanceBetweenPoints3D(px, py, pz, x, y, z) < 2 then local health = getElementHealth(player) if health < 5 or health == 5 then setElementHealth(player, 0) local leX, leY, leZ = getElementPosition(RealWitch) setPedAnimation(RealWitch, "CRACK", "crckidle3", -1, true, true, false) local healthxd = exports.extra_health:setElementExtraHealth ( RealWitch, 1500 ) else setElementHealth(player, health - 6) end end else local healthxd = exports.extra_health:setElementExtraHealth ( RealWitch, 1500 ) setPedAnimation(RealWitch, "CRACK", "crckidle3", -1, true, true, false) end end end end , 50, 0) addEvent("killdmgzero",true) function killWhenHpZero(source,attacker,weapon,bodypart) killPed(source,attacker,weapon,bodypart) end addEventHandler("killdmgzero",root,killWhenHpZero) Client Side --[[ ########################################################################## ## ## ## COMPLETE VERSION ## ## Project: 'Witch of L4D 2' - resource for MTA: San Andreas ## ## ## ########################################################################## [C] Copyright 2013-2014, Falke and [COD]Plate ]] local cFunc = {} local cSetting = {} cFunc["witch_atack"] = function(_, wep, bodypart) if not getElementData(source, "Damaged") then local weaponType = getPedWeapon ( getLocalPlayer() ) if(wep == weaponType) then triggerServerEvent ( "witchatack", root ) setSoundMaxDistance(witchcry, 0) setElementData(source, "Damaged", true) end end end addEventHandler("onClientPedDamage", getRootElement(),cFunc["witch_atack"]) cFunc["witch_atackxd"] = function(_, wep, bodypart) local weaponType = getPedWeapon ( getLocalPlayer() ) if(wep == weaponType) then triggerServerEvent ( "witchatackxd", root ) end end addEventHandler("onClientPedDamage", getRootElement(),cFunc["witch_atackxd"]) addEvent ( "chillido", true ) addEventHandler ( "chillido", root, function ( ) playSound ( "tawa.mp3" ) end ) function startMusic() setRadioChannel(0) song = playSound3D("cry.mp3", -175.610, 57.66, 3.2, true) setSoundMaxDistance(song, 180) end function cancelPedDamage ( attacker, weapon, bodypart ) if getElementType ( source ) == "ped" then if (getElementData (source, "Witch") == true) then local zhp = getElementData(source,"currenthealth") if zhp > 0 then local dmg = 25 local takedamage = zhp - dmg setElementData(source,"currenthealth",takedamage) elseif zhp == 0 then triggerServerEvent("killdmgzero",root,source,attacker,weapon,bodypart) end end end end addEventHandler ( "onClientPedDamage", getRootElement(), cancelPedDamage ) function toggleSong() setSoundVolume(song,0) end addEventHandler("onClientPedDamage",getRootElement(),toggleSong) addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),startMusic) addEvent ( "witchsound", true ) addEventHandler ( "witchsound", root, function ( ) song = playSound3D("cry.mp3", 2952, -1925, 4.2, true) setSoundMaxDistance(song, 180) end ) local maxDist = 30 function witchNameTag() local witchs = getElementsByType ( "ped",getRootElement(),true ) local Px,Py,Pz = getCameraMatrix( ) for theKey,theWitch in ipairs(witchs) do if (isElement(theWitch)) then local Zx,Zy,Zz = getElementPosition( theWitch ) local zhx,zhy,zhz = getPedBonePosition(theWitch,6) if (getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) < maxDist ) then if (getElementData (theWitch, "Witch") == true) then local sxx,syy = getScreenFromWorldPosition(zhx,zhy,zhz+0.3) local currentDistance = getDistanceBetweenPoints3D(Px, Py, Pz, Zx, Zy, Zz) --local zombieHealth = getElementHealth(theWitch) local maxHP = exports.extra_health:getElementExtraHealth(theWitch) local currentHealth = getElementData(theWitch, "currenthealth") if sxx and getElementHealth(theWitch) > 0 then sx,sy = sxx-60,syy-10 dxDrawRectangle(sx+5,sy+25,131.0/maxHP*currentHealth,12.0,tocolor(255,0,0,200),false) -- health dxDrawRectangle(sx,sy,146.0,46.0,tocolor(0,0,0,0),false) -- background dxDrawRectangle(sx+5,sy+25,131.0,12.0,tocolor(0,0,0,100),false) -- bg health dxDrawText("Witch",sx+26,sy,596.0,236.0,tocolor(255,0,0,255),1.0,"default","left","top",false,false,false) -- z name end end end end end end addEventHandler("onClientRender", root, witchNameTag)
  3. adwyer434

    Fps drops

    Hello,Whenever someone on my server gets into a vehicle,They get bad fps drops? Anyone know what could be causing this?
  4. So I added a client side function to show a menu with Take engine,Take tire,Take tankparts if (vengines < needengines) and ((getElementData(lply, "Engine") or 0) >= 1) then MenuItems = MenuItems + 1 guiSetText(MenuLabel[MenuItems],"Add Engine") setElementData(MenuLabel[MenuItems],"usedItem","addengine") end if (vtires < needtires) and ((getElementData(lply, "Tire") or 0) >= 1) then MenuItems = MenuItems + 1 guiSetText(MenuLabel[MenuItems],"Add Tire") setElementData(MenuLabel[MenuItems],"usedItem","addtire") end if (vparts < needparts) and ((getElementData(lply, "Tank Parts") or 0) >= 1) then MenuItems = MenuItems + 1 guiSetText(MenuLabel[MenuItems],"Add Tank Parts") setElementData(MenuLabel[MenuItems],"usedItem","addparts") end if vengines >= 1 then MenuItems = MenuItems + 1 guiSetText(MenuLabel[MenuItems],"Take Engine") setElementData(MenuLabel[MenuItems],"usedItem","takeengine") end if vtires >= 1 then MenuItems = MenuItems + 1 guiSetText(MenuLabel[MenuItems],"Take Tire (" .. vtires .. ")") setElementData(MenuLabel[MenuItems],"usedItem","taketire") end if vparts >= 1 then MenuItems = MenuItems + 1 guiSetText(MenuLabel[MenuItems],"Take Tank Parts") setElementData(MenuLabel[MenuItems],"usedItem","takeparts") end end end end But I'm stumped on how to added it server side,So the player can take the items
  5. adwyer434

    MTA won't work

    Hi sorry for the late reply It had nothing to do with driver's I just need to run it in compatibility mode for windows 8 Thank's Azza
  6. adwyer434

    MTA won't work

    I did it it won't work http://pastebin.mtasa.com/724549416
  7. adwyer434

    MTA won't work

    Hi, MTA Updated today and now I can't get onto MTA It will load like normal but the main screen flashes up then there's just a black blank screen. I have re-installed Grand Theft Auto SA I have re-installed MTA And I have re-installed my video driver Any idea's??
×
×
  • Create New...