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

Wysłany: 2016-07-22, 14:24


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

Hej mam pewien b??d insertuje po stronie serwera przy rejestracji startowe itemy i testowa?em czy wszystko dzia?a i natkn??em si? na b??d kt?rego nie moge naprawi?. Mianowicie chodzi i to ?e mam 2itemy "Pieni?dze" i "jablko" mam w 1slocie "Pieni?dze" ale i klikam na oboj?tnie jaki slot to dzia?a tylko "Pieni?dze".
Nie wiem zbytnio o co chodzi bo wcze?niej dzia?a?o mi normalnie musia?em co? przez przypadek zmieni? i teraz nie mam poj?cia o co chodzi ;d
Strona clienta
function isCursorOnElement(x,y,w,h)
    local mx,my getCursorPosition ()
    local fullx,fully guiGetScreenSize()
    cursorx,cursory mx*fullx,my*fully
    if cursorx and cursorx and cursory and cursory h then
        return true
    else
        return false
    end
end
asd 0

local screenWscreenH guiGetScreenSize()
= {}
 i[1] = ""
 i[2] = ""
 i[3] = ""
 i[4] = ""
 i[5] = ""
 i[6] = ""
 i[7] = ""
 i[8] = ""
 i[9] = ""
 i[10] = ""
 i[11] = ""
 i[12] = ""

addEvent("giveInv",true)
function invgive(inv1,inv2,inv3,inv4,inv5,inv6,inv7,inv8,inv9,inv10,inv11,inv12)
 i[1] = tostring(inv1)
 i[2] = tostring(inv2)
 i[3] = tostring(inv3)
 i[4] = tostring(inv4)
 i[5] = tostring(inv5)
 i[6] = tostring(inv6)
 i[7] = tostring(inv7)
 i[8] = tostring(inv8)
 i[9] = tostring(inv9)
 i[10] = tostring(inv10)
 i[11] = tostring(inv11)
 i[12] = tostring(inv12)
end
addEventHandler("giveInv",root,invgive)

    
interakcja = {
    ["jablko"] = function() outputChatBox("jesz jablko hehe",255,255,255,trueend,
    ["Pieni?dze"] = function() outputChatBox("#00ff00Posiadasz ich: "..getPlayerMoney(localPlayer),255,255,255,trueend,
}


addEventHandler("onClientRender"root,
    function()
        if asd == 1 then
        dxDrawRectangle(screenW 0.6750screenH 0.3919screenW 0.3206screenH 0.4544tocolor(1332470150), false)
        dxDrawRectangle(screenW 0.6823screenH 0.4049screenW 0.3067screenH 0.4284tocolor(000200), false)
        dxDrawRectangle(screenW 0.6896screenH 0.4180screenW 0.0673screenH 0.1094tocolor(1332470100), false)
        dxDrawRectangle(screenW 0.6896screenH 0.5404screenW 0.0673screenH 0.1094tocolor(1332470100), false)
        dxDrawRectangle(screenW 0.6896screenH 0.6628screenW 0.0673screenH 0.1094tocolor(1332470100), false)
        dxDrawRectangle(screenW 0.7643screenH 0.4180screenW 0.0673screenH 0.1094tocolor(1332470100), false)
        dxDrawRectangle(screenW 0.7643screenH 0.5404screenW 0.0673screenH 0.1094tocolor(1332470100), false)
        dxDrawRectangle(screenW 0.8389screenH 0.4180screenW 0.0673screenH 0.1094tocolor(1332470100), false)
        dxDrawRectangle(screenW 0.9136screenH 0.4180screenW 0.0673screenH 0.1094tocolor(1332470100), false)
        dxDrawRectangle(screenW 0.8389screenH 0.5404screenW 0.0673screenH 0.1094tocolor(1332470100), false)
        dxDrawRectangle(screenW 0.9143screenH 0.5404screenW 0.0673screenH 0.1094tocolor(1332470100), false)
        dxDrawRectangle(screenW 0.7643screenH 0.6628screenW 0.0673screenH 0.1094tocolor(1332470100), false)
        dxDrawRectangle(screenW 0.8389screenH 0.6628screenW 0.0673screenH 0.1094tocolor(1332470100), false)
        dxDrawRectangle(screenW 0.9143screenH 0.6628screenW 0.0673screenH 0.1094tocolor(1332470100), false)
        dxDrawText(i[1], screenW 0.6896screenH 0.4193screenW 0.7570screenH 0.5273tocolor(255255255255), 1.00"sans""center""center"falsefalsefalsefalsefalse)
        dxDrawText(i[2], screenW 0.7643screenH 0.4193screenW 0.8316screenH 0.5273tocolor(255255255255), 1.00"sans""center""center"falsefalsefalsefalsefalse)
        dxDrawText(i[3], screenW 0.8389screenH 0.4193screenW 0.9063screenH 0.5273tocolor(255255255255), 1.00"sans""center""center"falsefalsefalsefalsefalse)
        dxDrawText(i[4], screenW 0.9143screenH 0.4193screenW 0.9817screenH 0.5273tocolor(255255255255), 1.00"sans""center""center"falsefalsefalsefalsefalse)
        dxDrawText(i[5], screenW 0.6896screenH 0.5404screenW 0.7570screenH 0.6484tocolor(255255255255), 1.00"sans""center""center"falsefalsefalsefalsefalse)
        dxDrawText(i[6], screenW 0.7643screenH 0.5404screenW 0.8316screenH 0.6484tocolor(255255255255), 1.00"sans""center""center"falsefalsefalsefalsefalse)
        dxDrawText(i[7], screenW 0.8389screenH 0.5404screenW 0.9063screenH 0.6484tocolor(255255255255), 1.00"sans""center""center"falsefalsefalsefalsefalse)
        dxDrawText(i[8], screenW 0.9136screenH 0.5417screenW 0.9810screenH 0.6497tocolor(255255255255), 1.00"sans""center""center"falsefalsefalsefalsefalse)
        dxDrawText(i[9], screenW 0.6896screenH 0.6615screenW 0.7570screenH 0.7695tocolor(255255255255), 1.00"sans""center""center"falsefalsefalsefalsefalse)
        dxDrawText(i[10], screenW 0.7643screenH 0.6641screenW 0.8316screenH 0.7721tocolor(255255255255), 1.00"sans""center""center"falsefalsefalsefalsefalse)
        dxDrawText(i[11], screenW 0.8389screenH 0.6628screenW 0.9063screenH 0.7708tocolor(255255255255), 1.00"sans""center""center"falsefalsefalsefalsefalse)
        dxDrawText(i[12], screenW 0.9136screenH 0.6628screenW 0.9810screenH 0.7708tocolor(255255255255), 1.00"sans""center""center"falsefalsefalsefalsefalse)
        end
    end
)

bindKey("I""up",function()
if asd == 0 then 
triggerServerEvent("pobierzSloty",localPlayer,localPlayer)
asd 1 
showCursor(true)
else
showCursor(false)
asd 0
end
end)


addEventHandler("onClientClick"root,function()
        if isCursorOnElement(screenW 0.6896screenH 0.4193screenW 0.7570screenH 0.5273) and getKeyState("mouse1"then
            if interakcja[i[1]] then
                interakcja[i[1]]()
            end
        elseif isCursorOnElement(screenW 0.7643screenH 0.4193screenW 0.8316screenH 0.5273) and getKeyState("mouse1"then
            if interakcja[i[2]] then
                interakcja[i[2]]()
            end
        elseif isCursorOnElement(screenW 0.8389screenH 0.4193screenW 0.9063screenH 0.5273) and getKeyState("mouse1"then
            if interakcja[i[3]] then
                interakcja[i[3]]()
            end
        elseif isCursorOnElement(screenW 0.9143screenH 0.4193screenW 0.9817screenH 0.5273) and getKeyState("mouse1"then
            if interakcja[i[4]] then
                interakcja[i[4]]()
            end
        elseif isCursorOnElement(screenW 0.6896screenH 0.5404screenW 0.7570screenH 0.6484) and getKeyState("mouse1"then
            if interakcja[i[5]] then
                interakcja[i[5]]()
            end
        elseif isCursorOnElementscreenW 0.7643screenH 0.5404screenW 0.8316screenH 0.6484) and getKeyState("mouse1"then
            if interakcja[i[6]] then
                interakcja[i[6]]()
            end
        elseif isCursorOnElement(screenW 0.8389screenH 0.5404screenW 0.9063screenH 0.6484) and getKeyState("mouse1"then
            if interakcja[i[7]] then
                interakcja[i[7]]()
            end
        elseif isCursorOnElement(screenW 0.9136screenH 0.5417screenW 0.9810screenH 0.6497) and getKeyState("mouse1"then
            if interakcja[i[8]] then
                interakcja[i[8]]()
            end
        elseif isCursorOnElement(screenW 0.6896screenH 0.6615screenW 0.7570screenH 0.7695) and getKeyState("mouse1"then
            if interakcja[i[9]] then
                interakcja[i[9]]()

            end
        elseif isCursorOnElement(screenW 0.7643screenH 0.6641screenW 0.8316screenH 0.7721) and getKeyState("mouse1"then
            if interakcja[i[10]] then
                interakcja[i[10]]()

            end
        elseif isCursorOnElement(screenW 0.8389screenH 0.6628screenW 0.9063screenH 0.7708) and getKeyState("mouse1"then
            if interakcja[i[11]] then
                interakcja[i[11]]()

            end
        elseif isCursorOnElement(screenW 0.9136screenH 0.6628screenW 0.9810screenH 0.7708) and getKeyState("mouse1"then
            if interakcja[i[12]] then
                interakcja[i[12]]()
            end
        end

end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-22, 15:03


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Hazmudex, zobacz na wiki co pisz? o funkcji:

Więcej informacji znajdziesz w Wikipedii MTA:

IsCursorOnElement


bool isCursorOnElementint xint yint widthint height )



Cytat:


x: The X absolute position at the Screen.
y: The Y absoulte position at the Screen.
width: The absolute width of the Area.
height: The absolute height of the Area.


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-22, 15:31


_Haze

Peace Yo!






Wiek: 24
Na forum: 4184 dni
Posty: 1648
Nick w MP: Haze

Piwa: 2628

Respekt: 1020
Respekt: 1020

rozumiem to ale co to ma do tego i jak mam inaczej to zrobic

Postaw piwo autorowi tego posta
 

 
Tagi: system :: inventory :: (client)
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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