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: 25
Na forum: 4006 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(GUIfalse)

function showGui()
    guiSetVisible(GUItrue)
    showCursor(true)
end
addEvent("showGUI"true)
addEventHandler("showGUI"resourceRootshowGui)

function hideGUI()
    guiSetVisible(GUIfalse)
    showCursor(false)
end
addEvent("hideGUI"true)
addEventHandler("hideGUI"resourceRoothideGUI)

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(source2528.3483886719, -1667.276489257815.168592453003)
    setElementModel(source105106107) -- grove
    givePlayerWeapon(source28600)
end
addEvent("groveS"true)
addEventHandler("groveS"resourceRootwyb)


function wyb2()
    spawnPlayer(source1902.2567138672, -1118.063232421925.664100646973)
    setElementModel(source102103104) -- ballas 
    givePlayerWeapon(source30200)
end
addEvent("ballas"true)
addEventHandler("ballas"resourceRootwyb2)


Postaw piwo autorowi tego posta
 

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


#404







Wiek: 26
Na forum: 4771 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: 4838 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: 25
Na forum: 4006 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: 26
Na forum: 4771 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: 25
Na forum: 4006 dni
Posty: 63

Piwa: 11

Respekt: 70,3

 spawnScreenMenu guiCreateWindow 0.150.330.70.34"Wybierz kim chcesz zosta?"true )

 spawnScreenButton guiCreateButton 0.40.850.200.15"ballas"truespawnScreenMenu )

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: 26
Na forum: 4771 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.150.330.70.34"Wybierz kim chcesz zosta?"true )
btn_grove_s musisz dorobijeszcze 1 przycisk na tej samej zasadzie co poni?szy
btn_ballas guiCreateButton 0.40.850.200.15"ballas"trueGUI )



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: 25
Na forum: 4006 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.150.330.70.34"Wybierz kim chcesz zosta?"true )
btn_grove_s guiCreateButton 0.80.780.280.18"grove_s"trueGUI )
btn_ballas guiCreateButton 0.40.850.200.15"ballas"trueGUI )
guiSetVisible(GUIfalse)

function showGui()
    guiSetVisible(GUItrue)
    showCursor(true)
end
addEvent("showGUI"true)
addEventHandler("showGUI"resourceRootshowGui)

function hideGUI()
    guiSetVisible(GUIfalse)
    showCursor(false)
end
addEvent("hideGUI"true)
addEventHandler("hideGUI"resourceRoothideGUI)

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(source2528.3483886719, -1667.276489257815.168592453003math.random(0,360), skin)
    givePlayerWeapon(source28600)
end
addEvent("groveS"true)
addEventHandler("groveS"resourceRootwyb)


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(source1902.2567138672, -1118.063232421925.664100646973math.random(0,360), skin)
    givePlayerWeapon(source30200)
end
addEvent("ballas"true)
addEventHandler("ballas"resourceRootwyb2)


Postaw piwo autorowi tego posta
 

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


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 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: 25
Na forum: 4006 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