Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2018-03-19, 15:22


Arztin

floki






Wiek: 25
Na forum: 3165 dni
Posty: 66
Nick w MP: Kachi

Piwa: 4

Respekt: 10,5

Ostrzeżeń: 20%
Jestl wejde do auta z kajdankami to kajdanki puszczaja.

Kod:
--[[policeVehicles = { [598]=true,[596]=true,[597]=true,[432]=true,[433]=true,[528]=true,[490]=true,[599]=true }

function blokada ( player, seat, jacked )
  local kategoria = getElementData(player, "kajdanki")
  if kategoria ~= false then
  if ( not policeVehicles[getElementModel(source)] ) then
    cancelEvent()
    outputChatBox("* Masz kajdanki i nie mo?esz wsi??? do tego pojazdu.",player,255, 0, 0, true)
   end
  end
 end
addEventHandler ("onVehicleStartEnter", getRootElement(), blokada)--]]

function kajdankii ( player, cmd, gracz )
    if getElementData(player,'player:faction') and getElementData(player,'player:faction')=='SAPD' then
        if not (gracz) then
        outputChatBox("*  U?yj: /kajdanki <nick/ID> ",player)
        return
        end
        local targetElement=exports['ogrpg-core']:findPlayer(player, gracz)
        if targetElement then
            local x, y, z = getElementPosition(player)
            local tx, ty, tz = getElementPosition(targetElement)
                
            local distance = getDistanceBetweenPoints3D(x, y, z, tx, ty, tz)
                
          if (distance<=10) then
            local dokogo=getElementData(targetElement,"kajdanki")
            if (not dokogo or not isElement(dokogo)) then
                --toggleControl(targetElement, "sprint", false )
                --toggleControl(targetElement, "jump", false )
                --toggleControl(targetElement, "aim_weapon", false )
                --toggleControl(targetElement, "fire", false )
                --toggleControl(targetElement, "crouch", false )
                triggerEvent("onKajdankiZakuj", root, player, targetElement)
                outputChatBox("* Za?o?y?e?(a?) graczowi kajdanki.",player)
            --    outputChatBox("#0078FFPolicjant za?o?y? ci kajdanki. Nie mo?esz szybko biega?, skaka? ani prowadzi? pojazd?w.",targetElement,255, 0, 0, true)
            else
                --toggleControl(targetElement, "sprint", true )
                --toggleControl(targetElement, "jump", true )
                --toggleControl(targetElement, "crouch", true )
                triggerEvent("onKajdankiZakuj", root, player, targetElement)
                outputChatBox("* ?ci?gn??e?(a?) graczowi kajdanki.", player)
            --    outputChatBox("* #0078FFPolicjant ?ci?gna? Ci kajdanki.",targetElement,255, 0, 0, true)
            end
          else
              outputChatBox("* Jeste? za daleko gracza, ?eby za?o?y? kajdanki.", player)
           end
        end    
    else
          outputChatBox("* Nie jeste? na s?u?bie, lub nie pracujesz w Policji.",player)
    end
 end
addCommandHandler("kajdanki", kajdankii)
 
 
 addEvent("setPedAnimation", true)
addEventHandler("setPedAnimation", root, function(block,anim,time,loop,updatePosition,interruptable, freezeLastFrame)
--    triggerServerEvent("setPedAnimation", localPlayer, "SWORD", "sword_block", -1, false, false, true,true)
    if (time==nil) then time=-1 end
    if (loop==nil) then loop=true end
    if (updatePosition==nil) then updatePosition=true end
    if (interruptable==nil) then interruptable=true end
    if (freezeLastFrame==nil) then freezeLastFrame=true end
--    bool setPedAnimation ( ped thePed [, string block=nil, string anim=nil, int time=-1, bool loop=true, bool updatePosition=true, bool interruptable=true, bool freezeLastFrame = true] )
    if getElementData(source, "blockSettingAnimation") then return false end
    if getElementData(source, "menu_usiadz") then detachElements(source, getElementData(source, "menu_usiadz"))  end
    setPedAnimation(source, block, anim, time, loop, updatePosition, interruptable, freezeLastFrame)

end)

for k,v in ipairs(getElementsByType("player")) do
    setElementData(v, "animStartPos", false)
    setElementCollisionsEnabled(v,true)
end


Podpis

Multi-Zone.gclan.pl
CZEKAMY NA CIEBIE!

Postaw piwo autorowi tego posta
 

 
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Zbugowane kajdanki! Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku