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
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
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.
--CSIDE
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 )
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)
--SSIDE
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)
Powy?szy kod spawnuje w tym miejscu co ustali?e?, z jednym z 3 losowych skinow ( te co chciales ustawic)
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)
Sprobuj w c-side zmieni? w evencie showGUI : resourceRoot na root
Podpis
Jedyny kontakt ze mną to PW forum
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
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