[YARDIM] Bind Key Lazım

0 Üye ve 1 Ziyaretçi konuyu incelemekte.

Çevrimdışı zazara79

  • Yeni Üye
  • *
    • İleti: 5
: 07 Aralık 2018, 20:56:30
Bu koda bind key eklermisiniz.

Spoiler for Hiden:
--RAİNBOW ARAÇ RENGİ
addEvent("aracrenkdegis",true)
addEventHandler("aracrenkdegis",root,function(veh,r,g,b)
   setVehicleColor(veh,r,g,b)
end)

-- RAİNBOW FAR RENGİ
addEvent("farrenkdegis",true)
addEventHandler("farrenkdegis",root,function(vehf,rf,gf,bf)
   setVehicleHeadLightColor(vehf,rf,gf,bf)
end)

-- TAMİR VE FLİP
addEvent("fixflip",true)
addEventHandler("fixflip",root,function()
   local arac = getPedOccupiedVehicle(source)
   if arac then
      fixVehicle(arac)
      local rotX, rotY, rotZ = getElementRotation(arac)
      setElementRotation(arac,0,0,rotZ)
      outputChatBox(getPlayerName(source).." #FFFFFFVIP Panel'den aracını tamir ettirdi.",root,255,255,255,true)
   else
      outputChatBox("Sadece araçtayken aracını tamir ettirebilirsin!",source,255,0,0,false)
   end
end)

-- SKİN ALMA VE UYGULAMA

addEvent("skinkullan",true)
addEventHandler("skinkullan",root,function(skin)
   local hesap = getPlayerAccount(source)
   setAccountData(hesap,"skin",skin)
   skinac()
end)

function skinac()
   for _, player in ipairs(getElementsByType("player")) do
      local acc = getPlayerAccount(player)
      if not isGuestAccount(acc) then
         local driving, vehicle = isPedDrivingVehicle ( player )
         if driving then
            local skin = getAccountData(acc,"skin")
            if skin then
               setVehicleColor(vehicle,255,255,255)
               triggerClientEvent(root,"skinuygula",source,skin,vehicle,source,getSkinTextures())
            end
         end
      end
   end
end


-- HER EL BAŞI OTOMATİK UYGULAMA

function elbasi()
   skinac()
end
addEventHandler("onResourceStart",resourceRoot,elbasi)
addEventHandler("onPlayerVehicleEnter",root,elbasi)


-- GEREKLİ FONKSİYONLAR (ELLEME)

function getSkinTextures()
   if ayar("ayar15") == "default" then
      return {"map","vehiclegrunge256"}
   elseif ayar("ayar15") ~= "default" and type(fromJSON(ayar("ayar15"))) == "table" then
      return fromJSON(ayar("ayar15"))
   else
      return {"map","vehiclegrunge256"}
   end
end

function ayar(value)
   if tonumber(get(value)) == nil then
      return tostring(get(value))
   else
      return tonumber(get(value))
   end
end

function isPedDrivingVehicle(ped)
    assert(isElement(ped) and (getElementType(ped) == "ped" or getElementType(ped) == "player"), "Bad argument @ isPedDrivingVehicle [ped/player expected, got " .. tostring(ped) .. "]")
    local isDriving = isPedInVehicle(ped) and getVehicleOccupant(getPedOccupiedVehicle(ped)) == ped
    return isDriving, isDriving and getPedOccupiedVehicle(ped) or nil
end
« Son Düzenleme: 12 Aralık 2018, 00:02:42 Gönderen: Narkoz »
 


MTASATURK

[YARDIM] Bind Key Lazım
« : 07 Aralık 2018, 20:56:30 »

Çevrimdışı Ky

  • Uzman Üye
  • *
    • İleti: 614
Yanıtla #1 : 10 Aralık 2018, 16:15:38
Al Buyur Yapamassan Yaz bana kodların içine koyiyim.
Kod: lua
bindKey ( "F3", "down", fonksiyonadı )