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

Wysłany: 2015-07-26, 16:11


vicuuus







Wiek: 26
Na forum: 4147 dni
Posty: 63

Piwa: 11

Respekt: 70,3

Cze?? mam skrypt wybiera?ki skin?w i team?w ale on nie dzia?a co tu jest nie tak prosz? o pomoc
C-side:
GUI = stworz GUI
btn_grove_s = stworz button
btn_ballas = stworz button
guiSetVisible(GUI, false)

function showGui()
    guiSetVisible(GUI, true)
    showCursor(true)
end
addEvent("showGUI", true)
addEventHandler("showGUI", resourceRoot, showGui)

function hideGUI()
    guiSetVisible(GUI, false)
    showCursor(false)
end
addEvent("hideGUI", true)
addEventHandler("hideGUI", resourceRoot, hideGUI)

addEventHandler("onClientGUIClick", root, function(btn)
    if btn == "left" then
        if source == btn_grove_s then
            triggerServerEvent("groveS", localPlayer)
        elseif source == btn_ballas then
            triggerServerEvent("ballas", localPlayer)
        end
    end
return true
end)

S-side:
addEventHandler("onPlayerJoin", getRootElement(), function()
    outputChatBox("Wybierz kim chcesz zostac", source)
    triggerClientEvent(source, "showGUI", source)
end)


function wyb()
    spawnPlayer(source, 2528.3483886719, -1667.2764892578, 15.168592453003)
    setElementModel(source, 105, 106, 107) -- grove
    givePlayerWeapon(source, 28, 600)
end
addEvent("groveS", true)
addEventHandler("groveS", resourceRoot, wyb)


function wyb2()
    spawnPlayer(source, 1902.2567138672, -1118.0632324219, 25.664100646973)
    setElementModel(source, 102, 103, 104) -- ballas 
    givePlayerWeapon(source, 30, 200)
end
addEvent("ballas", true)
addEventHandler("ballas", resourceRoot, wyb2)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-26, 20:58


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%

GUI = stworz GUI
btn_grove_s = stworz button
btn_ballas = stworz button


Eeem a to to co to jest ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-26, 21:49


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4980 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

To jest jego GUI, kt?re wstawia tu ju? drugi raz, a ja mu w 1-szym temacie odpowiedzia?em, ?e si? tak GUI nie tworzy.

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-27, 15:32


vicuuus







Wiek: 26
Na forum: 4147 dni
Posty: 63

Piwa: 11

Respekt: 70,3

W takim razie jak zrobi? odpowiednie GUI!? Pom??cie

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-27, 15:46


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
"WiilkU" napisał/a:

W takim razie jak zrobi? odpowiednie GUI!? Pom??cie



Więcej informacji znajdziesz w Wikipedii MTA:

guiCreateWindow


Więcej informacji znajdziesz w Wikipedii MTA:

guiCreateButton


Jak to ogarniesz, odezwij si?, bo widz?, ?e b?dzie ci??ko cokolwiek wyt?umaczy? z jakim? pozytywnym skutkiem.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-28, 10:43


vicuuus







Wiek: 26
Na forum: 4147 dni
Posty: 63

Piwa: 11

Respekt: 70,3

 spawnScreenMenu = guiCreateWindow ( 0.15, 0.33, 0.7, 0.34, "Wybierz kim chcesz zosta?", true )

 spawnScreenButton = guiCreateButton ( 0.4, 0.85, 0.20, 0.15, "ballas", true, spawnScreenMenu )

O to chodzi?o? Je?li nie prosz? o pomoc jestem w tym zielony :(

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-29, 12:39


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
Tak, o to chodzi?o :)

Tylko dok?adnie u?yj juz poprzednich zmiennych, zebys nie mial kolejnych problemow z skryptem


GUI = guiCreateWindow ( 0.15, 0.33, 0.7, 0.34, "Wybierz kim chcesz zosta?", true )
btn_grove_s = musisz dorobi? jeszcze 1 przycisk na tej samej zasadzie co poni?szy
btn_ballas = guiCreateButton ( 0.4, 0.85, 0.20, 0.15, "ballas", true, GUI )



PS: Tutaj masz kod bez w odpowiedniej formie, bo widz?, ?e masz tam troszeczk? b??d?w.


Powy?szy kod spawnuje w tym miejscu co ustali?e?, z jednym z 3 losowych skinow ( te co chciales ustawic)





Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-29, 16:30


vicuuus







Wiek: 26
Na forum: 4147 dni
Posty: 63

Piwa: 11

Respekt: 70,3

Hmm, nadal co? jest nie tak :/ Zrobi?em 2 button i jak w??czam skrypt to nic si? nie dzieje tylko na czacie wy?wietla si? "Wybierz kim chcesz zosta?"

C-side:
GUI = guiCreateWindow ( 0.15, 0.33, 0.7, 0.34, "Wybierz kim chcesz zosta?", true )
btn_grove_s = guiCreateButton ( 0.8, 0.78, 0.28, 0.18, "grove_s", true, GUI )
btn_ballas = guiCreateButton ( 0.4, 0.85, 0.20, 0.15, "ballas", true, GUI )
guiSetVisible(GUI, false)

function showGui()
    guiSetVisible(GUI, true)
    showCursor(true)
end
addEvent("showGUI", true)
addEventHandler("showGUI", resourceRoot, showGui)

function hideGUI()
    guiSetVisible(GUI, false)
    showCursor(false)
end
addEvent("hideGUI", true)
addEventHandler("hideGUI", resourceRoot, hideGUI)

addEventHandler("onClientGUIClick", root, function(btn)
    if btn == "left" then
        if source == btn_grove_s then
            triggerServerEvent("groveS", localPlayer)
            hideGUI()
        elseif source == btn_ballas then
            triggerServerEvent("ballas", localPlayer)
            hideGUI()
        end
    end
return true
end)

S-side:
addEventHandler("onPlayerJoin", getRootElement(), function()
    outputChatBox("Wybierz kim chcesz zostac", source)
    triggerClientEvent(source, "showGUI", source)
end)


function wyb()
     random = math.random(1,3)
    if random == 1 then skin = 105
    elseif random == 2 then skin = 106
    elseif random == 3 then skin = 107 end
    spawnPlayer(source, 2528.3483886719, -1667.2764892578, 15.168592453003, math.random(0,360), skin)
    givePlayerWeapon(source, 28, 600)
end
addEvent("groveS", true)
addEventHandler("groveS", resourceRoot, wyb)


function wyb2()
     random = math.random(1,3)
    if random == 1 then skin = 102
    elseif random == 2 then skin = 103
    elseif random == 3 then skin = 104 end
    spawnPlayer(source, 1902.2567138672, -1118.0632324219, 25.664100646973, math.random(0,360), skin)
    givePlayerWeapon(source, 30, 200)
end
addEvent("ballas", true)
addEventHandler("ballas", resourceRoot, wyb2)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-29, 17:18


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4980 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

Sprobuj w c-side zmieni? w evencie showGUI : resourceRoot na root

Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-07-29, 19:15


vicuuus







Wiek: 26
Na forum: 4147 dni
Posty: 63

Piwa: 11

Respekt: 70,3

Nic nie da?o :c

Postaw piwo autorowi tego posta
 

 
Tagi: skrypt :: nie :: działa
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Skrypt nie działa 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