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

Wysłany: 2017-05-25, 16:14


BH|LeFeS

DayZ is EPIC!






Wiek: 21
Na forum: 3508 dni
Posty: 82
Nick w MP: LeFeS

Piwa: 7

Respekt: 26,3

Gdy nak?adam kajdanki, to potem jak jeszcze raz napisze kajdanki to nie zdejmuje tylko ponownie zak?ada kajdanki, jak si? RC zrobi to nie ma si? ju? wiecie jak to naprawi?, Prosze o pomoc bo nie wiem co robi?.

KOD:
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("#FF0000Masz 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:duty') and getElementData(player,'player:duty')=='SAPD' then
if not (gracz) then
outputChatBox("B??d! 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("#0078FFZa?o?y?e? kajdanki.",player,255, 0, 0, true)
-- 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("* #0078FF?ci?gn??e? graczowi kajdanki.", player,255, 0, 0, true)
-- outputChatBox("* #0078FFPolicjant ?ci?gna? Ci kajdanki.",targetElement,255, 0, 0, true)
end
else
outputChatBox("* #0078FFJeste? za daleko gracza, ?eby m?c wystawi? mandat.", player,255, 0, 0, true)
end
end
else
outputChatBox("#FF0000Nie Jeste? Policjantem.",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


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-05-26, 13:55


amited







Wiek: 26
Na forum: 3714 dni
Posty: 1233
Nick w MP: Amited

Piwa: 512

Respekt: 466
Respekt: 466

db3 podaj

Podpis
"amited" napisał/a:
Postaw piwo autorowi tego posta
 

 
Tagi: nie :: wiem :: oco :: chodzi :: kajdanki :: nie :: zdejmują :: się!
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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