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

Wysłany: 2015-04-14, 21:51


teusz11







Wiek: 29
Na forum: 4652 dni
Posty: 191
Nick w MP: Matevsz

Piwa: 4

Respekt: 50

Witam, chc? aby pokaza?o si? GUI po wej?ciu w marker, wpisaniu komendy /pokaz oraz gracz musi by? w grupie ACL.

Kod:

marker = createMarker (487.599609375, -0.900390625, 1001.4000244141, "cylinder", 0.60000002)
setElementInterior(marker, 17)
function praca(thePlayer)
PD=createTeam("PD", 214, 121, 22)
local playerName = getAccountName(getPlayerName(thePlayer))
if isObjectInACLGroup("user."..PlayerName,aclGetGroup("PD")) then
if isElementWithinMarker(thePlayer, marker) then
showCursor(true)
guiSetVisible(GUIEditor.window[1], true)
end
end
addCommandHandler("otworz", praca)


Po wej?ciu w marker i wpisaniu komendy gui nie chce si? pokaza?, je?li co? jest ?le to pisa?. Dodam ?e w grze doda?em siebie do grupy PD. [/code]

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-04-15, 06:50


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

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

Ostrzeżeń: 60%
Bodaj?e zabrak?o ci jednego "end"
Masz zakonczenie do warunku na acl, masz tez do markera, tylko nie masz do samej funkcji.
Tak?e spr?buje doda? to "end" i pisz czy dzia?a ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-04-15, 13:53


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4395 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

Wiesz, ?e w LUA istniej? strony c-side i s-side?

Sprawd? u?ycie stron we wszystkich twoich u?ytych funkcjach i zastosuj triggery.

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-04-15, 18:19


teusz11







Wiek: 29
Na forum: 4652 dni
Posty: 191
Nick w MP: Matevsz

Piwa: 4

Respekt: 50

"Shuffle" napisał/a:

Wiesz, ?e w LUA istniej? strony c-side i s-side?

Sprawd? u?ycie stron we wszystkich twoich u?ytych funkcjach i zastosuj triggery.


Tak wiem ?e takie co? instnieje...

S:

Kod:

addEventHandler("onResourceStart", "onMarkerHit", marker, resourceRoot,
function()
for i, player in ipairs(getElementsByType("player")) do
if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(player)), aclGetGroup("DJ")) then
if isElementWithInMarker("player") then
setElementData(player, "Show_GUI", true)
else
setElementData(player, "Show_GUI", nil)
end
end
end
end
)



addEventHandler("onPlayerLogin", root, function(_, acc)
if isObjectInACLGroup("user."..getAccountName(acc), aclGetGroup("DJ")) then
setElementData(source, "Show_GUI", true)
else
setElementData(source, "Show_GUI", nil)
end
end
)
addEventHandler("onPlayerLogout", root, function(_, acc)
tiggerClientEvent(source, "LogOutSetVisible", root)
setElementData(source, "Show_GUI", nil)
end
)



C:


Kod:

GUIEditor = {
button = {},
window = {},
label = {},
memo = {},
}
addEventHandler("onClientResourceStart", resourceRoot,
function()
GUIEditor.window[1] = guiCreateWindow(242, 216, 1224, 670, "DjPanel By Matevsz", false)
guiWindowSetSizable(GUIEditor.window[1], false)

GUIEditor.button[1] = guiCreateButton(22, 39, 360, 32, "Wlacz dym", false, GUIEditor.window[1])
GUIEditor.button[2] = guiCreateButton(23, 93, 359, 34, "Wylacz dym", false, GUIEditor.window[1])
GUIEditor.memo[1] = guiCreateMemo(23, 179, 359, 32, "", false, GUIEditor.window[1])
GUIEditor.label[1] = guiCreateLabel(81, 159, 253, 15, "Wpisz tekst, ktory bedzie pokazany na scianie", false, GUIEditor.window[1])
GUIEditor.browser[1] = guiCreateBrowser(396, 39, 810, 609, "", false, GUIEditor.window[1])
GUIEditor.button[3] = guiCreateButton(13, 624, 108, 34, "Zamknij", false, GUIEditor.window[1])
GUIEditor.button[4] = guiCreateButton(91, 228, 222, 29, "Pokaz tekst", false, GUIEditor.window[1])
local theBrowser = guiGetBrowser(GUIEditor.browser[1])
guiSetVisible(GUIEditor.window[1], false)
end
)
addEventHandler("onClientBrowserCreated", theBrowser,
function()
loadBrowserURL(source, "http://www.youtube.com")
end
)
end
end

function openGUI()
if getElementData(localPlayer, "Show_GUI") ~= nil then
guiSetVisible(GUIEditor.window[1], not guiGetVisible(GUIEditor.window[1]))
showCursor(guiSetVisible(GUIEditor.window[1])
end
end
)


addEventHandler("onClientGUIClick", Zamknij, -- close GUI
function ()
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
end
)

addEvent("LogOutSetVisible", true)
addEventHandler("LogOutSetVisible", root,
function()
if guiGetVisible(GUIEditor.window[1]) then
guiSetVisible(GUIEditor.window[1], false)
showCursor(false)
end
end
)


Nie wiem czy dobrze doda?em wej?cie w marker, je?eli co? ?le to pisa?. ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-04-16, 13:06


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

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

No wi?c tak.. Nie u?y?e? tutaj trigger?w tylko elementDaty ;p

C-Side zr?b tak :

Kod:


function showGui(hitElement, matchingDim)
if he ~= localPlayer then return end
if not matchingDim then return end
if isElementWithinMarker(hitElement, marker)
guiSetVisible(OKNO, TRUE)
showCursor(true)
return true
end
addEvent("pokazGui", true)
addEventHandler("pokazGui", localPlayer, showGui)


s-side
Kod:


-- sprawdzasz ACL, jezeli poprawne to :
triggerClientEvent("pokazGui", localPlayer)
else
wyrzuc blad


Moze byc blad bo nie testowalem, ale to b?dzie co? w ten dese?.

Postaw piwo autorowi tego posta
 

 
Tagi: showgui :: wejściu :: marker
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » ShowGUI po wejściu w marker 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