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

Wysłany: 2016-02-29, 15:59


Snapig

Amator LUA






Wiek: 28
Na forum: 3793 dni
Posty: 43
Nick w MP: Rother

Piwa: 129

Respekt: 50

Ostrzeżeń: 20%
A wiec tak potrzebuje kilku porad wiec zaczne:
1.Jak zrobic by

removePlayerVehicle

Dzialala do kilku felg a nie jednej 9w skrypcie na samym koncu probowalem cos zrobic ale no powiedzialem nieumiem xd)
2.Czy dobrze zrobilem montowanie felg jezeli nie no to jakbyscie mogli to powiedzcie co zle
3.Jak zrobic taka zecz ze jezeli masz juz jedna felke wiecej nie mozesz zamontowac (unikniecie klikaniu naraz kilku bo wtedy mozna hajs stracic) chodz o to ze klikniesz jeden raz jedna felge to zeby zalozyc nowa musisz zdemontowac a potem dopiero zamotowac.
Jak znajdziecie cos nie tak to prosze mowcie ja w gui jestem slabiutki

Client


GUIEditor = {
    button = {},
    window = {},
    memo = {}
}
addEventHandler("onClientResourceStart"resourceRoot,
    function()
        GUIEditor.window[1] = guiCreateWindow(32770732527"Tuning Pojazdu"false)
        guiWindowSetSizable(GUIEditor.window[1], false)

        GUIEditor.button[1] = guiCreateButton(10207430"1025"falseGUIEditor.window[1])
        GUIEditor.button[2] = guiCreateButton(9567527"1073"falseGUIEditor.window[1])
        GUIEditor.button[3] = guiCreateButton(9887527"1074"falseGUIEditor.window[1])
        GUIEditor.button[4] = guiCreateButton(101217529"1075"falseGUIEditor.window[1])
        GUIEditor.button[5] = guiCreateButton(91557528"1076"falseGUIEditor.window[1])
        GUIEditor.button[6] = guiCreateButton(91897427"1077"falseGUIEditor.window[1])
        GUIEditor.button[7] = guiCreateButton(92227524"1078"falseGUIEditor.window[1])
        GUIEditor.button[8] = guiCreateButton(92527526"1079"falseGUIEditor.window[1])
        GUIEditor.button[9] = guiCreateButton(92847524"1080"falseGUIEditor.window[1])
        GUIEditor.button[10] = guiCreateButton(93127524"1081"falseGUIEditor.window[1])
        GUIEditor.button[11] = guiCreateButton(93417521"1082"falseGUIEditor.window[1])
        GUIEditor.button[12] = guiCreateButton(103687224"1083"falseGUIEditor.window[1])
        GUIEditor.button[13] = guiCreateButton(93987525"1084"falseGUIEditor.window[1])
        GUIEditor.button[14] = guiCreateButton(94287522"1085"falseGUIEditor.window[1])
        GUIEditor.button[15] = guiCreateButton(94557522"1086"falseGUIEditor.window[1])
        GUIEditor.button[16] = guiCreateButton(94817521"1087"falseGUIEditor.window[1])
        GUIEditor.button[17] = guiCreateButton(107227828"1088"falseGUIEditor.window[1])
        GUIEditor.button[18] = guiCreateButton(103588225"1089"falseGUIEditor.window[1])
        GUIEditor.button[19] = guiCreateButton(107917824"1090"falseGUIEditor.window[1])
        GUIEditor.button[20] = guiCreateButton(1061237927"1091"falseGUIEditor.window[1])
        GUIEditor.button[21] = guiCreateButton(1071557828"1092"falseGUIEditor.window[1])
        GUIEditor.button[22] = guiCreateButton(1081907726"1093"falseGUIEditor.window[1])
        GUIEditor.button[23] = guiCreateButton(1082237323"1094"falseGUIEditor.window[1])
        GUIEditor.button[24] = guiCreateButton(1072547824"1095"falseGUIEditor.window[1])
        GUIEditor.button[25] = guiCreateButton(1082827726"1096"falseGUIEditor.window[1])
        GUIEditor.button[26] = guiCreateButton(1093147622"1097"falseGUIEditor.window[1])
        GUIEditor.button[27] = guiCreateButton(1103417521"1098"falseGUIEditor.window[1])
        GUIEditor.memo[1] = guiCreateMemo(1013788440"     Felgi"falseGUIEditor.window[1])
        GUIEditor.button[28] = guiCreateButton(658246430"1147"falseGUIEditor.window[1])
        GUIEditor.button[29] = guiCreateButton(575257329"1000"falseGUIEditor.window[1])
        GUIEditor.button[30] = guiCreateButton(574637427"1001"falseGUIEditor.window[1])
        GUIEditor.button[31] = guiCreateButton(5761017227"1002"falseGUIEditor.window[1])
        GUIEditor.button[32] = guiCreateButton(5771357124"1003"falseGUIEditor.window[1])
        GUIEditor.button[33] = guiCreateButton(5761657226"1014"falseGUIEditor.window[1])
        GUIEditor.button[34] = guiCreateButton(5761967227"1015"falseGUIEditor.window[1])
        GUIEditor.button[35] = guiCreateButton(5752317323"1016"falseGUIEditor.window[1])
        GUIEditor.button[36] = guiCreateButton(5742637422"1023"falseGUIEditor.window[1])
        GUIEditor.button[37] = guiCreateButton(5742957423"1049"falseGUIEditor.window[1])
        GUIEditor.button[38] = guiCreateButton(5743287426"1050"falseGUIEditor.window[1])
        GUIEditor.button[39] = guiCreateButton(5723607625"1058"falseGUIEditor.window[1])
        GUIEditor.button[40] = guiCreateButton(5733937525"1060"falseGUIEditor.window[1])
        GUIEditor.button[41] = guiCreateButton(5714277723"1138"falseGUIEditor.window[1])
        GUIEditor.button[42] = guiCreateButton(5714607723"1139"falseGUIEditor.window[1])
        GUIEditor.button[43] = guiCreateButton(5704927825"1146"falseGUIEditor.window[1])
        GUIEditor.button[44] = guiCreateButton(658656425"1158"falseGUIEditor.window[1])
        GUIEditor.button[45] = guiCreateButton(6581006425"1162"falseGUIEditor.window[1])
        GUIEditor.button[46] = guiCreateButton(6601346225"1163"falseGUIEditor.window[1])
        GUIEditor.button[47] = guiCreateButton(6611666125"1164"falseGUIEditor.window[1])
        GUIEditor.memo[2] = guiCreateMemo(6582016440"Spoiler"falseGUIEditor.window[1])
        WyjdzZPanelu guiCreateButton(2969918697"Wyjdz z panelu"falseGUIEditor.window[1])
        ZdemontujFelgi guiCreateButton(21437615064"Zdemontuj Felgi"falseGUIEditor.window[1])
        ZdemontujSpoiler guiCreateButton(41337814262"Zdemontuj Spoiler"falseGUIEditor.window[1])    
    end
)


Server

local marker createMarker(-2300.6591796875149.2534.992137908936)

addEventHandler("onClientMarkerHit",resourceRoot,
function ()
     if source ~=marker the return end
     guiSetVisible(GUIEditor.window[1],true)
     showCursore(true)
end
)

addEventHandler("onClientGUIClick",getRootElement(),
function()
     if source ~=WyjdzZPanelu the return end
     guiSetVisible(GUIEditor.window[1],false)
     showCursore(false)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[1the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[2the return end
     addVehicleUprade (theVehicle1073)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[3the return end
     addVehicleUprade (theVehicle1074)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[4the return end
     addVehicleUprade (theVehicle1075)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[5the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[6the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[7the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[8the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[9the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[10the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[11the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[12the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[13the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[14the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[15the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[16the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[17the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[18the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[19the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[20the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[21the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[22the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[23the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[24the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[25the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[25the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[26the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[27the return end
     addVehicleUprade (theVehicle1025)
     takePlayerMoney (thePlayer1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=ZdemontujFelgi the return end
     removeVehicleUprage (theVehicle, )


[ Dodano: 2016-02-29, 16:01 ]
A zapomnialem dodac xd. Za porpawna odpowiedz daje :arrow: :piwo: 8-) :roll: :mrgreen: :p :D :-> ;) :)

[ Dodano: 2016-02-29, 17:29 ]
Moglby ktos pomoc xd?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-29, 18:14


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Snapig, 1. To nie rozumiem.
2.kod kt?ry podpisa?e? ?e jest server to jest client.
Mo?esz to o wiele lepiej i pro?ciej zrobi? u?ywaj??:

Więcej informacji znajdziesz w Wikipedii MTA:

Comboboxes

i

Więcej informacji znajdziesz w Wikipedii MTA:

addVehicleUpgrade


Co do twoich uzytych funkcji to nie ma
addVehicleUprade tylko jest addVehicleUpgrade
tak samo nie ma removePlayerVehicle.
Wszystkie funkcje co do pojazd?w znajduj? si? tutaj:
Server: https://wiki.multitheftauto.com/wiki/Server_Scripting_Functions#Vehicle_functions
Client: https://wiki.multitheftauto.com/wiki/Client_Scripting_Functions#Vehicle_functions
3. Po prostu pobierasz czy slot jest tuningu jest ju? u?yty (true) albo czy nie jest (false)
Przyk?ad:
function scriptOnPlayerEnterVehicle theVehicleseatjacked ) --Rozpoczyna funkcje
    local upgrades getVehicleUpgrades theVehicle ) --Pobiera ka?dy slot 0-16) [Felgi to jest 12]
    for _upgrade in ipairs upgrades ) do -- Rozpoczyna wypakowywanie tabeli poprzez p?tle
        outputChatBox getVehicleUpgradeSlotName upgrade ) .. ": " .. upgrade ) --Wy?letla na czasie tuning.
    end
end
addEventHandler "onPlayerVehicleEnter"getRootElement(), scriptOnPlayerEnterVehicle )

Kolejna moja rada aby? jaknajwiecej robi?by? po stronie Server poniewa? po stronie client mo?na to ?atwo zbugowa?.
Jak co? to pisz pomog?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-29, 18:55


Snapig

Amator LUA






Wiek: 28
Na forum: 3793 dni
Posty: 43
Nick w MP: Rother

Piwa: 129

Respekt: 50

Ostrzeżeń: 20%
A wiec ja do
[wiki]
removeVehicleUpgrade
[/wiki]
TO chcialbym z tym ze jak? kolwiek masz felge on ma ci zdemontowac czyli takie cos :
Chce kupic felgi dobra jade do tune montuje ale nie niespodobaly mi sie wiec chce je zdomontowac. I wlasnie w tym sens!! Jak zrobic by zdemontowal jaka kolwiek felge np ja mam 1077 to nie bd robic buttonow by te id zdemontowac tylko jeden przycisk demont i all ci sie niszcza, a i co jeszcze do demontu jak zrobic by gracz mogl go uzywac tylko jak ma felge bo tak to jak "bede" ciskac to mi bedzie oddawac hajs a np juz nie mam tej felgi prosze pomozcie xd :/

Podpis
Jeżeli Ci pomogłem daj Piwko ;piwo;
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-29, 20:57


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Snapig, sprawdz
function remove_felgi sourcePlayercommand )
    theVehicle getPlayerOccupiedVehicle sourcePlayer )
    if ( theVehicle then
        local upgrade getVehicleUpgradeOnSlot theVehicle12 )
        removeVehicleUpgrade theVehicleupgrade )
    end
end
addCommandHandler "removenos"remove_felgi )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-01, 14:13


Snapig

Amator LUA






Wiek: 28
Na forum: 3793 dni
Posty: 43
Nick w MP: Rother

Piwa: 129

Respekt: 50

Ostrzeżeń: 20%
Troche zedytowalem na gui czy taki kod bedzie dzialac ?


addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=ZdemontujFelgi the return end
    theVehicle getPlayerOccupiedVehicle sourcePlayer )
    if ( theVehicle then
        local upgrade getVehicleUpgradeOnSlot theVehicle12 )
        removeVehicleUpgrade theVehicleupgrade )
    end
end


Podpis
Jeżeli Ci pomogłem daj Piwko ;piwo;
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-01, 15:24


Emm

***** ***






Wiek: 32
Na forum: 3880 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6162

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
To wytestuj i zdaj relacje

Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-01, 18:05


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Emm, czy ty nie widzisz podstawowego b??du jaki zrobi? ?
Je?eli nie to ci pomog? go zauwa?y?:
theVehicle getPlayerOccupiedVehicle sourcePlayer )

sourcePlayer -- b??d

Tutaj porawny kod:
addEventHandler("onClientGUIClick",getRootElement (),
function()
    if source ~=ZdemontujFelgi then
    local pojazd getPedOccupiedVehicle getLocalPlayer() )
        if pojazd then
            local upgrade getVehicleUpgradeOnSlot pojazd12 )
            removeVehicleUpgrade pojazdupgrade )
        end
    end    
end)

I teraz b??d jaki zrobi?em by?o to u?ycie funkcji wycofanej getPlayerOccupiedVehicle a zamienienie jej na getPedOccupiedVehicle. Twoim b??dem by?o niedostosowania zmiennej sourcePlayer kt?ra by?a z komendy brana, a tutaj musimy pobra? zmienn? z localPlayer.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-01, 19:37


Snapig

Amator LUA






Wiek: 28
Na forum: 3793 dni
Posty: 43
Nick w MP: Rother

Piwa: 129

Respekt: 50

Ostrzeżeń: 20%
Do zamkniecia !! Zrobilem cos innego tkai mniejszy :> latwiejszy skrypt xdcdd

Podpis
Jeżeli Ci pomogłem daj Piwko ;piwo;
Postaw piwo autorowi tego posta
 

 
Tagi: gui :: panel
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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