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

Wysłany: 2012-09-28, 11:44


vipSEBOvip

A poor begginer






Wiek: 26
Na forum: 5178 dni
Posty: 597
Nick w MP: xSebaPL

Piwa: 77

Respekt: 140
Respekt: 140

ta funkcja nie dzia?a, nie tworz? si? przyciski

local teamPanel guiCreateWindow 0.250.050.50.9"Panel Team'ow by SEBO"true )
local teamList guiCreateGridList 1030600400falseteamPanel )
stworz guiCreateButton 6503040100"Stworz Team"falseteamPanel )
usun guiCreateButton 65014040100"Usun Team"falseteamPanel )
wyjdz guiCreateButton 65025040100"Wyjdz"falseteamPanel )
guiSetVisible(teamPaneltrue)
showCursor(false)


[ Dodano: 2012-09-28, 11:52 ]
wyskakuje takie co?:


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-28, 13:32


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

vipSEBOvip, podaj ca?y kod

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-28, 13:35


vipSEBOvip

A poor begginer






Wiek: 26
Na forum: 5178 dni
Posty: 597
Nick w MP: xSebaPL

Piwa: 77

Respekt: 140
Respekt: 140

jest ca?y kod

local teamPanel guiCreateWindow 0.250.050.50.9"Panel Team'ow by SEBO"true )
local teamList guiCreateGridList 1030600400falseteamPanel )
stworz guiCreateButton 6503040100"Stworz Team"falseteamPanel )
usun guiCreateButton 65014040100"Usun Team"falseteamPanel )
wyjdz guiCreateButton 65025040100"Wyjdz"falseteamPanel )
guiSetVisible(teamPaneltrue)
showCursor(false)

function open()
    local teamGroupInList guiGridListAddColumnteamList"Team"0.9 )
    if ( teamGroupInList then
        for idteamitem in ipairs(getElementsByType("team")) do 
            local row guiGridListAddRow teamList )
            guiGridListSetItemText teamListrowteamGroupInListgetTeamName teamitem ), falsefalse )
        end
    end
    guiSetVisible(teamPaneltrue)
    showCursor(false)
end

function close ()
    guiSetVisible(teamPanelfalse)
    showCursor(false)
end

addCommandHandler "open"open )
addCommandHandler "close"close )


jak by co ja najpierw pr?buje zrobi? wygl?d panelu, a potem dostosowa? odpowiednie funkcje do klawiszy.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-28, 13:50


Piorun







Wiek: 32
Na forum: 6712 dni
Posty: 1837
Nick w MP: Piorun

Piwa: 516

Respekt: 480,7
Respekt: 480,7

Walnij "local" przed ka?d? zmienn?, kt?ra zapisuje element GUI (czyli przed "stworz", "usun", "wyjdz").

I jest taka stara, niepisana zasada:
Je?eli co? nie dzia?a jak nale?y, a bladego poj?cia nie masz co jest ?le to usuwaj (lub przekopiuj w neutralne miejsce) kolejno dodawane kody i co jakie? par? usuni?tych linijek kodu od?wie?aj skrypt do momentu a? wszystko b?dzie ?miga?.

Hmm .. i druga rzecz:
Wpisz "/debugscript 3", od?wie? skrypt/u?yj komendy w kt?rej spodziewasz si? b??du i je?eli nie rozumiesz o co chodzi - wklej zdj?cie z b??dami tutaj lub na inne forum po?wi?cone MTA.

Podpis
Możesz mnie znaleźć na: Facebook
Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-28, 14:27


vipSEBOvip

A poor begginer






Wiek: 26
Na forum: 5178 dni
Posty: 597
Nick w MP: xSebaPL

Piwa: 77

Respekt: 140
Respekt: 140

Piorun ta zasada pomog?a, a co do tego z tym /debugscript 3, nic w nim nie pokazuje, mam go ca?y czas w??czonego

[ Dodano: 2012-09-28, 15:03 ]
Piorun, a znasz jak?? funkcje na usuwanie team'u??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-28, 15:27


Riot

3X






Wiek: 29
Na forum: 5729 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

"vipSEBOvip" napisał/a:

Piorun, a znasz jak?? funkcje na usuwanie team'u??


Piorun to ja nie jestem ale postaram si? pom?c. Jak przypiszesz jak?? zmienn? do teamu, czyli np.

team createTeam("Gracze"255255200)


To wed?ug mnie zadzia?a funkcja destroyElement. Przyk?ad:

team createTeam("Gracze"255255200)

function usun()
destroyElement(team)
end
setTimer(usun50001)


Kod powinien tworzy? skrypt, a po 5 sekundach go usuwa?. Stestuj czy dzia?a.


Co do GUI najlepiej robi? je sobie w guieditorze lub innym programie, mamy pewno?? ?e co? dzia?a.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-28, 19:44


Jacob

Głupiomądry






Wiek: 28
Na forum: 5502 dni
Posty: 967
Nick w MP: Jacob

Piwa: 786

Respekt: 212,3
Respekt: 212,3Respekt: 212,3

Lub je?li masz
team createTeam("Gracze"255255200)

to mo?esz w funkcji usuwaj?cej team zrobi? po prostu tak
team ""


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-28, 21:25


vipSEBOvip

A poor begginer






Wiek: 26
Na forum: 5178 dni
Posty: 597
Nick w MP: xSebaPL

Piwa: 77

Respekt: 140
Respekt: 140

dobra a co z dodawaniem, zrobi?em takie co?:

prze?o?enie z clienta do servera

function stworz()
    local nazwa guiGetText(tekstNazwa)
    local red guiGetText(tekstR)
    local green guiGetText(tekstG)
    local blue guiGetText(tekstB)
    if nazwa and red and green and blue then
        triggerServerEvent("teamDane"getRootElement(), nazwaredgreenblue )
    else
        outputChatBox "Podaj Nazwe i Kody Koloru Team'u"source )    
    end
end


a tu jest server

addEvent("teamDane"true )
addEventHandler("teamDane"getRootElement(),
function()
    local daneTeam xmlCreateFile "team_xml.xml""<team name=" .. nazwa .. " colorR=" .. red .. " colorG=" .. green .. " colorB=" .. blue .. "></team>" )
    xmlSaveFile(daneTeam)
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-28, 21:44


Jacob

Głupiomądry






Wiek: 28
Na forum: 5502 dni
Posty: 967
Nick w MP: Jacob

Piwa: 786

Respekt: 212,3
Respekt: 212,3Respekt: 212,3

vipSEBOvip, b??dy?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-29, 12:06


vipSEBOvip

A poor begginer






Wiek: 26
Na forum: 5178 dni
Posty: 597
Nick w MP: xSebaPL

Piwa: 77

Respekt: 140
Respekt: 140

o no tak, zapomnia?em :)
[code]
start: Reguested by Console
Resource 'Team' changed, reloading and starting
Starting Team
SCRIPT ERROR: [gameplay]\Team\team_server.lua:12: '>' expected <to close '<' at line 8 near '<eof>'
WARNING: Loading script failed: [gameplay]\Team\team_server.lua:12: '>' expected <to close '<' at line 8 near '<eof>'
ERROR: Couldn't parse config team_xml.xml in Team
Failed to start resource item team_xml.xml in Team
start: Resource 'Team' start was requested <Failed to start resource item team_xml.xml which is required

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-29, 16:12


Jacob

Głupiomądry






Wiek: 28
Na forum: 5502 dni
Posty: 967
Nick w MP: Jacob

Piwa: 786

Respekt: 212,3
Respekt: 212,3Respekt: 212,3

vipSEBOvip,
addEvent("teamDane"true )
addEventHandler("teamDane"getRootElement(),
function()
    local daneTeam xmlCreateFile "team_xml.xml""<team name=" .. nazwa .. " colorR=" .. red .. " colorG=" .. green .. " colorB=" .. blue .. "></team>" )
    xmlSaveFile(daneTeam)
end

Nie zako?czy?e? addEventHandler.
Kt?ra to 12 linijka server-side?
Poka? mete.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2012-09-29, 17:50


vipSEBOvip

A poor begginer






Wiek: 26
Na forum: 5178 dni
Posty: 597
Nick w MP: xSebaPL

Piwa: 77

Respekt: 140
Respekt: 140

o to meta.xml
Kod:


<meta>
<info name="Team's by SEBO" author="SEBO" type="script" version="1.0"></info>
<script src="team_client.lua" type="client"></script>
<script src="team_server.lua" type="server"></script>
<config src="team_xml.xml"></config>
</meta>


Postaw piwo autorowi tego posta
 

 
Tagi: guicreatebutton :: 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 » guiCreateButton 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