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

Wysłany: 2018-08-01, 11:27


adisonboss







Wiek: 23
Na forum: 3332 dni
Posty: 237

Piwa: 6

Respekt: 50

Witam ! Mam pytanie co do tego skryptu http://www.gtao.pl/%3Cfon...ze-vt120129.htm
Ot?? ?eby wyj?? nosze trzeba w konsoli wpisa?
crun setElementData(localPlayer"player:duty""PR")

Da si? jako? zrobi? by to dzia?a?o bez wpisywania tej frazy tylko aby by?o pod ACL PR ?

ZA POMOC R* ORAZ :piwo:

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 1 piw(a):
Sergiusz451
Wysłany: 2018-08-01, 12:05


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Dodajesz warunek czy gracz jest w grupie ACL.

Więcej informacji znajdziesz w Wikipedii MTA:

isObjectInACLGroup

Jak u?y? tej funkcji to masz od tego nawet dwa przyk?ady w linku podanym wy?ej.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-01, 13:55


ohdude







Wiek: 14
Na forum: 2869 dni
Posty: 60
Nick w MP: ohdude

Piwa: 124

Respekt: 70,5

Stw?rz grup? ACL - po prostu dopisuj?c grup? w pliku.

Dodaj do niej wyznaczone osoby po nicku i zamiast getElementData w skrypcie daj :

 
if isObjectInACLGroup ("user."..accNameaclGetGroup "Nazwa grupy" ) ) then 
-- kod
else
outputChatBox("Nie nale?ysz do grupy")


Kod up powinien by? git, ale te? si? ucze ;) je?li b?dzie dzia?a? licz? na :piwo:

Podpis
Discord - ohdude#5133
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-02, 12:01


adisonboss







Wiek: 23
Na forum: 3332 dni
Posty: 237

Piwa: 6

Respekt: 50

To mam da? przed ka?d? funkcj? ?

[ Dodano: 2018-08-02, 16:12 ]
Mam taki problem teraz

https://imgur.com/a/6WYA9me


KOD



--[[
AutorIgorPL222
Nie zezwalam na usuwanie tej notatki :)
--]]

local objectnosze = {}
local nosze = {}
local mrk = {}
local cols = {}
local timer = {}
resourceRoot getResourceRootElement(getThisResource()) 

function dnosze(plr)
 if isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then 
  x,y,getElementPosition(plr)
  x2,y2,z2 getElementRotation(plr)
  local veh getPedOccupiedVehicle(plr)
    if not veh then return end
  mrk[veh] = createMarker(000"cylinder"22550050)
  attachElements(mrk[veh], veh0, -4, -1)
  objectnosze[veh] = createObject(1997000000)
  setElementCollisionsEnabled(objectnosze[veh], false)
  attachElements(objectnosze[veh], veh0, -1, -0.5)
  outputChatBox("Dodano nosze do karetki!"plr255255255)
 end
end
addCommandHandler("dnosze"dnosze)

function onMarker(plr)
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) ) then 
outputChatBox("Aby wzi???/schowa? nosze wpisz: /wez-nosze"plr255255255)
setElementData(plr"able:to:nosze"true)
end
end
addEventHandler("onMarkerHit"resourceRootonMarker)

function onMarker2(plr)
setElementData(plr"able:to:nosze"false)
end
addEventHandler("onMarkerLeave"resourceRootonMarker2)

function weznosze(plr)
 if not getElementData(plr"able:to:nosze"then return outputChatBox("Nie jeste? w miejscu przeznaczonym do tego!"plr255255255end
 local xd,yd,zd getElementPosition(plr)
 cols[plr] = createColSphere xdydzd)
 veh getElementsWithinColShape cols[plr], "marker" )
 for i,v in ipairs(veh) do
     elements getElementAttachedTo )
 end
 destroyElement(cols[plr])
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) ) then 
  setElementData(plr"player:nosze"true)
  setElementData(plr"nosze:plr"1)
  outputChatBox("Wzi??e? nosze z karetki."plr255255255)
  outputChatBox("Aby pu?ci?/prowadzi? nosze, wpisz: /pusc-nosze."plr255255255)
  outputChatBox("Aby kogo? po?o?y? na nosze, wpisz: /na-nosze <NICK>."plr255255255)
  outputChatBox("Aby kogo? zdj?? z noszy, wpisz: /z-noszy <NICK>."plr255255255)
  nosze[plr] = createObject(1997000000)
if getElementData(plr"player:have:nanosze"then
  local elementy getAttachedElements objectnosze[elements] )
   for i,v in ipairs(elementy) do
     detachElements(v,objectnosze[elements])
     attachElements(vnosze[plr], 002)
   end
end
  destroyElement(objectnosze[elements])
  attachElements(nosze[plr], plr01.5, -1)
  toggleControl(plr"jump"false)
  toggleControl(plr"sprint"false)
  toggleControl(plr"enter_exit"false)
  setElementCollisionsEnabled(nosze[plr], false)
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) ) then 
  outputChatBox("Schowa?e? nosze do karetki."plr255255255)
  setElementData(plr"player:nosze"false)
  setElementData(plr"nosze:plr"0)
  objectnosze[elements] = createObject(1997000000)
if getElementData(plr"player:have:nanosze"then
  local elementy2 getAttachedElements nosze[plr] )
   for i,v in ipairs(elementy2) do
     detachElements(vnosze[plr])
     attachElements(vobjectnosze[elements], 002)
   end
end
  destroyElement(nosze[plr])
  attachElements(objectnosze[elements], elements0, -1, -0.5)
  setElementData(plr"player:puscilnosze"false)
  toggleControl(plr"jump"true)
  toggleControl(plr"sprint"true)
  toggleControl(plr"enter_exit"true)
  setElementCollisionsEnabled(objectnosze[elements], false)
end
end
addCommandHandler("wez-nosze"weznosze)

function znajdzGracza(plrcel)
    local target nil
    if (tonumber(cel) ~= nilthen
        target Element.getByID("p"..cel)
    else
        for _,thePlayer in ipairs(Element.getAllByType("player")) do
            if string.find(string.gsub(thePlayer.name:lower(),"#%x%x%x%x%x%x"""), cel:lower(), 0truethen
                if target then
                    outputChatBox("Znaleziono wi?cej ni? jednego u?ytkownika o podobnym nicku, podaj wi?cej liter."plr255255255)
                    return nil
                end
                target thePlayer
            end
        end
    end
    return target
end


function puscnosze(plr)
local x2,y2,z2 getElementPosition(nosze[plr])
local x,y,getElementPosition(plr)
  if (getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)<1.9then
    if getElementData(plr"player:nosze") and not getElementData(plr"player:puscilnosze"then
    setElementData(plr"player:puscilnosze"true)
    outputChatBox("Przesta?e? prowadzi? nosze."plr255255255)
    r,y,getElementRotation(plr)
    detachElements(nosze[plr], plr)
    setElementRotation(nosze[plr], r,y,x)
    toggleControl(plr"jump"true)
    toggleControl(plr"sprint"true)
    toggleControl(plr"enter_exit"true)
    elseif getElementData(plr"player:nosze") and getElementData(plr"player:puscilnosze"then
    setElementData(plr"player:puscilnosze"false)
    outputChatBox("Ponownie prowadzisz nosze."plr255255255)
    attachElements(nosze[plr], plr01.5, -1)
    toggleControl(plr"jump"false)
    toggleControl(plr"sprint"false)
    toggleControl(plr"enter_exit"false)
    end
  end
end
addCommandHandler("pusc-nosze"puscnosze)

addCommandHandler("na-nosze", function(plrcmdcel)
    if getElementData(plr"player:duty") == "PR" and not getElementData(plr"player:puscilnosze") and getElementData(plr"player:nosze") and getElementData(plr"nosze:plr") == 1 then
        if not cel then
                outputChatBox("Podaj u?ytkownika, kt?rego chcesz po?o?y? na nosze!"plr255255255)
            return
        end
        
        local target znajdzGracza(plrcel)
        if not target then
                outputChatBox("Taki u?ytkownik nie istnieje!"plr255255255)
            return
        end
        
        if target == plr then 
            outputChatBox("Nie mo?esz po?o?y? siebie na nosze!"plr255255255)
          return 
        end
        
         
 
              x,y,getElementPosition(plr)
              circle createColSphere(x,y,z30)
              players isElementWithinColShape targetcircle )
                if players and not getElementData(target"plr:onnosze") and not getElementData(plr"player:have:nanosze"then
                  setElementData(plr"player:have:nanosze"true)
                  attachElements(targetnosze[plr], 002)
                  outputChatBox("Po?o?y?e? na nosze gracza o nicku: #00ff00"..getPlayerName(target), plr255255255true)
                  outputChatBox("Zosta?e? po?o?ony na nosze, przez gracza o nicku: #00ff00"..getPlayerName(plr), target255255255true)
                  setElementCollisionsEnabled(targetfalse)
                  setPedAnimation target"CRACK""crckidle2", -1truefalse )
                  setElementData(target"plr:onnosze"true)
                  now getTickCount()
                  if getElementData(target"plr:onnosze"then
                  timer[target] = setTimer( function()
                    local elemenciki getElementAttachedTo target )
                    x5,y5,z5 getElementRotation(elemenciki"ZXY")
                    setElementRotation(targetx5,y5,z5+90)
                  end6500)
                  end
                  destroyElement(circle)
                  else
                  outputChatBox("Ten gracz jest za daleko od Ciebie, b?d? jest ju? na noszach!"plr255255255)
                  destroyElement(circle)
                  end
    end
end)

addCommandHandler("z-noszy", function(plrcmdcel)
    if getElementData(plr"player:duty") == "PR" and not getElementData(plr"player:puscilnosze") and getElementData(plr"player:nosze") and getElementData(plr"nosze:plr") == 1 then
        if not cel then
                outputChatBox("Podaj u?ytkownika, kt?rego chcesz ?ci?gn?? z noszy!"plr255255255)
            return
        end
        
        local target znajdzGracza(plrcel)
        if not target then
                outputChatBox("Taki u?ytkownik nie istnieje!"plr255255255)
            return
        end
        
        if target == plr then 
            outputChatBox("Nie mo?esz ?ci?gn?? siebie z noszy!"plr255255255)
          return 
        end
        
         
 
                x,y,getElementPosition(plr)
                circle createColSphere(x,y,z30)
                players isElementWithinColShape targetcircle )
                if players and getElementData(target"plr:onnosze") and getElementData(plr"player:have:nanosze"then
                setElementData(plr"player:have:nanosze"false)
                outputChatBox("?ci?gna?e? z noszy gracza o nicku: #00ff00"..getPlayerName(target), plr255255255true)
                outputChatBox("Zosta?e? sci?gniety z noszy, przez gracza o nicku: #00ff00"..getPlayerName(plr), target255255255true)
                detachElements(targetnosze[plr])
                setElementData(plr"player:timer"false)
                setPedAnimation(targetfalse)
                setElementCollisionsEnabled(targettrue)
                setElementData(target"plr:onnosze"false)
                killTimer(timer[target])
                destroyElement(circle)
                else
                outputChatBox("Ten gracz jest za daleko od Ciebie, b?d? nie jest na noszach!"plr255255255)
                destroyElement(circle)
                end
    end
end)

addEvent("onPlayerQuit"true)
addEventHandler "onPlayerQuit"getRootElement(), function()
     if timer[sourcethen
          if isElement(timer[source]) then killTimer(timer[source]) end
    end
end)


[ Dodano: 2018-08-02, 16:14 ]
Ten ostatni b??d w db3 si? tylko liczy

[ Dodano: 2018-08-02, 16:31 ]
Kalizman,

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-02, 18:10


ohdude







Wiek: 14
Na forum: 2869 dni
Posty: 60
Nick w MP: ohdude

Piwa: 124

Respekt: 70,5

adisonboss, wystarczy?o zmieni? to co poda?em wy?ej, musia?e? co? kombinowa? - powr?? do wcze?niejszej wersji i zamie? tylko element dat? na acl :)

Podpis
Discord - ohdude#5133
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-02, 18:43


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Zabrak?o jednego end'a od instrukcji IF:

local objectnosze = {}
local nosze = {}
local mrk = {}
local cols = {}
local timer = {}
resourceRoot getResourceRootElement(getThisResource()) 

function dnosze(plr)
 if isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then 
  x,y,getElementPosition(plr)
  x2,y2,z2 getElementRotation(plr)
  local veh getPedOccupiedVehicle(plr)
    if not veh then return end
  mrk[veh] = createMarker(000"cylinder"22550050)
  attachElements(mrk[veh], veh0, -4, -1)
  objectnosze[veh] = createObject(1997000000)
  setElementCollisionsEnabled(objectnosze[veh], false)
  attachElements(objectnosze[veh], veh0, -1, -0.5)
  outputChatBox("Dodano nosze do karetki!"plr255255255)
 end
end
addCommandHandler("dnosze"dnosze)

function onMarker(plr)
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) ) then 
outputChatBox("Aby wzi???/schowa? nosze wpisz: /wez-nosze"plr255255255)
setElementData(plr"able:to:nosze"true)
end
end
addEventHandler("onMarkerHit"resourceRootonMarker)

function onMarker2(plr)
setElementData(plr"able:to:nosze"false)
end
addEventHandler("onMarkerLeave"resourceRootonMarker2)

function weznosze(plr)
 if not getElementData(plr"able:to:nosze"then return outputChatBox("Nie jeste? w miejscu przeznaczonym do tego!"plr255255255end
 local xd,yd,zd getElementPosition(plr)
 cols[plr] = createColSphere xdydzd)
 veh getElementsWithinColShape cols[plr], "marker" )
 for i,v in ipairs(veh) do
     elements getElementAttachedTo )
 end
 destroyElement(cols[plr])
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) ) then 
  setElementData(plr"player:nosze"true)
  setElementData(plr"nosze:plr"1)
  outputChatBox("Wzi??e? nosze z karetki."plr255255255)
  outputChatBox("Aby pu?ci?/prowadzi? nosze, wpisz: /pusc-nosze."plr255255255)
  outputChatBox("Aby kogo? po?o?y? na nosze, wpisz: /na-nosze <NICK>."plr255255255)
  outputChatBox("Aby kogo? zdj?? z noszy, wpisz: /z-noszy <NICK>."plr255255255)
  nosze[plr] = createObject(1997000000)
if getElementData(plr"player:have:nanosze"then
  local elementy getAttachedElements objectnosze[elements] )
   for i,v in ipairs(elementy) do
     detachElements(v,objectnosze[elements])
     attachElements(vnosze[plr], 002)
   end
end
  destroyElement(objectnosze[elements])
  attachElements(nosze[plr], plr01.5, -1)
  toggleControl(plr"jump"false)
  toggleControl(plr"sprint"false)
  toggleControl(plr"enter_exit"false)
  setElementCollisionsEnabled(nosze[plr], false)
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) ) then 
  outputChatBox("Schowa?e? nosze do karetki."plr255255255)
  setElementData(plr"player:nosze"false)
  setElementData(plr"nosze:plr"0)
  objectnosze[elements] = createObject(1997000000)
if getElementData(plr"player:have:nanosze"then
  local elementy2 getAttachedElements nosze[plr] )
   for i,v in ipairs(elementy2) do
     detachElements(vnosze[plr])
     attachElements(vobjectnosze[elements], 002)
   end
end
  destroyElement(nosze[plr])
  attachElements(objectnosze[elements], elements0, -1, -0.5)
  setElementData(plr"player:puscilnosze"false)
  toggleControl(plr"jump"true)
  toggleControl(plr"sprint"true)
  toggleControl(plr"enter_exit"true)
  setElementCollisionsEnabled(objectnosze[elements], false)
end
end
end
addCommandHandler("wez-nosze"weznosze)

function znajdzGracza(plrcel)
    local target nil
    if (tonumber(cel) ~= nilthen
        target Element.getByID("p"..cel)
    else
        for _,thePlayer in ipairs(Element.getAllByType("player")) do
            if string.find(string.gsub(thePlayer.name:lower(),"#%x%x%x%x%x%x"""), cel:lower(), 0truethen
                if target then
                    outputChatBox("Znaleziono wi?cej ni? jednego u?ytkownika o podobnym nicku, podaj wi?cej liter."plr255255255)
                    return nil
                end
                target thePlayer
            end
        end
    end
    return target
end


function puscnosze(plr)
local x2,y2,z2 getElementPosition(nosze[plr])
local x,y,getElementPosition(plr)
  if (getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)<1.9then
    if getElementData(plr"player:nosze") and not getElementData(plr"player:puscilnosze"then
    setElementData(plr"player:puscilnosze"true)
    outputChatBox("Przesta?e? prowadzi? nosze."plr255255255)
    r,y,getElementRotation(plr)
    detachElements(nosze[plr], plr)
    setElementRotation(nosze[plr], r,y,x)
    toggleControl(plr"jump"true)
    toggleControl(plr"sprint"true)
    toggleControl(plr"enter_exit"true)
    elseif getElementData(plr"player:nosze") and getElementData(plr"player:puscilnosze"then
    setElementData(plr"player:puscilnosze"false)
    outputChatBox("Ponownie prowadzisz nosze."plr255255255)
    attachElements(nosze[plr], plr01.5, -1)
    toggleControl(plr"jump"false)
    toggleControl(plr"sprint"false)
    toggleControl(plr"enter_exit"false)
    end
  end
end
addCommandHandler("pusc-nosze"puscnosze)

addCommandHandler("na-nosze", function(plrcmdcel)
    if getElementData(plr"player:duty") == "PR" and not getElementData(plr"player:puscilnosze") and getElementData(plr"player:nosze") and getElementData(plr"nosze:plr") == 1 then
        if not cel then
                outputChatBox("Podaj u?ytkownika, kt?rego chcesz po?o?y? na nosze!"plr255255255)
            return
        end
        
        local target znajdzGracza(plrcel)
        if not target then
                outputChatBox("Taki u?ytkownik nie istnieje!"plr255255255)
            return
        end
        
        if target == plr then 
            outputChatBox("Nie mo?esz po?o?y? siebie na nosze!"plr255255255)
          return 
        end
        
         
 
              x,y,getElementPosition(plr)
              circle createColSphere(x,y,z30)
              players isElementWithinColShape targetcircle )
                if players and not getElementData(target"plr:onnosze") and not getElementData(plr"player:have:nanosze"then
                  setElementData(plr"player:have:nanosze"true)
                  attachElements(targetnosze[plr], 002)
                  outputChatBox("Po?o?y?e? na nosze gracza o nicku: #00ff00"..getPlayerName(target), plr255255255true)
                  outputChatBox("Zosta?e? po?o?ony na nosze, przez gracza o nicku: #00ff00"..getPlayerName(plr), target255255255true)
                  setElementCollisionsEnabled(targetfalse)
                  setPedAnimation target"CRACK""crckidle2", -1truefalse )
                  setElementData(target"plr:onnosze"true)
                  now getTickCount()
                  if getElementData(target"plr:onnosze"then
                  timer[target] = setTimer( function()
                    local elemenciki getElementAttachedTo target )
                    x5,y5,z5 getElementRotation(elemenciki"ZXY")
                    setElementRotation(targetx5,y5,z5+90)
                  end6500)
                  end
                  destroyElement(circle)
                  else
                  outputChatBox("Ten gracz jest za daleko od Ciebie, b?d? jest ju? na noszach!"plr255255255)
                  destroyElement(circle)
                  end
    end
end)

addCommandHandler("z-noszy", function(plrcmdcel)
    if getElementData(plr"player:duty") == "PR" and not getElementData(plr"player:puscilnosze") and getElementData(plr"player:nosze") and getElementData(plr"nosze:plr") == 1 then
        if not cel then
                outputChatBox("Podaj u?ytkownika, kt?rego chcesz ?ci?gn?? z noszy!"plr255255255)
            return
        end
        
        local target znajdzGracza(plrcel)
        if not target then
                outputChatBox("Taki u?ytkownik nie istnieje!"plr255255255)
            return
        end
        
        if target == plr then 
            outputChatBox("Nie mo?esz ?ci?gn?? siebie z noszy!"plr255255255)
          return 
        end
        
         
 
                x,y,getElementPosition(plr)
                circle createColSphere(x,y,z30)
                players isElementWithinColShape targetcircle )
                if players and getElementData(target"plr:onnosze") and getElementData(plr"player:have:nanosze"then
                setElementData(plr"player:have:nanosze"false)
                outputChatBox("?ci?gna?e? z noszy gracza o nicku: #00ff00"..getPlayerName(target), plr255255255true)
                outputChatBox("Zosta?e? sci?gniety z noszy, przez gracza o nicku: #00ff00"..getPlayerName(plr), target255255255true)
                detachElements(targetnosze[plr])
                setElementData(plr"player:timer"false)
                setPedAnimation(targetfalse)
                setElementCollisionsEnabled(targettrue)
                setElementData(target"plr:onnosze"false)
                killTimer(timer[target])
                destroyElement(circle)
                else
                outputChatBox("Ten gracz jest za daleko od Ciebie, b?d? nie jest na noszach!"plr255255255)
                destroyElement(circle)
                end
    end
end)

addEvent("onPlayerQuit"true)
addEventHandler "onPlayerQuit"getRootElement(), function()
     if timer[sourcethen
          if isElement(timer[source]) then killTimer(timer[source]) end
    end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-03, 14:14


adisonboss







Wiek: 23
Na forum: 3332 dni
Posty: 237

Piwa: 6

Respekt: 50

Nadal nie dzia?a. KOD


--[[
AutorIgorPL222
Nie zezwalam na usuwanie tej notatki :)
--]]

local objectnosze = {}
local nosze = {}
local mrk = {}
local cols = {}
local timer = {}
resourceRoot getResourceRootElement(getThisResource()) 

function dnosze(plr)
 if isObjectInACLGroup ("user.adizygzak"..accNameaclGetGroup "Admin" ) ) then 
  x,y,getElementPosition(plr)
  x2,y2,z2 getElementRotation(plr)
  local veh getPedOccupiedVehicle(plr)
    if not veh then return end
  mrk[veh] = createMarker(000"cylinder"22550050)
  attachElements(mrk[veh], veh0, -4, -1)
  objectnosze[veh] = createObject(1997000000)
  setElementCollisionsEnabled(objectnosze[veh], false)
  attachElements(objectnosze[veh], veh0, -1, -0.5)
  outputChatBox("Dodano nosze do karetki!"plr255255255)
 end
end
addCommandHandler("dnosze"dnosze)

function onMarker(plr)
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) ) then 
outputChatBox("Aby wzi???/schowa? nosze wpisz: /wez-nosze"plr255255255)
setElementData(plr"able:to:nosze"true)
end
end
addEventHandler("onMarkerHit"resourceRootonMarker)

function onMarker2(plr)
setElementData(plr"able:to:nosze"false)
end
addEventHandler("onMarkerLeave"resourceRootonMarker2)

function weznosze(plr)
 if not getElementData(plr"able:to:nosze"then return outputChatBox("Nie jeste? w miejscu przeznaczonym do tego!"plr255255255end
 local xd,yd,zd getElementPosition(plr)
 cols[plr] = createColSphere xdydzd)
 veh getElementsWithinColShape cols[plr], "marker" )
 for i,v in ipairs(veh) do
     elements getElementAttachedTo )
 end
 destroyElement(cols[plr])
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) ) then 
  setElementData(plr"player:nosze"true)
  setElementData(plr"nosze:plr"1)
  outputChatBox("Wzi??e? nosze z karetki."plr255255255)
  outputChatBox("Aby pu?ci?/prowadzi? nosze, wpisz: /pusc-nosze."plr255255255)
  outputChatBox("Aby kogo? po?o?y? na nosze, wpisz: /na-nosze <NICK>."plr255255255)
  outputChatBox("Aby kogo? zdj?? z noszy, wpisz: /z-noszy <NICK>."plr255255255)
  nosze[plr] = createObject(1997000000)
if getElementData(plr"player:have:nanosze"then
  local elementy getAttachedElements objectnosze[elements] )
   for i,v in ipairs(elementy) do
     detachElements(v,objectnosze[elements])
     attachElements(vnosze[plr], 002)
   end
end
  destroyElement(objectnosze[elements])
  attachElements(nosze[plr], plr01.5, -1)
  toggleControl(plr"jump"false)
  toggleControl(plr"sprint"false)
  toggleControl(plr"enter_exit"false)
  setElementCollisionsEnabled(nosze[plr], false)
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) ) then 
  outputChatBox("Schowa?e? nosze do karetki."plr255255255)
  setElementData(plr"player:nosze"false)
  setElementData(plr"nosze:plr"0)
  objectnosze[elements] = createObject(1997000000)
if getElementData(plr"player:have:nanosze"then
  local elementy2 getAttachedElements nosze[plr] )
   for i,v in ipairs(elementy2) do
     detachElements(vnosze[plr])
     attachElements(vobjectnosze[elements], 002)
   end
end
  destroyElement(nosze[plr])
  attachElements(objectnosze[elements], elements0, -1, -0.5)
  setElementData(plr"player:puscilnosze"false)
  toggleControl(plr"jump"true)
  toggleControl(plr"sprint"true)
  toggleControl(plr"enter_exit"true)
  setElementCollisionsEnabled(objectnosze[elements], false)
end
end
end
addCommandHandler("wez-nosze"weznosze)

function znajdzGracza(plrcel)
    local target nil
    if (tonumber(cel) ~= nilthen
        target Element.getByID("p"..cel)
    else
        for _,thePlayer in ipairs(Element.getAllByType("player")) do
            if string.find(string.gsub(thePlayer.name:lower(),"#%x%x%x%x%x%x"""), cel:lower(), 0truethen
                if target then
                    outputChatBox("Znaleziono wi?cej ni? jednego u?ytkownika o podobnym nicku, podaj wi?cej liter."plr255255255)
                    return nil
                end
                target thePlayer
            end
        end
    end
    return target
end


function puscnosze(plr)
local x2,y2,z2 getElementPosition(nosze[plr])
local x,y,getElementPosition(plr)
  if (getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)<1.9then
    if getElementData(plr"player:nosze") and not getElementData(plr"player:puscilnosze"then
    setElementData(plr"player:puscilnosze"true)
    outputChatBox("Przesta?e? prowadzi? nosze."plr255255255)
    r,y,getElementRotation(plr)
    detachElements(nosze[plr], plr)
    setElementRotation(nosze[plr], r,y,x)
    toggleControl(plr"jump"true)
    toggleControl(plr"sprint"true)
    toggleControl(plr"enter_exit"true)
    elseif getElementData(plr"player:nosze") and getElementData(plr"player:puscilnosze"then
    setElementData(plr"player:puscilnosze"false)
    outputChatBox("Ponownie prowadzisz nosze."plr255255255)
    attachElements(nosze[plr], plr01.5, -1)
    toggleControl(plr"jump"false)
    toggleControl(plr"sprint"false)
    toggleControl(plr"enter_exit"false)
    end
  end
end
addCommandHandler("pusc-nosze"puscnosze)

addCommandHandler("na-nosze", function(plrcmdcel)
    if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) )  and not getElementData(plr"player:puscilnosze") and getElementData(plr"player:nosze") and getElementData(plr"nosze:plr") == 1 then
        if not cel then
                outputChatBox("Podaj u?ytkownika, kt?rego chcesz po?o?y? na nosze!"plr255255255)
            return
        end
        
        local target znajdzGracza(plrcel)
        if not target then
                outputChatBox("Taki u?ytkownik nie istnieje!"plr255255255)
            return
        end
        
        if target == plr then 
            outputChatBox("Nie mo?esz po?o?y? siebie na nosze!"plr255255255)
          return 
        end
        
         
 
              x,y,getElementPosition(plr)
              circle createColSphere(x,y,z30)
              players isElementWithinColShape targetcircle )
                if players and not getElementData(target"plr:onnosze") and not getElementData(plr"player:have:nanosze"then
                  setElementData(plr"player:have:nanosze"true)
                  attachElements(targetnosze[plr], 002)
                  outputChatBox("Po?o?y?e? na nosze gracza o nicku: #00ff00"..getPlayerName(target), plr255255255true)
                  outputChatBox("Zosta?e? po?o?ony na nosze, przez gracza o nicku: #00ff00"..getPlayerName(plr), target255255255true)
                  setElementCollisionsEnabled(targetfalse)
                  setPedAnimation target"CRACK""crckidle2", -1truefalse )
                  setElementData(target"plr:onnosze"true)
                  now getTickCount()
                  if getElementData(target"plr:onnosze"then
                  timer[target] = setTimer( function()
                    local elemenciki getElementAttachedTo target )
                    x5,y5,z5 getElementRotation(elemenciki"ZXY")
                    setElementRotation(targetx5,y5,z5+90)
                  end6500)
                  end
                  destroyElement(circle)
                  else
                  outputChatBox("Ten gracz jest za daleko od Ciebie, b?d? jest ju? na noszach!"plr255255255)
                  destroyElement(circle)
                  end
    end
end)

addCommandHandler("z-noszy", function(plrcmdcel)
    if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) )  and not getElementData(plr"player:puscilnosze") and getElementData(plr"player:nosze") and getElementData(plr"nosze:plr") == 1 then
        if not cel then
                outputChatBox("Podaj u?ytkownika, kt?rego chcesz ?ci?gn?? z noszy!"plr255255255)
            return
        end
        
        local target znajdzGracza(plrcel)
        if not target then
                outputChatBox("Taki u?ytkownik nie istnieje!"plr255255255)
            return
        end
        
        if target == plr then 
            outputChatBox("Nie mo?esz ?ci?gn?? siebie z noszy!"plr255255255)
          return 
        end
        
         
 
                x,y,getElementPosition(plr)
                circle createColSphere(x,y,z30)
                players isElementWithinColShape targetcircle )
                if players and getElementData(target"plr:onnosze") and getElementData(plr"player:have:nanosze"then
                setElementData(plr"player:have:nanosze"false)
                outputChatBox("?ci?gna?e? z noszy gracza o nicku: #00ff00"..getPlayerName(target), plr255255255true)
                outputChatBox("Zosta?e? sci?gniety z noszy, przez gracza o nicku: #00ff00"..getPlayerName(plr), target255255255true)
                detachElements(targetnosze[plr])
                setElementData(plr"player:timer"false)
                setPedAnimation(targetfalse)
                setElementCollisionsEnabled(targettrue)
                setElementData(target"plr:onnosze"false)
                killTimer(timer[target])
                destroyElement(circle)
                else
                outputChatBox("Ten gracz jest za daleko od Ciebie, b?d? nie jest na noszach!"plr255255255)
                destroyElement(circle)
                end
    end
end)

addEvent("onPlayerQuit"true)
addEventHandler "onPlayerQuit"getRootElement(), function()
     if timer[sourcethen
          if isElement(timer[source]) then killTimer(timer[source]) end
    end
end)




DB3
https://imgur.com/a/Uuo5N7L

[ Dodano: 2018-08-03, 14:14 ]
Znaczy skrypt si? w??cza ale nie mog? stworzy? markera

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-03, 14:40


Kalizman







Wiek: 23
Na forum: 3651 dni
Posty: 1394

Piwa: 4619

Respekt: 358,8
Respekt: 358,8Respekt: 358,8Respekt: 358,8Respekt: 358,8

Bo szanowny kolega ohdude, wzi?? tylko kawa?ek kodu, przeczytaj na wikipedi

Więcej informacji znajdziesz w Wikipedii MTA:

isObjectInACLGroup
jak u?ywa?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-03, 14:57


adisonboss







Wiek: 23
Na forum: 3332 dni
Posty: 237

Piwa: 6

Respekt: 50

Mam doda? przed isObject
local accName getAccountName getPlayerAccount thePlayer ) ) ?


[ Dodano: 2018-08-03, 15:22 ]
Teraz mam takie cu?

--[[
AutorIgorPL222
Nie zezwalam na usuwanie tej notatki :)
--]]

local objectnosze = {}
local nosze = {}
local mrk = {}
local cols = {}
local timer = {}
resourceRoot getResourceRootElement(getThisResource()) 

function dnosze(plr)
local accName getAccountName getPlayerAccount thePlayer ) ) 
if isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then 
  x,y,getElementPosition(plr)
  x2,y2,z2 getElementRotation(plr)
  local veh getPedOccupiedVehicle(plr)
    if not veh then return end
  mrk[veh] = createMarker(000"cylinder"22550050)
  attachElements(mrk[veh], veh0, -4, -1)
  objectnosze[veh] = createObject(1997000000)
  setElementCollisionsEnabled(objectnosze[veh], false)
  attachElements(objectnosze[veh], veh0, -1, -0.5)
  outputChatBox("Dodano nosze do karetki!"plr255255255)
 end
end
addCommandHandler("dnosze"dnosze)

function onMarker(plr)
local accName getAccountName getPlayerAccount thePlayer ) ) 
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) ) then 
outputChatBox("Aby wzi???/schowa? nosze wpisz: /wez-nosze"plr255255255)
setElementData(plr"able:to:nosze"true)
end
end
addEventHandler("onMarkerHit"resourceRootonMarker)

function onMarker2(plr)
setElementData(plr"able:to:nosze"false)
end
addEventHandler("onMarkerLeave"resourceRootonMarker2)

function weznosze(plr)
 if not getElementData(plr"able:to:nosze"then return outputChatBox("Nie jeste? w miejscu przeznaczonym do tego!"plr255255255end
 local xd,yd,zd getElementPosition(plr)
 cols[plr] = createColSphere xdydzd)
 veh getElementsWithinColShape cols[plr], "marker" )
 for i,v in ipairs(veh) do
     elements getElementAttachedTo )
 end
 destroyElement(cols[plr])
local accName getAccountName getPlayerAccount thePlayer ) ) 
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) ) then 
  setElementData(plr"player:nosze"true)
  setElementData(plr"nosze:plr"1)
  outputChatBox("Wzi??e? nosze z karetki."plr255255255)
  outputChatBox("Aby pu?ci?/prowadzi? nosze, wpisz: /pusc-nosze."plr255255255)
  outputChatBox("Aby kogo? po?o?y? na nosze, wpisz: /na-nosze <NICK>."plr255255255)
  outputChatBox("Aby kogo? zdj?? z noszy, wpisz: /z-noszy <NICK>."plr255255255)
  nosze[plr] = createObject(1997000000)
if getElementData(plr"player:have:nanosze"then
  local elementy getAttachedElements objectnosze[elements] )
   for i,v in ipairs(elementy) do
     detachElements(v,objectnosze[elements])
     attachElements(vnosze[plr], 002)
   end
end
  destroyElement(objectnosze[elements])
  attachElements(nosze[plr], plr01.5, -1)
  toggleControl(plr"jump"false)
  toggleControl(plr"sprint"false)
  toggleControl(plr"enter_exit"false)
  setElementCollisionsEnabled(nosze[plr], false)
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) ) then 
  outputChatBox("Schowa?e? nosze do karetki."plr255255255)
  setElementData(plr"player:nosze"false)
  setElementData(plr"nosze:plr"0)
  objectnosze[elements] = createObject(1997000000)
if getElementData(plr"player:have:nanosze"then
  local elementy2 getAttachedElements nosze[plr] )
   for i,v in ipairs(elementy2) do
     detachElements(vnosze[plr])
     attachElements(vobjectnosze[elements], 002)
   end
end
  destroyElement(nosze[plr])
  attachElements(objectnosze[elements], elements0, -1, -0.5)
  setElementData(plr"player:puscilnosze"false)
  toggleControl(plr"jump"true)
  toggleControl(plr"sprint"true)
  toggleControl(plr"enter_exit"true)
  setElementCollisionsEnabled(objectnosze[elements], false)
end
end
end
addCommandHandler("wez-nosze"weznosze)

function znajdzGracza(plrcel)
    local target nil
    if (tonumber(cel) ~= nilthen
        target Element.getByID("p"..cel)
    else
        for _,thePlayer in ipairs(Element.getAllByType("player")) do
            if string.find(string.gsub(thePlayer.name:lower(),"#%x%x%x%x%x%x"""), cel:lower(), 0truethen
                if target then
                    outputChatBox("Znaleziono wi?cej ni? jednego u?ytkownika o podobnym nicku, podaj wi?cej liter."plr255255255)
                    return nil
                end
                target thePlayer
            end
        end
    end
    return target
end


function puscnosze(plr)
local x2,y2,z2 getElementPosition(nosze[plr])
local x,y,getElementPosition(plr)
  if (getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)<1.9then
    if getElementData(plr"player:nosze") and not getElementData(plr"player:puscilnosze"then
    setElementData(plr"player:puscilnosze"true)
    outputChatBox("Przesta?e? prowadzi? nosze."plr255255255)
    r,y,getElementRotation(plr)
    detachElements(nosze[plr], plr)
    setElementRotation(nosze[plr], r,y,x)
    toggleControl(plr"jump"true)
    toggleControl(plr"sprint"true)
    toggleControl(plr"enter_exit"true)
    elseif getElementData(plr"player:nosze") and getElementData(plr"player:puscilnosze"then
    setElementData(plr"player:puscilnosze"false)
    outputChatBox("Ponownie prowadzisz nosze."plr255255255)
    attachElements(nosze[plr], plr01.5, -1)
    toggleControl(plr"jump"false)
    toggleControl(plr"sprint"false)
    toggleControl(plr"enter_exit"false)
    end
  end
end
addCommandHandler("pusc-nosze"puscnosze)

addCommandHandler("na-nosze", function(plrcmdcel)
local accName getAccountName getPlayerAccount thePlayer ) )    
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) )  and not getElementData(plr"player:puscilnosze") and getElementData(plr"player:nosze") and getElementData(plr"nosze:plr") == 1 then
        if not cel then
                outputChatBox("Podaj u?ytkownika, kt?rego chcesz po?o?y? na nosze!"plr255255255)
            return
        end
        
        local target znajdzGracza(plrcel)
        if not target then
                outputChatBox("Taki u?ytkownik nie istnieje!"plr255255255)
            return
        end
        
        if target == plr then 
            outputChatBox("Nie mo?esz po?o?y? siebie na nosze!"plr255255255)
          return 
        end
        
         
 
              x,y,getElementPosition(plr)
              circle createColSphere(x,y,z30)
              players isElementWithinColShape targetcircle )
                if players and not getElementData(target"plr:onnosze") and not getElementData(plr"player:have:nanosze"then
                  setElementData(plr"player:have:nanosze"true)
                  attachElements(targetnosze[plr], 002)
                  outputChatBox("Po?o?y?e? na nosze gracza o nicku: #00ff00"..getPlayerName(target), plr255255255true)
                  outputChatBox("Zosta?e? po?o?ony na nosze, przez gracza o nicku: #00ff00"..getPlayerName(plr), target255255255true)
                  setElementCollisionsEnabled(targetfalse)
                  setPedAnimation target"CRACK""crckidle2", -1truefalse )
                  setElementData(target"plr:onnosze"true)
                  now getTickCount()
                  if getElementData(target"plr:onnosze"then
                  timer[target] = setTimer( function()
                    local elemenciki getElementAttachedTo target )
                    x5,y5,z5 getElementRotation(elemenciki"ZXY")
                    setElementRotation(targetx5,y5,z5+90)
                  end6500)
                  end
                  destroyElement(circle)
                  else
                  outputChatBox("Ten gracz jest za daleko od Ciebie, b?d? jest ju? na noszach!"plr255255255)
                  destroyElement(circle)
                  end
    end
end)

addCommandHandler("z-noszy", function(plrcmdcel)
local accName getAccountName getPlayerAccount thePlayer ) )     
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) )  and not getElementData(plr"player:puscilnosze") and getElementData(plr"player:nosze") and getElementData(plr"nosze:plr") == 1 then
        if not cel then
                outputChatBox("Podaj u?ytkownika, kt?rego chcesz ?ci?gn?? z noszy!"plr255255255)
            return
        end
        
        local target znajdzGracza(plrcel)
        if not target then
                outputChatBox("Taki u?ytkownik nie istnieje!"plr255255255)
            return
        end
        
        if target == plr then 
            outputChatBox("Nie mo?esz ?ci?gn?? siebie z noszy!"plr255255255)
          return 
        end
        
         
 
                x,y,getElementPosition(plr)
                circle createColSphere(x,y,z30)
                players isElementWithinColShape targetcircle )
                if players and getElementData(target"plr:onnosze") and getElementData(plr"player:have:nanosze"then
                setElementData(plr"player:have:nanosze"false)
                outputChatBox("?ci?gna?e? z noszy gracza o nicku: #00ff00"..getPlayerName(target), plr255255255true)
                outputChatBox("Zosta?e? sci?gniety z noszy, przez gracza o nicku: #00ff00"..getPlayerName(plr), target255255255true)
                detachElements(targetnosze[plr])
                setElementData(plr"player:timer"false)
                setPedAnimation(targetfalse)
                setElementCollisionsEnabled(targettrue)
                setElementData(target"plr:onnosze"false)
                killTimer(timer[target])
                destroyElement(circle)
                else
                outputChatBox("Ten gracz jest za daleko od Ciebie, b?d? nie jest na noszach!"plr255255255)
                destroyElement(circle)
                end
    end
end)

addEvent("onPlayerQuit"true)
addEventHandler "onPlayerQuit"getRootElement(), function()
     if timer[sourcethen
          if isElement(timer[source]) then killTimer(timer[source]) end
    end
end)





DB3
https://imgur.com/a/TGVYmis

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-03, 18:49


maciek3286

LUA Developer






Wiek: 26
Na forum: 5201 dni
Posty: 230
Nick w MP: maciek00

Piwa: 3207

Respekt: 101,5
Respekt: 101,5

Poniewa? w argumencie funkcji gracza definiujesz jako plr a w argumencie accName thePlayer.

Zmie? thePlayer na plr i powinno by? git

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-08-04, 10:01


adisonboss







Wiek: 23
Na forum: 3332 dni
Posty: 237

Piwa: 6

Respekt: 50

Nie do ko?ca dzia?a. https://imgur.com/a/iFYUgF6

KOD

--[[
AutorIgorPL222
Nie zezwalam na usuwanie tej notatki :)
--]]

local objectnosze = {}
local nosze = {}
local mrk = {}
local cols = {}
local timer = {}
resourceRoot getResourceRootElement(getThisResource()) 

function dnosze(plr)
local accName getAccountName getPlayerAccount plr ) ) 
if isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then 
  x,y,getElementPosition(plr)
  x2,y2,z2 getElementRotation(plr)
  local veh getPedOccupiedVehicle(plr)
    if not veh then return end
  mrk[veh] = createMarker(000"cylinder"22550050)
  attachElements(mrk[veh], veh0, -4, -1)
  objectnosze[veh] = createObject(1997000000)
  setElementCollisionsEnabled(objectnosze[veh], false)
  attachElements(objectnosze[veh], veh0, -1, -0.5)
  outputChatBox("Dodano nosze do karetki!"plr255255255)
 end
end
addCommandHandler("dnosze"dnosze)

function onMarker(plr)
local accName getAccountName getPlayerAccount plr ) ) 
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) ) then 
outputChatBox("Aby wzi???/schowa? nosze wpisz: /wez-nosze"plr255255255)
setElementData(plr"able:to:nosze"true)
end
end
addEventHandler("onMarkerHit"resourceRootonMarker)

function onMarker2(plr)
setElementData(plr"able:to:nosze"false)
end
addEventHandler("onMarkerLeave"resourceRootonMarker2)

function weznosze(plr)
 if not getElementData(plr"able:to:nosze"then return outputChatBox("Nie jeste? w miejscu przeznaczonym do tego!"plr255255255end
 local xd,yd,zd getElementPosition(plr)
 cols[plr] = createColSphere xdydzd)
 veh getElementsWithinColShape cols[plr], "marker" )
 for i,v in ipairs(veh) do
     elements getElementAttachedTo )
 end
 destroyElement(cols[plr])
local accName getAccountName getPlayerAccount plr ) ) 
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) ) then 
  setElementData(plr"player:nosze"true)
  setElementData(plr"nosze:plr"1)
  outputChatBox("Wzi??e? nosze z karetki."plr255255255)
  outputChatBox("Aby pu?ci?/prowadzi? nosze, wpisz: /pusc-nosze."plr255255255)
  outputChatBox("Aby kogo? po?o?y? na nosze, wpisz: /na-nosze <NICK>."plr255255255)
  outputChatBox("Aby kogo? zdj?? z noszy, wpisz: /z-noszy <NICK>."plr255255255)
  nosze[plr] = createObject(1997000000)
if getElementData(plr"player:have:nanosze"then
  local elementy getAttachedElements objectnosze[elements] )
   for i,v in ipairs(elementy) do
     detachElements(v,objectnosze[elements])
     attachElements(vnosze[plr], 002)
   end
end
  destroyElement(objectnosze[elements])
  attachElements(nosze[plr], plr01.5, -1)
  toggleControl(plr"jump"false)
  toggleControl(plr"sprint"false)
  toggleControl(plr"enter_exit"false)
  setElementCollisionsEnabled(nosze[plr], false)
local accName getAccountName getPlayerAccount plr ) ) 
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) ) then 
  outputChatBox("Schowa?e? nosze do karetki."plr255255255)
  setElementData(plr"player:nosze"false)
  setElementData(plr"nosze:plr"0)
  objectnosze[elements] = createObject(1997000000)
if getElementData(plr"player:have:nanosze"then
  local elementy2 getAttachedElements nosze[plr] )
   for i,v in ipairs(elementy2) do
     detachElements(vnosze[plr])
     attachElements(vobjectnosze[elements], 002)
   end
end
  destroyElement(nosze[plr])
  attachElements(objectnosze[elements], elements0, -1, -0.5)
  setElementData(plr"player:puscilnosze"false)
  toggleControl(plr"jump"true)
  toggleControl(plr"sprint"true)
  toggleControl(plr"enter_exit"true)
  setElementCollisionsEnabled(objectnosze[elements], false)
end
end
end
addCommandHandler("wez-nosze"weznosze)

function znajdzGracza(plrcel)
    local target nil
    if (tonumber(cel) ~= nilthen
        target Element.getByID("p"..cel)
    else
        for _,thePlayer in ipairs(Element.getAllByType("player")) do
            if string.find(string.gsub(thePlayer.name:lower(),"#%x%x%x%x%x%x"""), cel:lower(), 0truethen
                if target then
                    outputChatBox("Znaleziono wi?cej ni? jednego u?ytkownika o podobnym nicku, podaj wi?cej liter."plr255255255)
                    return nil
                end
                target thePlayer
            end
        end
    end
    return target
end


function puscnosze(plr)
local x2,y2,z2 getElementPosition(nosze[plr])
local x,y,getElementPosition(plr)
  if (getDistanceBetweenPoints3D(x,y,z,x2,y2,z2)<1.9then
    if getElementData(plr"player:nosze") and not getElementData(plr"player:puscilnosze"then
    setElementData(plr"player:puscilnosze"true)
    outputChatBox("Przesta?e? prowadzi? nosze."plr255255255)
    r,y,getElementRotation(plr)
    detachElements(nosze[plr], plr)
    setElementRotation(nosze[plr], r,y,x)
    toggleControl(plr"jump"true)
    toggleControl(plr"sprint"true)
    toggleControl(plr"enter_exit"true)
    elseif getElementData(plr"player:nosze") and getElementData(plr"player:puscilnosze"then
    setElementData(plr"player:puscilnosze"false)
    outputChatBox("Ponownie prowadzisz nosze."plr255255255)
    attachElements(nosze[plr], plr01.5, -1)
    toggleControl(plr"jump"false)
    toggleControl(plr"sprint"false)
    toggleControl(plr"enter_exit"false)
    end
  end
end
addCommandHandler("pusc-nosze"puscnosze)

addCommandHandler("na-nosze", function(plrcmdcel)
local accName getAccountName getPlayerAccount plr ) )    
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) )  and not getElementData(plr"player:puscilnosze") and getElementData(plr"player:nosze") and getElementData(plr"nosze:plr") == 1 then
        if not cel then
                outputChatBox("Podaj u?ytkownika, kt?rego chcesz po?o?y? na nosze!"plr255255255)
            return
        end
        
        local target znajdzGracza(plrcel)
        if not target then
                outputChatBox("Taki u?ytkownik nie istnieje!"plr255255255)
            return
        end
        
        if target == plr then 
            outputChatBox("Nie mo?esz po?o?y? siebie na nosze!"plr255255255)
          return 
        end
        
         
 
              x,y,getElementPosition(plr)
              circle createColSphere(x,y,z30)
              players isElementWithinColShape targetcircle )
                if players and not getElementData(target"plr:onnosze") and not getElementData(plr"player:have:nanosze"then
                  setElementData(plr"player:have:nanosze"true)
                  attachElements(targetnosze[plr], 002)
                  outputChatBox("Po?o?y?e? na nosze gracza o nicku: #00ff00"..getPlayerName(target), plr255255255true)
                  outputChatBox("Zosta?e? po?o?ony na nosze, przez gracza o nicku: #00ff00"..getPlayerName(plr), target255255255true)
                  setElementCollisionsEnabled(targetfalse)
                  setPedAnimation target"CRACK""crckidle2", -1truefalse )
                  setElementData(target"plr:onnosze"true)
                  now getTickCount()
                  if getElementData(target"plr:onnosze"then
                  timer[target] = setTimer( function()
                    local elemenciki getElementAttachedTo target )
                    x5,y5,z5 getElementRotation(elemenciki"ZXY")
                    setElementRotation(targetx5,y5,z5+90)
                  end6500)
                  end
                  destroyElement(circle)
                  else
                  outputChatBox("Ten gracz jest za daleko od Ciebie, b?d? jest ju? na noszach!"plr255255255)
                  destroyElement(circle)
                  end
    end
end)

addCommandHandler("z-noszy", function(plrcmdcel)
local accName getAccountName getPlayerAccount plr ) )     
if isObjectInACLGroup ("user."..accNameaclGetGroup "PR" ) )  and not getElementData(plr"player:puscilnosze") and getElementData(plr"player:nosze") and getElementData(plr"nosze:plr") == 1 then
        if not cel then
                outputChatBox("Podaj u?ytkownika, kt?rego chcesz ?ci?gn?? z noszy!"plr255255255)
            return
        end
        
        local target znajdzGracza(plrcel)
        if not target then
                outputChatBox("Taki u?ytkownik nie istnieje!"plr255255255)
            return
        end
        
        if target == plr then 
            outputChatBox("Nie mo?esz ?ci?gn?? siebie z noszy!"plr255255255)
          return 
        end
        
         
 
                x,y,getElementPosition(plr)
                circle createColSphere(x,y,z30)
                players isElementWithinColShape targetcircle )
                if players and getElementData(target"plr:onnosze") and getElementData(plr"player:have:nanosze"then
                setElementData(plr"player:have:nanosze"false)
                outputChatBox("?ci?gna?e? z noszy gracza o nicku: #00ff00"..getPlayerName(target), plr255255255true)
                outputChatBox("Zosta?e? sci?gniety z noszy, przez gracza o nicku: #00ff00"..getPlayerName(plr), target255255255true)
                detachElements(targetnosze[plr])
                setElementData(plr"player:timer"false)
                setPedAnimation(targetfalse)
                setElementCollisionsEnabled(targettrue)
                setElementData(target"plr:onnosze"false)
                killTimer(timer[target])
                destroyElement(circle)
                else
                outputChatBox("Ten gracz jest za daleko od Ciebie, b?d? nie jest na noszach!"plr255255255)
                destroyElement(circle)
                end
    end
end)

addEvent("onPlayerQuit"true)
addEventHandler "onPlayerQuit"getRootElement(), function()
     if timer[sourcethen
          if isElement(timer[source]) then killTimer(timer[source]) end
    end
end)


[ Dodano: 2018-08-04, 10:02 ]
PATRZCIE CZAT

[ Dodano: 2018-08-05, 08:32 ]
Bior? i chowam nosz? jednocze?nie...

[ Dodano: 2018-08-12, 14:43 ]
Kto? co? ?

Postaw piwo autorowi tego posta
 

 
Tagi: nosze
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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