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

Wysłany: 2018-12-08, 23:15


AsterBonzo

Otwórz ogień






Wiek: 20
Na forum: 2969 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 60

Respekt: 35,8

Witam chcia? bym sobie zamieni? pickup z skin?w frakcji na marekry
ale mi nie wychodzi oto kod przerobiony:


--[[
Developed by Yolos 
All rights reserved!
You cannot use this without permission!
--]]
local skins={
    ["SAMC"]={
        code="SAMC",
        positions={
            {1564.35546875,-2610.5419921875,13.555864334106,274,"Skin ratownika",20,120,2},
            {1564.35546875,-2601.0019921875,13.555864334106,70,"Skin Doktora",20,120,9},
            {1564.35546875,-2603.5019921875,13.555864334106,275,"Skin Pielegniarza",20,120},
            {1564.35546875,-2608.1419921875,13.555864334106,276,"Skin ratowniczki",20,120},
                        {1564.35546875,-2606.0019921875,13.555864334106,272,"Skin Lekarza",20,120},
        },
        text="Nie jeste? na s?u?bie lub nie pracujesz jako pracownik frakcji SAMC.",
    },
    ["SAPD"]={
        code="SAPD",
        positions={
              {2510.16, -1668.04, -50.73,267,"S?u?ba 1",1,0,2},
              {2510.16, -1670.96, -50.73,"S?u?ba 2",1,0,2},
              {2510.08, -1674.50, -50.73,284,"S?u?ba 3",1,0,2},
              {2506.54, -1671.18, -50.73,280,"S?u?ba 4",1,0,2},
              {2506.54, -1667.69, -50.73,282,"S?u?ba 5",1,0,2},
              {2507.73, -1664.44, -50.73,285,"SWAT",1,0,1},
        },
        text="Nie jeste? zatrudniony do SAPD lub nie jeste? na s?u?bie!",
    },
    ["TAXI"]={
        code="TAXI",
        positions={
            {211.77175.221003.02171"Skin M?odszego Kierowcy"30},
            {211.59170.851003.0217"Skin Kierowcy"30},
            {211.73166.441003.02170"Skin Starszego Kierowcy"30},
            {211.78162.311003.02147"Skin Zarz?du"30},
        },
        text="Nie jeste? Tax?wkarzem lub nie jeste? na s?u?bie lub nie masz uprawnien do tego skina.",
    },
        ["RCPD"]={
        code="RCPD",
        positions={
              {868.00, -597.0818.38,288,"S?U?BA",0,0,10},
              {863.20, -596.7518.35,287,"ZARZ?D",0,0,10},
        },
        text="Nie jeste? FCPD lub nie jeste? na s?u?bie albo nie masz uprawnien do tego skina.",
    },
    ["SAFD"]={
        code="SAFD",
        positions={
            {1936.04,-2005.45,13.55,278,"Skin Kadry"},
            {1935.88,-2003.02,13.55,274,"Skin ratownika"},
            {1935.87,-2000.78,13.55,277,"Skin"},
        },
        text="Nie jeste? SAFD lub nie jeste? na s?u?bie lub nie masz uprawnien do tego skina.",
      },
                ["SARA"]={
        code="SARA",
        positions={
            {-2225.75, -84.8240.36,309,"Skin Kadry"},
            {-2223.24, -137.3235.10,264,"Skin Dziewczyny"},
            {-2223.26, -132.6735.10,246,"Skin Zwyk?y"},
        },
        text="Nie jeste? SARA lub nie jeste? na s?u?bie lub nie masz uprawnien do tego skina.",
      },
}

for _,skin in pairs(skins) do
    for _,pos in ipairs(skin.positions) do
        local marker=createMarker(pos[1], pos[2], pos[3], 312752000)
        setElementDimension(markerpos[7] or 0)
        setElementInterior(markerpos[6] or 0)
        setElementData(marker,"p:faction",tostring(skin.code))
        setElementData(marker,"p:skin"tonumber(pos[4]))
        local t=createElement("text")
        setElementDimension(tpos[7] or 0)
        setElementInterior(tpos[6] or 0)
        setElementData(t,"name",pos[5] or "Skin")
        setElementPosition(t,pos[1],pos[2],pos[3])
    end
end

addEventHandler("onmarkerHit"resourceRoot, function(el,md)
    if getElementType(el)~="player" then return end
    local faction=getElementData(source,"p:faction")
    if not faction then return end
    local skin=getElementData(source,"p:skin")
    local rank=getElementData(source,"p:rank")
    if not skin then return end
    if not getPlayerFaction(el,faction) or getElementData(el,"player:duty") ~= faction then
        outputChatBox(skins[faction].textel)
        cancelEvent()
        return end
    if rank then
    if rank getElementData(el,"player:rank")  then
        outputChatBox(skins[faction].textel)
        cancelEvent()
    return end
    end
    setElementModel(el,skin)
end)


Podpis

Pomagam jak potrafię :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-08, 23:55


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Obstawiam ma?? liter? 'm' w nazwie eventu.

addEventHandler("onMarkerHit"resourceRoot, function(el,md)
    if getElementType(el)~="player" then return end
    local faction=getElementData(source,"p:faction")
    if not faction then return end
    local skin=getElementData(source,"p:skin")
    local rank=getElementData(source,"p:rank")
    if not skin then return end
    if not getPlayerFaction(el,faction) or getElementData(el,"player:duty") ~= faction then
        outputChatBox(skins[faction].textel)
        cancelEvent()
        return end
    if rank then
    if rank getElementData(el,"player:rank")  then
        outputChatBox(skins[faction].textel)
        cancelEvent()
    return end
    end
    setElementModel(el,skin)
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-09, 00:02


AsterBonzo

Otwórz ogień






Wiek: 20
Na forum: 2969 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 60

Respekt: 35,8

Poprawi?em markery si? nie pojawiaj?

Podpis

Pomagam jak potrafię :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-09, 00:09


Wilq







Wiek: 24
Na forum: 4429 dni
Posty: 3410

Piwa: 739

Respekt: 1225,8
Respekt: 1225,8

Podmie? p?tl?:

for _,skin in pairs(skins) do
    local marker=createMarker(skin.positions[1], skin.positions[2], skin.positions[3], 312752000)
    setElementDimension(markerskin.positions[7] or 0)
    setElementInterior(markerskin.positions[6] or 0)
    setElementData(marker,"p:faction",tostring(skin.code))
    setElementData(marker,"p:skin"tonumber(skin.positions[4]))
    local t=createElement("text")
    setElementDimension(tskin.positions[7] or 0)
    setElementInterior(tskin.positions[6] or 0)
    setElementData(t,"name",skin.positions[5] or "Skin")
    setElementPosition(t,skin.positions[1],skin.positions[2],skin.positions[3])
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-12-09, 00:21


AsterBonzo

Otwórz ogień






Wiek: 20
Na forum: 2969 dni
Posty: 187
Nick w MP: Hirahi

Piwa: 60

Respekt: 35,8

Nie dzia?a

[ Dodano: 2018-12-09, 00:33 ]
Pomo?esz ?

[ Dodano: 2018-12-09, 11:08 ]
Dzi?kuje za pomoc poradzi?em sobie zrobi?em co? takiego:

for _,skin in pairs(skins) do
    for _,pos in ipairs(skin.positions) do
        local marker=createMarker(pos[1], pos[2], pos[3]-0.90"cylinder"100255100)
        setElementDimension(markerpos[7] or 0)
        setElementInterior(markerpos[6] or 0)
        setElementData(marker,"p:faction",tostring(skin.code))
        setElementData(marker,"p:skin"tonumber(pos[4]))
        local t=createElement("text")
        setElementDimension(tpos[7] or 0)
        setElementInterior(tpos[6] or 0)
        setElementData(t,"name",pos[5] or "Skin")
        setElementPosition(t,pos[1],pos[2],pos[3])
    end
end


P.S mo?na zamkn?? :)

Podpis

Pomagam jak potrafię :)

Postaw piwo autorowi tego posta
 

 
Tagi: coś :: nie :: tak :: zamianą
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