[YARDIM] Training Script

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı 4VCI

  • 4VCI#4969(discord)
  • Acemi Üye
  • *
    • İleti: 177
  • Pertinacious Vargant Stars
    • Pertinacious Vargant Stars
: 18 Aralık 2017, 15:00:39
Merhabalar sürekli bir sorunla geliyorum  :D sorunum bu sefer bir shooter script tarzında destruction derby scripti tasarladım bu shooter scriptinde sadece training girince ateş etmesini istiyorum bu ölüyken yaşarken herkese ateş ediyor yaşarken ateş etmesini kapatabilirmiyiz acaba.

Linki görebilmek için Kayıt olun yada Giriş yapın.
Linki görebilmek için Kayıt olun yada Giriş yapın.

Spoiler for Hiden:
--31Check
--modified for my shooter map "Tegel Airport"


--Shooter Script--

cLP = getLocalPlayer()
screenWidth, screenHeight = guiGetScreenSize()

function cRStest()
   setTimer(resourcesCheck, 1000, 1)
end
setTimer(cRStest, 3500, 1)

function resourcesCheck()
   if check=="done" then return
   else
      setRadioChannel(0)
      setTimer(cbinds, 1000, 1)
      textToggle=0
      check="done"
   end
end

function checkmeeeeh()
outputChatBox("#ff6666[INFO]: #ffffff Spawnkill protection enabled!", 255, 0, 0, true)
end
addEventHandler("onClientResourceStart", getRootElement(), checkmeeeeh)

function cRS()
   if check=="done" then return
   else
      setRadioChannel(0)
      setTimer(cbinds, 3333, 1)
      textToggle=0
      check="done"
   end
end

function markers(player)
   if isPedInVehicle(player) then
      local vehicle = getPedOccupiedVehicle(player)
      fixVehicle(vehicle)
   end
end
addEventHandler("onClientMarkerHit", getResourceRootElement(getThisResource()), markers)

function cbinds()
   local keys1 = getBoundKeys("vehicle_fire")
   local keys2 = getBoundKeys("vehicle_secondary_fire")
   if keys1 then
      for keyName, state in pairs(keys1) do
         bindKey(keyName, "down", cdoshoot)
      end
      bindKey("F", "down", cdoshoot)
      cbindsText = "- Press F or the button you use to fire to shoot rockets!\n- Press M to toggle music on/off!\n- Press SHIFT to jump, if enabled!\n- You can shoot once every 3 seconds.\n- good luck and have fun! ~31Check"
   end
   if keys2 then
      for keyName, state in pairs(keys2) do
         bindKey(keyName, "down", cdoshoot)
      end
   end
   if (not keys1) and (not keys2) then
      bindKey("F", "down", cdoshoot)
      bindKey("lctrl", "down", cdoshoot)
      bindKey("rctrl", "down", cdoshoot)
      cbindsText = "- Press F or CTRL to shoot rockets!\n- You can shoot once every 3 seconds."
   end
   theVehicle = getPedOccupiedVehicle(cLP)
   allowShoots()
   bindKey("Z", "down", toggleText)
   outputChatBox ("", 27, 89, 224, true)
   outputChatBox("#FF8800 Press Z for help!", 255, 255, 255, true)
   outputChatBox("#ff6666[INFO]: #ffffff Spawnkill protection disabled!", 255, 0, 0, true)
end

function toggleText()
   if textToggle==0 then
      addEventHandler("onClientRender", getRootElement(), bindsText)
      textToggle=1
   elseif textToggle==1 then
      removeEventHandler("onClientRender", getRootElement(), bindsText)
      textToggle=0
   end
end

function allowShoots()
   bindTrigger = 1
end

function cdoshoot()
   if bindTrigger == 1 then
      if not isPlayerDead(cLP) then
         bindTrigger = 0
         local x,y,z = getElementPosition(theVehicle)
         local rX,rY,rZ = getElementRotation(theVehicle)
         local x = x+4*math.cos(math.rad(rZ+90))
         local y = y+4*math.sin(math.rad(rZ+90))
         createProjectile(theVehicle, 19, x, y, z, 1.0, nil)
         setTimer(allowShoots, 3000, 1)
      end
   end
end

function bindsText()
   dxDrawText(cbindsText, screenWidth/15, screenHeight/2.5, screenWidth, screenHeight, tocolor(0, 180, 120, 250), 0.75, "bankgothic")
end
« Son Düzenleme: 18 Aralık 2017, 19:39:14 Gönderen: Narkoz »
[DD/DM] Player
 


MTASATURK

[YARDIM] Training Script
« : 18 Aralık 2017, 15:00:39 »

Çevrimdışı ertrldtcu

  • Uzman Üye
  • *
    • İleti: 589
Yanıtla #1 : 18 Aralık 2017, 21:16:25
Ölülerin ateş etmesi biraz saçma. Çünkü ölü oyuncu bir arabada olmaz, ateş etmesi biraz saçmaya kaçıyor. Ufak bi düzenlemede bulundum, emin değilim.
Kod: lua
--31Check
--modified for my shooter map "Tegel Airport"


--Shooter Script--

cLP = getLocalPlayer()
screenWidth, screenHeight = guiGetScreenSize()

function cRStest()
   setTimer(resourcesCheck, 1000, 1)
end
setTimer(cRStest, 3500, 1)

function resourcesCheck()
   if check=="done" then return
   else
      setRadioChannel(0)
      setTimer(cbinds, 1000, 1)
      textToggle=0
      check="done"
   end
end

function checkmeeeeh()
outputChatBox("#ff6666[INFO]: #ffffff Spawnkill protection enabled!", 255, 0, 0, true)
end
addEventHandler("onClientResourceStart", getRootElement(), checkmeeeeh)

function cRS()
   if check=="done" then return
   else
      setRadioChannel(0)
      setTimer(cbinds, 3333, 1)
      textToggle=0
      check="done"
   end
end

function markers(player)
   if isPedInVehicle(player) then
      local vehicle = getPedOccupiedVehicle(player)
      fixVehicle(vehicle)
   end
end
addEventHandler("onClientMarkerHit", getResourceRootElement(getThisResource()), markers)

function cbinds()
   local keys1 = getBoundKeys("vehicle_fire")
   local keys2 = getBoundKeys("vehicle_secondary_fire")
   if keys1 then
      for keyName, state in pairs(keys1) do
         bindKey(keyName, "down", cdoshoot)
      end
      bindKey("F", "down", cdoshoot)
      cbindsText = "- Press F or the button you use to fire to shoot rockets!\n- Press M to toggle music on/off!\n- Press SHIFT to jump, if enabled!\n- You can shoot once every 3 seconds.\n- good luck and have fun! ~31Check"
   end
   if keys2 then
      for keyName, state in pairs(keys2) do
         bindKey(keyName, "down", cdoshoot)
      end
   end
   if (not keys1) and (not keys2) then
      bindKey("F", "down", cdoshoot)
      bindKey("lctrl", "down", cdoshoot)
      bindKey("rctrl", "down", cdoshoot)
      cbindsText = "- Press F or CTRL to shoot rockets!\n- You can shoot once every 3 seconds."
   end
   theVehicle = getPedOccupiedVehicle(cLP)
   allowShoots()
   bindKey("Z", "down", toggleText)
   outputChatBox ("", 27, 89, 224, true)
   outputChatBox("#FF8800 Press Z for help!", 255, 255, 255, true)
   outputChatBox("#ff6666[INFO]: #ffffff Spawnkill protection disabled!", 255, 0, 0, true)
end

function toggleText()
   if textToggle==0 then
      addEventHandler("onClientRender", getRootElement(), bindsText)
      textToggle=1
   elseif textToggle==1 then
      removeEventHandler("onClientRender", getRootElement(), bindsText)
      textToggle=0
   end
end

function allowShoots()
   bindTrigger = 1
end

function cdoshoot()
   if bindTrigger == 1 then
      if isPlayerDead(cLP) then
         bindTrigger = 0
         local x,y,z = getElementPosition(theVehicle)
         local rX,rY,rZ = getElementRotation(theVehicle)
         local x = x+4*math.cos(math.rad(rZ+90))
         local y = y+4*math.sin(math.rad(rZ+90))
         createProjectile(theVehicle, 19, x, y, z, 1.0, nil)
         setTimer(allowShoots, 3000, 1)
      end
   end
end

function bindsText()
   dxDrawText(cbindsText, screenWidth/15, screenHeight/2.5, screenWidth, screenHeight, tocolor(0, 180, 120, 250), 0.75, "bankgothic")
end
« Son Düzenleme: 18 Aralık 2017, 21:19:02 Gönderen: ertrldtcu »
system
 


Çevrimdışı ByCash

  • Admin
  • *
    • İleti: 986
Yanıtla #2 : 18 Aralık 2017, 21:46:43
Linki görebilmek için Kayıt olun yada Giriş yapın.
Ölülerin ateş etmesi biraz saçma. Çünkü ölü oyuncu bir arabada olmaz, ateş etmesi biraz saçmaya kaçıyor. Ufak bi düzenlemede bulundum, emin değilim.
DD'de öldükten sonra başka bir haritada ölenlerle shooter oynanıyor.
 


Çevrimdışı ertrldtcu

  • Uzman Üye
  • *
    • İleti: 589
Yanıtla #3 : 18 Aralık 2017, 21:49:04
Linki görebilmek için Kayıt olun yada Giriş yapın.
DD'de öldükten sonra başka bir haritada ölenlerle shooter oynanıyor.
Bundan bahsediyorum. Orada oynayan oyuncular aslında yaşıyor. Yani ortada bi oyuncu pedi var.
system