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

Wysłany: 2017-03-12, 16:12


karat1







Wiek: 24
Na forum: 3758 dni
Posty: 95
Nick w MP: Karatos

Piwa: 4

Respekt: 50

Ostrzeżeń: 60%
Witajcie mam do was pytanie bo mam skrypt na kajdanki z paczki its your world i chcia?bym ?eby jak zakuje osob? ?eby nie mog?a si? rusza? o to 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-03-12, 16:13


amited







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

Piwa: 512

Respekt: 466
Respekt: 466

skoro ma si? rusza? to po co go zakuwa??

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

 
Wysłany: 2017-03-12, 16:19


karat1







Wiek: 24
Na forum: 3758 dni
Posty: 95
Nick w MP: Karatos

Piwa: 4

Respekt: 50

Ostrzeżeń: 60%
Zeby nie mog?a sie ruszac bo wtedy stawia op?r

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-12, 16:37


amited







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

Piwa: 512

Respekt: 466
Respekt: 466


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

function blokada playerseatjacked 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,25500trueend 
end 
end 
addEventHandler ("onVehicleStartEnter"getRootElement(), blokada) 

function kajdankii playercmdgracz ) 
if getElementData(player,'player:duty') and getElementData(player,'player:duty')=='SAPD' then 
if not (graczthen 
outputChatBox("B??d! U?yj: /kajdanki <nick/ID> ",player) 
return 
end 
local targetElement=exports['ogrpg-core']:findPlayer(playergracz) 
if targetElement then 
local xygetElementPosition(playerlocal txtytz getElementPosition(targetElementlocal distance getDistanceBetweenPoints3D(xyztxtytz) 

if (distance<=10then 
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 setElementFrozen(targetElement,true)
triggerEvent("onKajdankiZakuj"rootplayertargetElementoutputChatBox("#0078FFZa?o?y?e? kajdanki.",player,25500true) 
--    outputChatBox("#0078FFPolicjant za?o?y? ci kajdanki. Nie mo?esz szybko biega?, skaka? ani prowadzi? pojazd?w.",targetElement,25500true) 
else 
toggleControl(targetElement"sprint"true toggleControl(targetElement"jump"true toggleControl(targetElement"crouch"true setElementFrozen(targetElement,false)
triggerEvent("onKajdankiZakuj"rootplayertargetElementoutputChatBox("* #0078FF?ci?gn??e? graczowi kajdanki."player,25500true) 
-- outputChatBox("* #0078FFPolicjant ?ci?gna? Ci kajdanki.",targetElement,25500trueend 
else 
outputChatBox("* #0078FFJeste? za daleko gracza, ?eby m?c wystawi? mandat."player,25500trueend 
end    
else 
outputChatBox("#FF0000Nie Jeste? Policjantem.",playerend 
end 
addCommandHandler("kajdanki"kajdankiiaddEvent("setPedAnimation"trueaddEventHandler("setPedAnimation"root, function(block,anim,time,loop,updatePosition,interruptablefreezeLastFrame) 
-- triggerServerEvent("setPedAnimation"localPlayer"SWORD""sword_block", -1falsefalsetrue,true) 
if (time==nilthen time=-1 end 
if (loop==nilthen loop=true end 
if (updatePosition==nilthen updatePosition=true end 
if (interruptable==nilthen interruptable=true end 
if (freezeLastFrame==nilthen freezeLastFrame=true end 
--    bool setPedAnimation ped thePed [, string block=nilstring anim=nilint time=-1bool loop=truebool updatePosition=truebool interruptable=truebool freezeLastFrame true] ) 
if getElementData(source"blockSettingAnimation"then return false end 
if getElementData(source"menu_usiadz"then detachElements(sourcegetElementData(source"menu_usiadz")) end 
setPedAnimation(sourceblockanimtimeloopupdatePositioninterruptablefreezeLastFrameend) 

for k,v in ipairs(getElementsByType("player")) do 
setElementData(v"animStartPos"falsesetElementCollisionsEnabled(v,trueend


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

 
Wysłany: 2017-03-12, 17:53


karat1







Wiek: 24
Na forum: 3758 dni
Posty: 95
Nick w MP: Karatos

Piwa: 4

Respekt: 50

Ostrzeżeń: 60%
dzieki za kod a czy wiesz jak dodac animke

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-03-12, 18:06


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8


Więcej informacji znajdziesz w Wikipedii MTA:

setPedAnimation


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Tagi: kajdanki
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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