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

Wysłany: 2014-03-23, 13:22


Erykos1998







Wiek: 30
Na forum: 4574 dni
Posty: 74
Nick w MP: Eryk

Piwa: 3

Respekt: 50

Cze??, ot?? pr?buje co? robi? z tym panelem: http://www.gtaonline.pl/d...ae30ec031e6cc65

Jest to panel PD, czy jest tu mo?liwo?? aby panel by? otwierany dla grupy ACL "PD".
Prosze o pomoc. Dopiero si? ucz?.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-03-23, 14:39


Artysta

Lua, Lua, Czekolada






Wiek: 28
Na forum: 4466 dni
Posty: 240
Nick w MP: Artysta/Koojot

Piwa: 1427

Respekt: 205,8
Respekt: 205,8Respekt: 205,8

Przy funkcji otwierania



Kod:

local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "PD" ) ) then


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-03-23, 15:01


Erykos1998







Wiek: 30
Na forum: 4574 dni
Posty: 74
Nick w MP: Eryk

Piwa: 3

Respekt: 50

Nie widze tego :/
To b?dzie w pd_c czy pd_s.
Pr?bowa?em, wklei?em tamten tw?j kod przed Pd_Window[50] = guiCreateWindow, doda?em na FTP, stworzy?em Grupe/Acl doda?em siebie user.(Nick) i nie dzialal nawet panel.
Prosi?bym o wz?r.
Bo jak jest pd_c:


Kod:

--------------------------------okna
Pd_Window = {}
Pd_Button = {}
Pd_Grid = {}
Pd_Label = {}

Pd_Window[50] = guiCreateWindow(417,86,425,623,"Panel PD by luki123",false)
guiSetVisible(Pd_Window[50], false)
Pd_Label[50] = guiCreateLabel(10,595,405,24,"Panel Pomocy Drogowej by luki123",false,Pd_Window[50])
Pd_Grid[50] = guiCreateGridList(14,24,207,569,false,Pd_Window[50])
Pd_Button[50] = guiCreateButton(234,40,170,50,"Fix",false,Pd_Window[50])
Pd_Button[51] = guiCreateButton(244,510,150,67,"Wyjdz",false,Pd_Window[50])
Pd_Button[52] = guiCreateButton(233,260,178,52,"Dodatki",false,Pd_Window[50])
local kolumna = guiGridListAddColumn(Pd_Grid[50],"Gracze",0.9)

Pd_Window[1] = guiCreateWindow(466,129,369,592,"Dodatki",false)
guiSetVisible(Pd_Window[1], false)
Pd_Button[1] = guiCreateButton(9,61,106,30,"Nitro 2x",false,Pd_Window[1])
Pd_Button[2] = guiCreateButton(128,60,106,34,"Nitro 5x",false,Pd_Window[1])
Pd_Button[3] = guiCreateButton(248,61,105,34,"Nitro 10x",false,Pd_Window[1])
Pd_Label[5] = guiCreateLabel(109,124,141,25,"Hydraulics",false,Pd_Window[1])
Pd_Button[4] = guiCreateButton(68,187,252,39,"1087",false,Pd_Window[1])
Pd_Label[6] = guiCreateLabel(44,236,316,24,"Felgi",false,Pd_Window[1])
Pd_Button[5] = guiCreateButton(12,259,100,34,"Shadow",false,Pd_Window[1])
Pd_Button[6] = guiCreateButton(10,303,104,33,"Mega",false,Pd_Window[1])
Pd_Button[7] = guiCreateButton(9,344,108,37,"Rimshine",false,Pd_Window[1])
Pd_Button[8] = guiCreateButton(9,386,110,33,"Wires",false,Pd_Window[1])
Pd_Button[9] = guiCreateButton(11,428,111,35,"Classic",false,Pd_Window[1])
Pd_Button[10] = guiCreateButton(11,470,111,32,"Twist",false,Pd_Window[1])
Pd_Button[11] = guiCreateButton(11,510,112,31,"Cutter",false,Pd_Window[1])
Pd_Button[12] = guiCreateButton(10,550,111,27,"Switch",false,Pd_Window[1])
Pd_Button[13] = guiCreateButton(249,258,107,34,"Grove",false,Pd_Window[1])
Pd_Button[14] = guiCreateButton(249,307,111,36,"Import",false,Pd_Window[1])
Pd_Button[15] = guiCreateButton(247,350,113,37,"Dollar",false,Pd_Window[1])
Pd_Button[16] = guiCreateButton(244,396,116,28,"Trance",false,Pd_Window[1])
Pd_Button[17] = guiCreateButton(242,439,118,32,"Atomic",false,Pd_Window[1])
Pd_Button[18] = guiCreateButton(241,483,119,35,"Ahab",false,Pd_Window[1])
Pd_Button[19] = guiCreateButton(239,526,121,33,"Virtual",false,Pd_Window[1])
Pd_Button[20] = guiCreateButton(238,564,122,19,"Access",false,Pd_Window[1])
Pd_Button[21] = guiCreateButton(135,262,101,39,"Offroad",false,Pd_Window[1])
Pd_Button[22] = guiCreateButton(144,450,67,128,"WYJDZ",false,Pd_Window[1])
--------------------------------/okna
--------------------------------funkcej
bindKey("k", "down",
function ()
if (getPlayerTeam(getLocalPlayer()) == getTeamFromName("P")) then
if (guiGetVisible(Pd_Window[50]) == false) then
showCursor(true)
guiSetVisible(Pd_Window[50], true)
if (kolumna) then
for id, player in ipairs(getElementsByType("player")) do
local row = guiGridListAddRow(Pd_Grid[50])
guiGridListSetItemText(Pd_Grid[50], row, kolumna, getPlayerName(player), false, false)
end
end
else
guiSetVisible(Pd_Window[50], false)
showCursor(false)
guiGridListClear(Pd_Grid[50])
end
end
end)

function all ()
if (source == Pd_Button[52]) then
if (guiGridListGetItemText(Pd_Grid[50], guiGridListGetSelectedItem(Pd_Grid[50]), kolumna) ~= "") then
guiSetAlpha(Pd_Window[50], 0.8)
guiMoveToBack(Pd_Window[50])
guiSetVisible(Pd_Window[1], true)
else
outputChatBox("Najpierw wybierz gracza!", 255, 0, 0, true)
end
end
end
addEventHandler("onClientGUIClick", Pd_Button[52], all)


function wyjdz ()
if (source == Pd_Button[51]) then
guiSetVisible(Pd_Window[50], false)
showCursor(false)
guiGridListClear(Pd_Grid[50])
end
end
addEventHandler("onClientGUIClick", Pd_Button[51], wyjdz)

function wyjdz1 ()
if (source == Pd_Button[22]) then
guiSetVisible(Pd_Window[1], false)
showCursor(false)
end
end
addEventHandler("onClientGUIClick", Pd_Button[22], wyjdz1)

function fix()
local player = guiGridListGetItemText (Pd_Grid[50], guiGridListGetSelectedItem (Pd_Grid[50]), 1)
triggerServerEvent("fix", getRootElement(), player, getLocalPlayer())
end
addEventHandler( "onClientGUIClick", Pd_Button[50], fix )

addEventHandler ("onClientGUIClick", getRootElement(),

function(button, state, absoluteX, absoluteY)

if ( source == Pd_Button[1] ) then
triggerServerEvent("1010",getLocalPlayer())
elseif ( source == Pd_Button[2] ) then
triggerServerEvent("1009",getLocalPlayer())
elseif ( source == Pd_Button[3] ) then
triggerServerEvent("1008",getLocalPlayer())
elseif ( source == Pd_Button[4] ) then
triggerServerEvent("1087",getLocalPlayer())
elseif ( source == Pd_Button[5] ) then
triggerServerEvent("1025",getLocalPlayer())
elseif ( source == Pd_Button[6] ) then
triggerServerEvent("1078",getLocalPlayer())
elseif ( source == Pd_Button[7] ) then
triggerServerEvent("1084",getLocalPlayer())
elseif ( source == Pd_Button[8] ) then
triggerServerEvent("1085",getLocalPlayer())
elseif ( source == Pd_Button[9] ) then
triggerServerEvent("1096",getLocalPlayer())
-------
elseif ( source == Pd_Button[10] ) then
triggerServerEvent("1097",getLocalPlayer())
elseif ( source == Pd_Button[11] ) then
triggerServerEvent("1079",getLocalPlayer())
elseif ( source == Pd_Button[12] ) then
triggerServerEvent("1073",getLocalPlayer())
elseif ( source == Pd_Button[13] ) then
triggerServerEvent("1080",getLocalPlayer())
elseif ( source == Pd_Button[14] ) then
triggerServerEvent("1074",getLocalPlayer())
elseif ( source == Pd_Button[15] ) then
triggerServerEvent("1081",getLocalPlayer())
elseif ( source == Pd_Button[16] ) then
triggerServerEvent("1075",getLocalPlayer())
elseif ( source == Pd_Button[17] ) then
triggerServerEvent("1082",getLocalPlayer())
---
elseif ( source == Pd_Button[18] ) then
triggerServerEvent("1076",getLocalPlayer())
elseif ( source == Pd_Button[19] ) then
triggerServerEvent("1098",getLocalPlayer())
elseif ( source == Pd_Button[20] ) then
triggerServerEvent("1077",getLocalPlayer())
elseif ( source == Pd_Button[21] ) then
triggerServerEvent("1083",getLocalPlayer())
end
end
)
--------------------------------/funkcje


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-03-23, 18:45


Vike4562

LUA <3






Wiek: 28
Na forum: 4937 dni
Posty: 144
Nick w MP: Vike4562

Piwa: 32

Respekt: 61

To co poda? ci Artysta, daj do "pd_s", u?yj triggerClientEvent

Kod:

function prawa()
local accName = getAccountName ( getPlayerAccount ( thePlayer ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "PD" ) ) then
triggerClientEvent("PrawaOK", getRootElement())
else
outputChatBox("Brak praw pomocy drogowej", source, 0, 255, 0)
end
end


i w Client

Kod:

function prawaok()
guiSetVisible(Pd_Window[50], true)
end
addEvent("PrawaOK", true)
addEventHandler("PrawaOK", getRootElement(), prawaok)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-03-23, 18:55


Erykos1998







Wiek: 30
Na forum: 4574 dni
Posty: 74
Nick w MP: Eryk

Piwa: 3

Respekt: 50

Nwm co sie dzieje, ale teraz panel jest dost?pny dla wszystkich ... :/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-03-23, 19:00


Vike4562

LUA <3






Wiek: 28
Na forum: 4937 dni
Posty: 144
Nick w MP: Vike4562

Piwa: 32

Respekt: 61

Kod:

function prawa(source)
local accName = getAccountName ( getPlayerAccount ( source ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "PD" ) ) then
triggerClientEvent("PrawaOK", getRootElement())
else
outputChatBox("Brak praw pomocy drogowej", source, 0, 255, 0)
end
end
addCommandHandler("panelpd", prawa)


Je?eli nie b?dzie dzia?a? to prawdo podobnie masz co? ?le w acl.xml lub ja nie widz? b??du w kodzie wy?ej :P

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-03-23, 19:08


Erykos1998







Wiek: 30
Na forum: 4574 dni
Posty: 74
Nick w MP: Eryk

Piwa: 3

Respekt: 50

Nie dzia?a. Czyli co? w ACL:
Nie widze b??du:
http://wklej.to/da1nN

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-03-23, 19:16


Vike4562

LUA <3






Wiek: 28
Na forum: 4937 dni
Posty: 144
Nick w MP: Vike4562

Piwa: 32

Respekt: 61

Grupie PD daj takie same prawa jak Default, je?eli dalej nie b?dzie dzia?a? to nie wiem o co chodzi :/

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-03-23, 19:22


Erykos1998







Wiek: 30
Na forum: 4574 dni
Posty: 74
Nick w MP: Eryk

Piwa: 3

Respekt: 50

Jest co? takiego, ?e w?aczam panel, a na czacie wyskakuje Brak praw do pomocy drogowej. Ale panel dziala.
Jak by? m?g? to we? skrypt i wpisz do skrypt?w wszystko jak nale?y i mi podasz link do skrypt?w i zobaczymy. Mo?e zadzia?a.

[ Dodano: 2014-03-23, 19:33 ]
http://hostuje.net/file.p...cf27ef43e3c4ec2

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-03-23, 19:55


Vike4562

LUA <3






Wiek: 28
Na forum: 4937 dni
Posty: 144
Nick w MP: Vike4562

Piwa: 32

Respekt: 61

Ca?ego skryptu nie chce mi si? wrzuca? na Hosting wi?c dam ci tutaj kod

w Server dodaj

Kod:

function prawapd(source)
local accName = getAccountName ( getPlayerAccount ( source ) )
if isObjectInACLGroup ("user."..accName, aclGetGroup ( "PomocDrogowa" ) ) then
triggerClientEvent("PrawaOK", getRootElement())
else
outputChatBox("Brak praw pomocy drogowej", source, 255, 0, 0)
end
end
addCommandHandler("pdpanel", prawapd)


w client podmie? funkcje

Kod:

bindKey("k", "down",
function ()
if (getPlayerTeam(getLocalPlayer()) == getTeamFromName("P")) then
if (guiGetVisible(Pd_Window[50]) == false) then
showCursor(true)
guiSetVisible(Pd_Window[50], true)
if (kolumna) then
for id, player in ipairs(getElementsByType("player")) do
local row = guiGridListAddRow(Pd_Grid[50])
guiGridListSetItemText(Pd_Grid[50], row, kolumna, getPlayerName(player), false, false)
end
end
else
guiSetVisible(Pd_Window[50], false)
showCursor(false)
guiGridListClear(Pd_Grid[50])
end
end
end)


na

Kod:

function openpanel()
if (kolumna) then
for id, player in ipairs(getElementsByType("player")) do
local row = guiGridListAddRow(Pd_Grid[50])
guiGridListSetItemText(Pd_Grid[50], row, kolumna, getPlayerName(player), false, false)
guiSetVisible(Pd_Window[50], true)
showCursor(true)
end
end
end
addEvent("PrawaOK", true)
addEventHandler("PrawaOK", getRootElement(), openpanel)


Licz? na :piwo: xD

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-03-23, 20:24


Erykos1998







Wiek: 30
Na forum: 4574 dni
Posty: 74
Nick w MP: Eryk

Piwa: 3

Respekt: 50

Nwm co jest. A na jaki klawisz otwiera si? teraz ?. Bo kaza?e? podmieni? bindKey na co innego i nie widze tam klawisza.
A i teraz doda? do ACL grupe: PomocDrogowa
Potem dodaje sb do grupy: user.(Nick)
Ale nie dzia?a mi to.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-03-23, 20:32


Vike4562

LUA <3






Wiek: 28
Na forum: 4937 dni
Posty: 144
Nick w MP: Vike4562

Piwa: 32

Respekt: 61

Panel otwiera si? na komend? "pdpanel", po stronie serwera mo?esz zmieni? z "PomocDrogowa" na "PD" i ?eby mie? prawa musisz wpisa? "user.login" nie nick :P

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-03-23, 20:43


Erykos1998







Wiek: 30
Na forum: 4574 dni
Posty: 74
Nick w MP: Eryk

Piwa: 3

Respekt: 50

Jeste? mistrz.
Pifffka lec?. Dzi?ki za prace, my?la?em ?e ju? przy 2 po?cie si? poddasz. Dzia?a super. PIWKA LEC?. DZI?KUJE JESZCZE RAZ.

[ Dodano: 2014-03-23, 20:45 ]
Aaa a jest mo?liwo?? zmiany na bind np. F6 ?. Chodzi mi o BindKey

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-03-23, 21:03


Vike4562

LUA <3






Wiek: 28
Na forum: 4937 dni
Posty: 144
Nick w MP: Vike4562

Piwa: 32

Respekt: 61

Po prostu, zamiast addCommandHandler w pd_s daj BindKey("P", "down", openpanel)

Zamiast P mo?esz da? se jaki chcesz przycisk

"down" - oznacza ?e ja przyci?niesz przycisk to funkcja si? uruchomi
a jak zmienisz na "up" to funkcja si? uruchomi gdy pu?cisz przycisk

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-03-23, 21:24


Erykos1998







Wiek: 30
Na forum: 4574 dni
Posty: 74
Nick w MP: Eryk

Piwa: 3

Respekt: 50

Czyli zamieniam to: addCommandHandler("pdpanel", prawapd)

za to

BindKey("P", "down", openpanel)

Je?eli tak to nie dzia?a :D

Postaw piwo autorowi tego posta
 

 
Tagi: panel :: pod :: acl.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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