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: 3934 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(327, 70, 732, 527, "Tuning Pojazdu", false)
        guiWindowSetSizable(GUIEditor.window[1], false)

        GUIEditor.button[1] = guiCreateButton(10, 20, 74, 30, "1025", false, GUIEditor.window[1])
        GUIEditor.button[2] = guiCreateButton(9, 56, 75, 27, "1073", false, GUIEditor.window[1])
        GUIEditor.button[3] = guiCreateButton(9, 88, 75, 27, "1074", false, GUIEditor.window[1])
        GUIEditor.button[4] = guiCreateButton(10, 121, 75, 29, "1075", false, GUIEditor.window[1])
        GUIEditor.button[5] = guiCreateButton(9, 155, 75, 28, "1076", false, GUIEditor.window[1])
        GUIEditor.button[6] = guiCreateButton(9, 189, 74, 27, "1077", false, GUIEditor.window[1])
        GUIEditor.button[7] = guiCreateButton(9, 222, 75, 24, "1078", false, GUIEditor.window[1])
        GUIEditor.button[8] = guiCreateButton(9, 252, 75, 26, "1079", false, GUIEditor.window[1])
        GUIEditor.button[9] = guiCreateButton(9, 284, 75, 24, "1080", false, GUIEditor.window[1])
        GUIEditor.button[10] = guiCreateButton(9, 312, 75, 24, "1081", false, GUIEditor.window[1])
        GUIEditor.button[11] = guiCreateButton(9, 341, 75, 21, "1082", false, GUIEditor.window[1])
        GUIEditor.button[12] = guiCreateButton(10, 368, 72, 24, "1083", false, GUIEditor.window[1])
        GUIEditor.button[13] = guiCreateButton(9, 398, 75, 25, "1084", false, GUIEditor.window[1])
        GUIEditor.button[14] = guiCreateButton(9, 428, 75, 22, "1085", false, GUIEditor.window[1])
        GUIEditor.button[15] = guiCreateButton(9, 455, 75, 22, "1086", false, GUIEditor.window[1])
        GUIEditor.button[16] = guiCreateButton(9, 481, 75, 21, "1087", false, GUIEditor.window[1])
        GUIEditor.button[17] = guiCreateButton(107, 22, 78, 28, "1088", false, GUIEditor.window[1])
        GUIEditor.button[18] = guiCreateButton(103, 58, 82, 25, "1089", false, GUIEditor.window[1])
        GUIEditor.button[19] = guiCreateButton(107, 91, 78, 24, "1090", false, GUIEditor.window[1])
        GUIEditor.button[20] = guiCreateButton(106, 123, 79, 27, "1091", false, GUIEditor.window[1])
        GUIEditor.button[21] = guiCreateButton(107, 155, 78, 28, "1092", false, GUIEditor.window[1])
        GUIEditor.button[22] = guiCreateButton(108, 190, 77, 26, "1093", false, GUIEditor.window[1])
        GUIEditor.button[23] = guiCreateButton(108, 223, 73, 23, "1094", false, GUIEditor.window[1])
        GUIEditor.button[24] = guiCreateButton(107, 254, 78, 24, "1095", false, GUIEditor.window[1])
        GUIEditor.button[25] = guiCreateButton(108, 282, 77, 26, "1096", false, GUIEditor.window[1])
        GUIEditor.button[26] = guiCreateButton(109, 314, 76, 22, "1097", false, GUIEditor.window[1])
        GUIEditor.button[27] = guiCreateButton(110, 341, 75, 21, "1098", false, GUIEditor.window[1])
        GUIEditor.memo[1] = guiCreateMemo(101, 378, 84, 40, "     Felgi", false, GUIEditor.window[1])
        GUIEditor.button[28] = guiCreateButton(658, 24, 64, 30, "1147", false, GUIEditor.window[1])
        GUIEditor.button[29] = guiCreateButton(575, 25, 73, 29, "1000", false, GUIEditor.window[1])
        GUIEditor.button[30] = guiCreateButton(574, 63, 74, 27, "1001", false, GUIEditor.window[1])
        GUIEditor.button[31] = guiCreateButton(576, 101, 72, 27, "1002", false, GUIEditor.window[1])
        GUIEditor.button[32] = guiCreateButton(577, 135, 71, 24, "1003", false, GUIEditor.window[1])
        GUIEditor.button[33] = guiCreateButton(576, 165, 72, 26, "1014", false, GUIEditor.window[1])
        GUIEditor.button[34] = guiCreateButton(576, 196, 72, 27, "1015", false, GUIEditor.window[1])
        GUIEditor.button[35] = guiCreateButton(575, 231, 73, 23, "1016", false, GUIEditor.window[1])
        GUIEditor.button[36] = guiCreateButton(574, 263, 74, 22, "1023", false, GUIEditor.window[1])
        GUIEditor.button[37] = guiCreateButton(574, 295, 74, 23, "1049", false, GUIEditor.window[1])
        GUIEditor.button[38] = guiCreateButton(574, 328, 74, 26, "1050", false, GUIEditor.window[1])
        GUIEditor.button[39] = guiCreateButton(572, 360, 76, 25, "1058", false, GUIEditor.window[1])
        GUIEditor.button[40] = guiCreateButton(573, 393, 75, 25, "1060", false, GUIEditor.window[1])
        GUIEditor.button[41] = guiCreateButton(571, 427, 77, 23, "1138", false, GUIEditor.window[1])
        GUIEditor.button[42] = guiCreateButton(571, 460, 77, 23, "1139", false, GUIEditor.window[1])
        GUIEditor.button[43] = guiCreateButton(570, 492, 78, 25, "1146", false, GUIEditor.window[1])
        GUIEditor.button[44] = guiCreateButton(658, 65, 64, 25, "1158", false, GUIEditor.window[1])
        GUIEditor.button[45] = guiCreateButton(658, 100, 64, 25, "1162", false, GUIEditor.window[1])
        GUIEditor.button[46] = guiCreateButton(660, 134, 62, 25, "1163", false, GUIEditor.window[1])
        GUIEditor.button[47] = guiCreateButton(661, 166, 61, 25, "1164", false, GUIEditor.window[1])
        GUIEditor.memo[2] = guiCreateMemo(658, 201, 64, 40, "Spoiler", false, GUIEditor.window[1])
        WyjdzZPanelu = guiCreateButton(296, 99, 186, 97, "Wyjdz z panelu", false, GUIEditor.window[1])
        ZdemontujFelgi = guiCreateButton(214, 376, 150, 64, "Zdemontuj Felgi", false, GUIEditor.window[1])
        ZdemontujSpoiler = guiCreateButton(413, 378, 142, 62, "Zdemontuj Spoiler", false, GUIEditor.window[1])    
    end
)


Server

local marker = createMarker(-2300.6591796875, 149.25, 34.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[1] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[2] the return end
     addVehicleUprade (theVehicle, 1073)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[3] the return end
     addVehicleUprade (theVehicle, 1074)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[4] the return end
     addVehicleUprade (theVehicle, 1075)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[5] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[6] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[7] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[8] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[9] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[10] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[11] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[12] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[13] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[14] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[15] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[16] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[17] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[18] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[19] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[20] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[21] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[22] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[23] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[24] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[25] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[25] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[26] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
end
)

addEventHandler("onClientGUIClick",getRootElement (),
function()
     if source ~=GUIEditor.button[27] the return end
     addVehicleUprade (theVehicle, 1025)
     takePlayerMoney (thePlayer, 1200)
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: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

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 ( theVehicle, seat, jacked ) --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: 3934 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: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

Respekt: 611
Respekt: 611Respekt: 611

Snapig, sprawdz
function remove_felgi ( sourcePlayer, command )
    theVehicle = getPlayerOccupiedVehicle ( sourcePlayer )
    if ( theVehicle ) then
        local upgrade = getVehicleUpgradeOnSlot ( theVehicle, 12 )
        removeVehicleUpgrade ( theVehicle, upgrade )
    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: 3934 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 ( theVehicle, 12 )
        removeVehicleUpgrade ( theVehicle, upgrade )
    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: 4021 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6171

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: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

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 ( pojazd, 12 )
            removeVehicleUpgrade ( pojazd, upgrade )
        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: 3934 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