Jump to content
Форум МТА — GTA MTA: SA онлайн игра

Помогите пожалуйста


Recommended Posts

Вообщем скачал ресурс фракции ппс, и не могу выдать себе team "ППС г.Алмазовый"  Из-за этого когда я встаю на маркер пишется "Вы не во фракции"

Помогите пожалуйста

local sw,sh = guiGetScreenSize()
local px,py = sw/1600,sh/900

local fonts = dxCreateFont("files/1.ttf", 20)
local font = dxCreateFont("files/1.ttf", 10)

local mark = createMarker(-350.85546875,-788.8896484375,1065.1176757812, "cylinder", 2, 24,0,255,150)

setElementInterior(mark, 1)
local circle = dxCreateTexture("files/circle.png")
size = 1.03
draw = false
draw2 = false


local ranks = getElementData(localPlayer, "Должность")


addEventHandler("onClientRender", root, function()
    if draw then
        dxDrawImage(px*500,py*225,px*600,py*450, "files/bg.png" )
        dxDrawImage(px*1045,py*250,px*24,py*24, "files/button_close.png", 0,0,0, tocolor(255,255,255,150))
        dxDrawImage(px*1000,py*325,px*76,py*14, "files/button_all_ranks.png", 0,0,0, tocolor(255,255,255,170))

        if getElementData(localPlayer,"Должность") == "1" then
        dxDrawText("Сержант", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
        dxDrawImage(px*535,px*330,py*62,px*78, "files/1.png")
        dxDrawText("Сержант", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
        dxDrawText("0/3000", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")
    end
    if getElementData(localPlayer,"Должность") == "2" then
        dxDrawText("Старший Сержант", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
        dxDrawImage(px*535,py*430,px*62,py*78, "files/2.png")
        dxDrawText("0/4500", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")
    end
    if getElementData(localPlayer,"Должность") == "3" then
        dxDrawText("Старшина", px*620, 620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
        dxDrawImage(px*535,py*430,px*62,py*78, "files/3.png")
        dxDrawText("0/6000", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")
    end
    if getElementData(localPlayer,"Должность") == "4" then
        dxDrawText("Прапорщик", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
        dxDrawImage(px*535,py*330,px*62,py*78, "files/4.png")
        dxDrawText("0/7000", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")
    end
    if getElementData(localPlayer,"Должность") == "5" then
        dxDrawText("Старший Прапорщик", px*620, 620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
        dxDrawImage(px*535,py*330,px*62,py*78, "files/5.png")
        dxDrawText("0/8500", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")
    end
    if getElementData(localPlayer,"Должность") == "6" then
        dxDrawText("Лейтенант", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
        dxDrawImage(px*535,py*330,px*62,py*78, "files/6.png")
        dxDrawText("0/9000", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")
    end
    if getElementData(localPlayer,"Должность") == "7" then
        dxDrawText("Старший Лейтенант", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
        dxDrawImage(px*535,py*330,py*62,px*78, "files/7.png")
        dxDrawText("0/11000", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")
    end
    if getElementData(localPlayer,"Должность") == "8" then
        dxDrawText("Капитан", px*620, 620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
        dxDrawImage(px*535,py*330,px*62,py*78, "files/8.png")
        dxDrawText("0/13000", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")
    end
    if getElementData(localPlayer,"Должность") == "9" then
        dxDrawText("Майор", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
        dxDrawImage(px*535,py*330,px*62,py*78, "files/9.png")
        dxDrawText("0/18000", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")
    end
    if getElementData(localPlayer,"Должность") == "10" then
        dxDrawText("Подполковник", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
        dxDrawImage(px*535,py*330,px*62,py*78, "files/10.png")
        dxDrawText("0/25000", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")
    end
    if getElementData(localPlayer,"Должность") == "11" then
        dxDrawText("Полковник", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
        dxDrawImage(px*535,py*330,px*62,py*78, "files/11.png")
        dxDrawRectangle(px*620,py*395,px*235,py*10,tocolor(196, 165, 6, 255))
        dxDrawText("MAX LEVEL", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")
    end
    if getElementData(localPlayer,"Должность") == "12" then
        dxDrawText("Генерал", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
        dxDrawImage(px*535,py*330,px*62,py*78, "files/12.png")
        dxDrawRectangle(px*620,py*395,px*235,py*10,tocolor(196, 165, 6, 255))
        dxDrawText("MAX LEVEL", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")
    end
        if cursorPosition(px*1045,py*250,px*24,py*24) then
            dxDrawImage(px*1045,py*250,px*24,py*24, "files/button_close.png", 0,0,0, tocolor(255,255,255,255))
        end
        if cursorPosition(px*1000,py*325,px*76,py*14) then
            dxDrawImage(px*1000,py*325,px*76,py*14, "files/button_all_ranks.png", 0,0,0, tocolor(255,255,255,255))
end
end
    if draw2 then
        dxDrawImage(px*500,py*225,px*600,py*450, "files/bg2.png" )
        dxDrawImage(px*1045,py*250,px*24,py*24, "files/button_close.png", 0,0,0, tocolor(255,255,255,150))
        if cursorPosition(px*1045,py*250,px*24,py*24) then
            dxDrawImage(px*1045,py*250,px*24,py*24, "files/button_close.png", 0,0,0, tocolor(255,255,255,255))
        end
            dxDrawRectangle(px*500,py*300, px*290,py*110, tocolor(51,73,97,255))
            dxDrawImage(px*530,py*320,px*62,py*78, "files/1.png", 0,0,0, tocolor(255,255,255,255))
            dxDrawText("Cержант", px*630, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")

            dxDrawRectangle(px*810,py*300, px*290,py*110, tocolor(51,73,97,255))
            dxDrawImage(px*840,py*320,px*62,py*78, "files/2.png", 0,0,0, tocolor(255,255,255,255))
            dxDrawText("Cт. Cержант", px*920, py*625, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
            dxDrawText("Необходимо опыта:\n7 000 оч.", px*930, py*690, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")

            dxDrawRectangle(px*500,py*415, px*290,py*110, tocolor(51,73,97,255))
            dxDrawImage(px*530,py*435,px*62,py*78, "files/3.png", 0,0,0, tocolor(255,255,255,255))
            dxDrawText("Старшина", px*630, py*840, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
            dxDrawText("Необходимо опыта:\n9 000 оч.", px*620, py*905, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")

            dxDrawRectangle(px*810,py*415, px*290,py*110, tocolor(51,73,97,255))
            dxDrawImage(px*840,py*435,px*62,py*78, "files/4.png", 0,0,0, tocolor(255,255,255,255))
            dxDrawText("Прапорщик", px*920, py*840, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
            dxDrawText("Необходимо опыта:\n12 000 оч.", px*930, py*910, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")

            dxDrawRectangle(px*500,py*530, px*290,py*110, tocolor(51,73,97,255))
            dxDrawImage(px*530,py*550,62,py*78, "files/5.png", 0,0,0, tocolor(255,255,255,255))
            dxDrawText("Ст.Прапорщик", px*600, py*1070, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
            dxDrawText("Необходимо опыта:\n22 000 оч.", px*620, py*1140, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")

            dxDrawRectangle(px*810,py*530, px*290,py*110, tocolor(51,73,97,255))
            dxDrawImage(px*840,py*550,px*62,py*78, "files/6.png", 0,0,0, tocolor(255,255,255,255))
            dxDrawText("Лейтенант", px*920, py*1070, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center")
            dxDrawText("Необходимо опыта:\n30 000 оч.", px*930, py*1140, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center")
        end

end)

    addEventHandler("onClientClick", root, function(button, state)
        if button == "left" and state == "down" then
            if draw then
                if cursorPosition(px*1000,py*325,px*76,py*14) then
                    draw2 = true
                    draw = false
                    showCursor(true)
                end
            end
        end
    end)


function cursorPosition(x, y, w, h)
    if (not isCursorShowing()) then
        return false
    end
    local mx, my = getCursorPosition()
    local fullx, fully = guiGetScreenSize()
    cursorx, cursory = mx*fullx, my*fully
    if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then
        return true
    else
        return false
    end
end

    addEventHandler("onClientClick", root, function(button, state)
        if button == "left" and state == "down" then
            if draw or draw2 then
                if cursorPosition(px*1045,py*250,px*24,py*24) then
                    draw = false
                    draw2 = false
                    showCursor(false)
                end
            end
        end
    end)


addEventHandler("onClientMarkerHit", mark, function(ply)
	setElementInterior(mark, 1)
    if ply ~= localPlayer then return end
    if source == mark then
        local veh = getPedOccupiedVehicle(ply)
        if not veh then
            if getTeamName (getPlayerTeam (localPlayer)) == "ППС г.Алмазовый" then  
            draw = true
                showCursor(true)
            else
                outputChatBox("Вы не во фракции")
        end
    end
end
end)

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Similar Content

    • By Луиджи
      Вообщем скачал ресурс фракции ппс, и не могу выдать себе team "ППС г.Алмазовый"  Из-за этого когда я встаю на маркер пишется "Вы не во фракции"
      Помогите пожалуйста
      local sw,sh = guiGetScreenSize() local px,py = sw/1600,sh/900 local fonts = dxCreateFont("files/1.ttf", 20) local font = dxCreateFont("files/1.ttf", 10) local mark = createMarker(-350.85546875,-788.8896484375,1065.1176757812, "cylinder", 2, 24,0,255,150) setElementInterior(mark, 1) local circle = dxCreateTexture("files/circle.png") size = 1.03 draw = false draw2 = false local ranks = getElementData(localPlayer, "Должность") addEventHandler("onClientRender", root, function() if draw then dxDrawImage(px*500,py*225,px*600,py*450, "files/bg.png" ) dxDrawImage(px*1045,py*250,px*24,py*24, "files/button_close.png", 0,0,0, tocolor(255,255,255,150)) dxDrawImage(px*1000,py*325,px*76,py*14, "files/button_all_ranks.png", 0,0,0, tocolor(255,255,255,170)) if getElementData(localPlayer,"Должность") == "1" then dxDrawText("Сержант", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawImage(px*535,px*330,py*62,px*78, "files/1.png") dxDrawText("Сержант", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawText("0/3000", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") end if getElementData(localPlayer,"Должность") == "2" then dxDrawText("Старший Сержант", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawImage(px*535,py*430,px*62,py*78, "files/2.png") dxDrawText("0/4500", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") end if getElementData(localPlayer,"Должность") == "3" then dxDrawText("Старшина", px*620, 620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawImage(px*535,py*430,px*62,py*78, "files/3.png") dxDrawText("0/6000", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") end if getElementData(localPlayer,"Должность") == "4" then dxDrawText("Прапорщик", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawImage(px*535,py*330,px*62,py*78, "files/4.png") dxDrawText("0/7000", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") end if getElementData(localPlayer,"Должность") == "5" then dxDrawText("Старший Прапорщик", px*620, 620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawImage(px*535,py*330,px*62,py*78, "files/5.png") dxDrawText("0/8500", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") end if getElementData(localPlayer,"Должность") == "6" then dxDrawText("Лейтенант", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawImage(px*535,py*330,px*62,py*78, "files/6.png") dxDrawText("0/9000", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") end if getElementData(localPlayer,"Должность") == "7" then dxDrawText("Старший Лейтенант", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawImage(px*535,py*330,py*62,px*78, "files/7.png") dxDrawText("0/11000", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") end if getElementData(localPlayer,"Должность") == "8" then dxDrawText("Капитан", px*620, 620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawImage(px*535,py*330,px*62,py*78, "files/8.png") dxDrawText("0/13000", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") end if getElementData(localPlayer,"Должность") == "9" then dxDrawText("Майор", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawImage(px*535,py*330,px*62,py*78, "files/9.png") dxDrawText("0/18000", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") end if getElementData(localPlayer,"Должность") == "10" then dxDrawText("Подполковник", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawImage(px*535,py*330,px*62,py*78, "files/10.png") dxDrawText("0/25000", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") end if getElementData(localPlayer,"Должность") == "11" then dxDrawText("Полковник", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawImage(px*535,py*330,px*62,py*78, "files/11.png") dxDrawRectangle(px*620,py*395,px*235,py*10,tocolor(196, 165, 6, 255)) dxDrawText("MAX LEVEL", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") end if getElementData(localPlayer,"Должность") == "12" then dxDrawText("Генерал", px*620, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawImage(px*535,py*330,px*62,py*78, "files/12.png") dxDrawRectangle(px*620,py*395,px*235,py*10,tocolor(196, 165, 6, 255)) dxDrawText("MAX LEVEL", px*870, py*740, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") end if cursorPosition(px*1045,py*250,px*24,py*24) then dxDrawImage(px*1045,py*250,px*24,py*24, "files/button_close.png", 0,0,0, tocolor(255,255,255,255)) end if cursorPosition(px*1000,py*325,px*76,py*14) then dxDrawImage(px*1000,py*325,px*76,py*14, "files/button_all_ranks.png", 0,0,0, tocolor(255,255,255,255)) end end if draw2 then dxDrawImage(px*500,py*225,px*600,py*450, "files/bg2.png" ) dxDrawImage(px*1045,py*250,px*24,py*24, "files/button_close.png", 0,0,0, tocolor(255,255,255,150)) if cursorPosition(px*1045,py*250,px*24,py*24) then dxDrawImage(px*1045,py*250,px*24,py*24, "files/button_close.png", 0,0,0, tocolor(255,255,255,255)) end dxDrawRectangle(px*500,py*300, px*290,py*110, tocolor(51,73,97,255)) dxDrawImage(px*530,py*320,px*62,py*78, "files/1.png", 0,0,0, tocolor(255,255,255,255)) dxDrawText("Cержант", px*630, py*620, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawRectangle(px*810,py*300, px*290,py*110, tocolor(51,73,97,255)) dxDrawImage(px*840,py*320,px*62,py*78, "files/2.png", 0,0,0, tocolor(255,255,255,255)) dxDrawText("Cт. Cержант", px*920, py*625, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawText("Необходимо опыта:\n7 000 оч.", px*930, py*690, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") dxDrawRectangle(px*500,py*415, px*290,py*110, tocolor(51,73,97,255)) dxDrawImage(px*530,py*435,px*62,py*78, "files/3.png", 0,0,0, tocolor(255,255,255,255)) dxDrawText("Старшина", px*630, py*840, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawText("Необходимо опыта:\n9 000 оч.", px*620, py*905, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") dxDrawRectangle(px*810,py*415, px*290,py*110, tocolor(51,73,97,255)) dxDrawImage(px*840,py*435,px*62,py*78, "files/4.png", 0,0,0, tocolor(255,255,255,255)) dxDrawText("Прапорщик", px*920, py*840, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawText("Необходимо опыта:\n12 000 оч.", px*930, py*910, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") dxDrawRectangle(px*500,py*530, px*290,py*110, tocolor(51,73,97,255)) dxDrawImage(px*530,py*550,62,py*78, "files/5.png", 0,0,0, tocolor(255,255,255,255)) dxDrawText("Ст.Прапорщик", px*600, py*1070, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawText("Необходимо опыта:\n22 000 оч.", px*620, py*1140, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") dxDrawRectangle(px*810,py*530, px*290,py*110, tocolor(51,73,97,255)) dxDrawImage(px*840,py*550,px*62,py*78, "files/6.png", 0,0,0, tocolor(255,255,255,255)) dxDrawText("Лейтенант", px*920, py*1070, px*60, py*60, tocolor(255,198,23,255), 1, fonts, "left", "center") dxDrawText("Необходимо опыта:\n30 000 оч.", px*930, py*1140, px*60, py*60, tocolor(255,255,255,255), 1, font, "left", "center") end end) addEventHandler("onClientClick", root, function(button, state) if button == "left" and state == "down" then if draw then if cursorPosition(px*1000,py*325,px*76,py*14) then draw2 = true draw = false showCursor(true) end end end end) function cursorPosition(x, y, w, h) if (not isCursorShowing()) then return false end local mx, my = getCursorPosition() local fullx, fully = guiGetScreenSize() cursorx, cursory = mx*fullx, my*fully if cursorx > x and cursorx < x + w and cursory > y and cursory < y + h then return true else return false end end addEventHandler("onClientClick", root, function(button, state) if button == "left" and state == "down" then if draw or draw2 then if cursorPosition(px*1045,py*250,px*24,py*24) then draw = false draw2 = false showCursor(false) end end end end) addEventHandler("onClientMarkerHit", mark, function(ply) setElementInterior(mark, 1) if ply ~= localPlayer then return end if source == mark then local veh = getPedOccupiedVehicle(ply) if not veh then if getTeamName (getPlayerTeam (localPlayer)) == "ППС г.Алмазовый" then draw = true showCursor(true) else outputChatBox("Вы не во фракции") end end end end)  
×
×
  • Create New...