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

Wysłany: 2014-01-30, 23:43


zuraw13







Wiek: 27
Na forum: 5073 dni
Posty: 95
Nick w MP: zuraw113

Piwa: 191

Respekt: 50

Dzi?ki dzia?a. Zrobi?em ca?y kod po stronie klienta,jak i serwera.
Jak teraz doda? gui do tego? Kod gui w pierwszym po?cie.

A i jak doda? opcje teleportacji z pojazdem lub wyskakuj?cy tekst na chacie o wysiadni?ciu z pojazdu? Mo?e to tak by? po stronie serwera:
local vehicle getPedOccupiedVehicle(playerSource)
function greetingontpls posXposYposZplayer )
       if vehicle then
    setElementPosition playerposXposYposZ )
       else
    setElementPosition vehicleposXposYposZ )
end
addEvent"ontpls"true )
addEventHandler"ontpls"rootgreetingontpls )


Kod:
- strona klienta:
local player getLocalPlayer()

-- POZYCJA LS
local lsposX 2500.5952
local lsposY = -1669.4454
local lsposZ 13.3532
-- POZYCJA LV
local lvposX 2140.8190
local lvposY 986.2273
local lvposZ 10.8203
-- POZYCJA SF
local sfposX = -2041.2288
local sfposY 136.2675
local sfposZ 28.8359
-- POZYCJA LSLOT
local lslotposX 1945.4160
local lslotposY = -2305.6423
local lslotposZ 15.0583
-- POZYCJA SALONSF
local salonsfposX = -1642.9013671875
local salonsfposY 1203.9830322266
local salonsfposZ 7.25
-- POZYCJA PUSTYNIA
local pustyniaposX 428.4866
local pustyniaposY 2533.7695
local pustyniaposZ 16.5045
-- POZYCJA WYSPA
local wyspaposX 776.6111
local wyspaposY = -2834.7358
local wyspaposZ 4.2433
-- POZYCJA TAMA
local tamaposX = -924.3400
local tamaposY 2019.7234
local tamaposZ 60.9141
-- POZYCJA MOLO
local moloposX 836.2119
local moloposY = -2057.7136
local moloposZ 12.8671
-- POZYCJA BAGNO
local bagnoposX = -841.3732
local bagnoposY = -1940.7094
local bagnoposZ 12.5643
-- POZYCJA PORT
local portposX 2294.0693
local portposY 558.9081
local portposZ 7.7813
-- POZYCJA CHILLIAD
local chilliadposX = -2301.9609
local chilliadposY = -1648.8076
local chilliadposZ 483.6195
-- POZYCJA DRAG
local dragposX 2041.7806
local dragposY 856.4257
local dragposZ 790.5769
-- POZYCJA WYSKOK
local wyskokposX 2071.7295
local wyskokposY 284.0156
local wyskokposZ 403.1366
-- POZYCJA TOR
local torposX 2160.7292480469
local torposY = -4034.1831054688
local torposZ 5.2526798248291

--LS
function tpls commandName )
        triggerServerEvent "texttpls"getRootElement(), "Witamy w Los Santos!"player ) 
        triggerServerEvent "ontpls"getRootElement(), lsposXlsposYlsposZplayer )
end
addCommandHandler "ls"tpls )
--LV
function tplv commandName )
        triggerServerEvent "texttplv"getRootElement(), "Witamy w Las Venturas!"player ) 
        triggerServerEvent "ontplv"getRootElement(), lvposXlvposYlvposZplayer )
end
addCommandHandler "lv"tplv )
--SF
function tpsf commandName )
        triggerServerEvent "texttpsf"getRootElement(), "Witamy w San Fierro!"player ) 
        triggerServerEvent "ontpsf"getRootElement(), sfposXsfposYsfposZplayer )
end
addCommandHandler "sf"tpsf )
--LSLOT
function tplslot commandName )
        triggerServerEvent "texttplslot"getRootElement(), "Witamy na Lotnisku w Los Santos!"player ) 
        triggerServerEvent "ontplslot"getRootElement(), lslotposXlslotposYlslotposZplayer )
end
addCommandHandler "lslot"tplslot )
--SALONSF
function tpsalonsf commandName )
        triggerServerEvent "texttpsalonsf"getRootElement(), "Witamy przed Salonem w San Fierro!"player ) 
        triggerServerEvent "ontpsalonsf"getRootElement(), salonsfposXsalonsfposYsalonsfposZplayer )
end
addCommandHandler "salonsf"tpsalonsf )
--PUSTYNIA
function tppustynia commandName )
        triggerServerEvent "texttppustynia"getRootElement(), "Witamy na Pustyni!"player ) 
        triggerServerEvent "ontppustynia"getRootElement(), pustyniaposXpustyniaposYpustyniaposZplayer )
end
addCommandHandler "pustynia"tppustynia )
--WYSPA
function tpwyspa commandName )
        triggerServerEvent "texttpwyspa"getRootElement(), "Witamy na Wyspie!"player ) 
        triggerServerEvent "ontpwyspa"getRootElement(), wyspaposXwyspaposYwyspaposZplayer )
end
addCommandHandler "wyspa"tpwyspa )
--TAMA
function tptama commandName )
        triggerServerEvent "texttptama"getRootElement(), "Witamy na Tamie!"player ) 
        triggerServerEvent "ontptama"getRootElement(), tamaposXtamaposYtamaposZplayer )
end
addCommandHandler "tama"tptama )
--MOLO
function tpmolo commandName )
        triggerServerEvent "texttpmolo"getRootElement(), "Witamy na Molo!"player ) 
        triggerServerEvent "ontpmolo"getRootElement(), moloposXmoloposYmoloposZplayer )
end
addCommandHandler "molo"tpmolo )
--BAGNO
function tpbagno commandName )
        triggerServerEvent "texttpbagno"getRootElement(), "Witamy na Bagnach!"player ) 
        triggerServerEvent "ontpbagno"getRootElement(), bagnoposXbagnoposYbagnoposZplayer )
end
addCommandHandler "bagno"tpbagno )
--PORT
function tpport commandName )
        triggerServerEvent "texttpport"getRootElement(), "Witamy w Porcie!"player ) 
        triggerServerEvent "ontpport"getRootElement(), portposXportposYportposZplayer )
end
addCommandHandler "port"tpport )
--CHILLIAD
function tpchilliad commandName )
        triggerServerEvent "texttpchilliad"getRootElement(), "Witamy na G?rze Chilliad!"player ) 
        triggerServerEvent "ontpchilliad"getRootElement(), chilliadposXchilliadposYchilliadposZplayer )
end
addCommandHandler "chilliad"tpchilliad )
addCommandHandler "gora"tpchilliad )
--DRAG
function tpdrag commandName )
        triggerServerEvent "texttpdrag"getRootElement(), "Witamy na Dragu!"player ) 
        triggerServerEvent "ontpdrag"getRootElement(), dragposXdragposYdragposZplayer )
end
addCommandHandler "drag"tpdrag )
--WYSKOK
function tpwyskok commandName )
        triggerServerEvent "texttpwyskok"getRootElement(), "Witamy na Wyskoku!"player ) 
        triggerServerEvent "ontpwyskok"getRootElement(), wyskokposXwyskokposYwyskokposZplayer )
end
addCommandHandler "wyskok"tpwyskok )
--TOR
function tptor commandName )
        triggerServerEvent "texttptor"getRootElement(), "Witamy na Torze!"player ) 
        triggerServerEvent "ontptor"getRootElement(), torposXtorposYtorposZplayer )
end
addCommandHandler "tor"tptor )


- strona serwera:
--LS
function greetingtextls messageplayer )
    outputChatBox messageplayer )
end
addEvent"texttpls"true )
addEventHandler"texttpls"rootgreetingtextls )

function greetingontpls posXposYposZplayer )
    setElementPosition playerposXposYposZ )
end
addEvent"ontpls"true )
addEventHandler"ontpls"rootgreetingontpls )
--LV
function greetingtextlv messageplayer )
    outputChatBox messageplayer )
end
addEvent"texttplv"true )
addEventHandler"texttplv"rootgreetingtextlv )

function greetingontplv posXposYposZplayer )
    setElementPosition playerposXposYposZ )
end
addEvent"ontplv"true )
addEventHandler"ontplv"rootgreetingontplv )
--SF
function greetingtextsf messageplayer )
    outputChatBox messageplayer )
end
addEvent"texttpsf"true )
addEventHandler"texttpsf"rootgreetingtextsf )

function greetingontpsf posXposYposZplayer )
    setElementPosition playerposXposYposZ )
end
addEvent"ontpsf"true )
addEventHandler"ontpsf"rootgreetingontpsf )    
--LSLOT 
function greetingtextlslot messageplayer )
    outputChatBox messageplayer )
end
addEvent"texttplslot"true )
addEventHandler"texttplslot"rootgreetingtextlslot )

function greetingontplslot posXposYposZplayer )
    setElementPosition playerposXposYposZ )
end
addEvent"ontplslot"true )
addEventHandler"ontplslot"rootgreetingontplslot )    
--SALONSF
function greetingtextsalonsf messageplayer )
    outputChatBox messageplayer )
end
addEvent"texttpsalonsf"true )
addEventHandler"texttpsalonsf"rootgreetingtextsalonsf )

function greetingontpsalonsf posXposYposZplayer )
    setElementPosition playerposXposYposZ )
end
addEvent"ontpsalonsf"true )
addEventHandler"ontpsalonsf"rootgreetingontpsalonsf )    
--PUSTYNIA 
function greetingtextpustynia messageplayer )
    outputChatBox messageplayer )
end
addEvent"texttppustynia"true )
addEventHandler"texttppustynia"rootgreetingtextpustynia )

function greetingontppustynia posXposYposZplayer )
    setElementPosition playerposXposYposZ )
end
addEvent"ontppustynia"true )
addEventHandler"ontppustynia"rootgreetingontppustynia )    
--WYSPA
function greetingtextwyspa messageplayer )
    outputChatBox messageplayer )
end
addEvent"texttpwyspa"true )
addEventHandler"texttpwyspa"rootgreetingtextwyspa )

function greetingontpwyspa posXposYposZplayer )
    setElementPosition playerposXposYposZ )
end
addEvent"ontpwyspa"true )
addEventHandler"ontpwyspa"rootgreetingontpwyspa )    
--TAMA
function greetingtexttama messageplayer )
    outputChatBox messageplayer )
end
addEvent"texttptama"true )
addEventHandler"texttptama"rootgreetingtexttama )

function greetingontptama posXposYposZplayer )
    setElementPosition playerposXposYposZ )
end
addEvent"ontptama"true )
addEventHandler"ontptama"rootgreetingontptama )
--MOLO
function greetingtextmolo messageplayer )
    outputChatBox messageplayer )
end
addEvent"texttpmolo"true )
addEventHandler"texttpmolo"rootgreetingtextmolo )

function greetingontpmolo posXposYposZplayer )
    setElementPosition playerposXposYposZ )
end
addEvent"ontpmolo"true )
addEventHandler"ontpmolo"rootgreetingontpmolo )
--BAGNO
function greetingtextbagno messageplayer )
    outputChatBox messageplayer )
end
addEvent"texttpbagno"true )
addEventHandler"texttpbagno"rootgreetingtextbagno )

function greetingontpbagno posXposYposZplayer )
    setElementPosition playerposXposYposZ )
end
addEvent"ontpbagno"true )
addEventHandler"ontpbagno"rootgreetingontpbagno )
--PORT
function greetingtextport messageplayer )
    outputChatBox messageplayer )
end
addEvent"texttpport"true )
addEventHandler"texttpport"rootgreetingtextport )

function greetingontpport posXposYposZplayer )
    setElementPosition playerposXposYposZ )
end
addEvent"ontpport"true )
addEventHandler"ontpport"rootgreetingontpport )
--CHILLIAD
function greetingtextchilliad messageplayer )
    outputChatBox messageplayer )
end
addEvent"texttpchilliad"true )
addEventHandler"texttpchilliad"rootgreetingtextchilliad )

function greetingontpchilliad posXposYposZplayer )
    setElementPosition playerposXposYposZ )
end
addEvent"ontpchilliad"true )
addEventHandler"ontpchilliad"rootgreetingontpchilliad )
--DRAG
function greetingtextdrag messageplayer )
    outputChatBox messageplayer )
end
addEvent"texttpdrag"true )
addEventHandler"texttpdrag"rootgreetingtextdrag )

function greetingontpdrag posXposYposZplayer )
    setElementPosition playerposXposYposZ )
end
addEvent"ontpdrag"true )
addEventHandler"ontpdrag"rootgreetingontpdrag )
--WYSKOK
function greetingtextwyskok messageplayer )
    outputChatBox messageplayer )
end
addEvent"texttpwyskok"true )
addEventHandler"texttpwyskok"rootgreetingtextwyskok )

function greetingontpwyskok posXposYposZplayer )
    setElementPosition playerposXposYposZ )
end
addEvent"ontpwyskok"true )
addEventHandler"ontpwyskok"rootgreetingontpwyskok )
--TOR
function greetingtexttor messageplayer )
    outputChatBox messageplayer )
end
addEvent"texttptor"true )
addEventHandler"texttptor"rootgreetingtexttor )

function greetingontptor posXposYposZplayer )
    setElementPosition playerposXposYposZ )
end
addEvent"ontptor"true )
addEventHandler"ontptor"rootgreetingontptor )


Podpis
Moje skrypty i mapy:
-Baza by Zuraw [SAMP]
-RC Vehicles enter by Zuraw [SAMP]
-Neony by zuraw [SAMP]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-01-31, 10:01


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Zrobi?em ci ten skrypt Kod :
Klient:
local player getLocalPlayer()


tabela = {
{ 2500.5952, -1669.445413.3532"Witamy w Los Santos!" }, -- Teleport LS
2140.8190986.227310.8203"Witamy w Las Venturas!" }, -- Teleport LV
{ -2041.2288136.267528.8359 "Witamy w San Fierro!" }, -- Teleport SF
1945.4160, -2305.642315.0583"Witamy na Lotnisku w Los Santos!" }, -- Teleport LS LOT
{ -1642.90136718751203.98303222667.25"Witamy przed Salonem w San Fierro!" }, -- Teleport SF Salon
428.48662533.769516.5045"Witamy na Pustyni!" }, -- Pustynia
776.6111, -2834.73584.2433"Witamy na Wyspie!" }, -- Wyspa
{ -924.34002019.723460.9141"Witamy na Tamie!" }, -- Tama
836.2119, -2057.713612.8671"Witamy na Molo!"}, -- Molo
{ -841.3732, -1940.709412.5643"Witamy na Bagnach!" }, -- Bagno
2294.0693558.90817.7813"Witamy w Porcie!" }, -- Port
{ -2301.9609, -1648.8076483.6195"Witamy na G?rze Chilliad!" }, -- G?ra  CHILLIAD
2041.7806856.4257790.5769"Witamy na Dragu!" }, -- Drag
2071.7295284.0156403.1366"Witamy na Wyskoku!" }, -- Wyskok
2160.729469, -4034.183105.2526798"Witamy na Torze!" } -- Tor
}

GUIEditor = {
    gridlist = {},
    window = {},
    button = {}
}

        GUIEditor.window[1] = guiCreateWindow(0.020.200.260.53"System Teleportow"true)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetVisible(GUIEditor.window[1], false)

        GUIEditor.button[1] = guiCreateButton(0.370.910.260.06"Exit"trueGUIEditor.window[1])
        guiSetFont(GUIEditor.button[1], "clear-normal")
        guiSetProperty(GUIEditor.button[1], "NormalTextColour""FFAAAAAA")
        GUIEditor.gridlist[1] = guiCreateGridList(0.050.050.890.84trueGUIEditor.window[1])
        local Kolumna1 guiGridListAddColumn(GUIEditor.gridlist[2],"X",0.5)
        local Kolumna2 guiGridListAddColumn(GUIEditor.gridlist[2],"Y",0.5)
        local Kolumna3 guiGridListAddColumn(GUIEditor.gridlist[2],"Z",0.5)
        local Kolumna4 guiGridListAddColumn(GUIEditor.gridlist[2],"Wiadomosc",0.5)
        guiSetAlpha(GUIEditor.gridlist[1], 0.80)    

function open ()
if guiGetVisible(GUIEditor.window[1]) == false then -- Patrzenie czy okno jest zamki?te
    guiGridListClear(GUIEditor.gridlist[1]) -- Od?wie?anie Listy
    showCursor(true) -- w?aczanie Kursora
    guiSetVisible(GUIEditor.window[1], true) -- pokazywanie okna gui
        for i=1,#tabela do -- Tworzenie p?tli
        xxD tabela[i][1] -- pobieranie argumentu tabeli x
        yxD tabela[i][2] -- pobieranie argumentu tabeli y
        zxD tabela[i][3] -- pobieranie argumentu tabeli z
        wxD tabela[i][4] -- pobieranie argumentu tabeli wiadomosci
        local row guiGridListAddRow(GUIEditor.gridlist[1]) -- Tworzenie row listy
        guiGridListSetItemText(GUIEditor.gridlist[1], rowKolumna1xxDfalsefalse) -- Dodawanie do listy pozycji x
        guiGridListSetItemText(GUIEditor.gridlist[1], rowKolumna2yxDfalsefalse) -- Dodawanie do listy pozycji y
        guiGridListSetItemText(GUIEditor.gridlist[1], rowKolumna3zxDfalsefalse) -- Dodawanie do listy pozycji z
        guiGridListSetItemText(GUIEditor.gridlist[1], rowKolumna4wxDfalsefalse) -- Dodawanie do listy wiadomosc
        end
end
end

function klik ()
if (source == PodajButtonthen -- spawdza czy klik??es na button.
local x guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), Kolumna1) -- pobieranie pozycji x    
local y guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), Kolumna2) -- pobieranie pozycji y    
local z guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), Kolumna3) -- pobieranie pozycji z
local w guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), Kolumna4) -- pobieranie wiadomosci     
triggerServerEvent("Teleport"getRootElement(), xyzwplayer) -- Tworzenie Tigger na strone Serwer
end
end
addEventHandler("onClientGUIClick"PodajButtonwylaczpanelurzadufalse) -- Tworzenie Eventu

function oknoclose ()
if (source == GUIEditor.button[1]) then -- spawdza czy klik??es na button.
showCursor(false) -- w?aczanie Kursora
guiSetVisible(GUIEditor.window[1], false) -- Zamykanie Okna
end
end
addEventHandler("onClientGUIClick"GUIEditor.button[1], oknoclosefalse)


Serwer:
function Teleport_S (xyzwplayer)
setElementPosition(playerxy)
outputChatBoxwplayer2552550)
end
addEvent("Teleport"true)
addEventHandler("Teleport"getRootElement(), podawajdane2wlacielaTeleport_S )


Trzeba dorobic jeszcze 1 button w tym gui i jego nazwe w odpowiednim miejscu w kodzie gdzie jest nazwa "PodajButton"

Pomog?em ci Podstaw piwko, Zapraszam do mojego Poradnika Xml link w podpisie

PS: jak jest xxD = tabela[i][1] to usun z [i] te :1 i poniezej w kodzie :2,:3,:4

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-01-31, 16:10


zuraw13







Wiek: 27
Na forum: 5073 dni
Posty: 95
Nick w MP: zuraw113

Piwa: 191

Respekt: 50

Pr?bowa?em wstawi? bindkey,bo nie by?o w kodzie ?adnej komendy, a ja wole bindkey, ale jak wstawia?em to si? nie otwiera?o gui.
bindKey('F2''down'open)


- Klient z dodanym tym drugim buttonie:
local player getLocalPlayer()


tabela = {
{ 2500.5952, -1669.445413.3532"Witamy w Los Santos!" }, -- Teleport LS
2140.8190986.227310.8203"Witamy w Las Venturas!" }, -- Teleport LV
{ -2041.2288136.267528.8359 "Witamy w San Fierro!" }, -- Teleport SF
1945.4160, -2305.642315.0583"Witamy na Lotnisku w Los Santos!" }, -- Teleport LS LOT
{ -1642.90136718751203.98303222667.25"Witamy przed Salonem w San Fierro!" }, -- Teleport SF Salon
428.48662533.769516.5045"Witamy na Pustyni!" }, -- Pustynia
776.6111, -2834.73584.2433"Witamy na Wyspie!" }, -- Wyspa
{ -924.34002019.723460.9141"Witamy na Tamie!" }, -- Tama
836.2119, -2057.713612.8671"Witamy na Molo!"}, -- Molo
{ -841.3732, -1940.709412.5643"Witamy na Bagnach!" }, -- Bagno
2294.0693558.90817.7813"Witamy w Porcie!" }, -- Port
{ -2301.9609, -1648.8076483.6195"Witamy na G?rze Chilliad!" }, -- G?ra  CHILLIAD
2041.7806856.4257790.5769"Witamy na Dragu!" }, -- Drag
2071.7295284.0156403.1366"Witamy na Wyskoku!" }, -- Wyskok
2160.729469, -4034.183105.2526798"Witamy na Torze!" } -- Tor
}

GUIEditor = {
    gridlist = {},
    window = {},
    button = {}
}

        GUIEditor.window[1] = guiCreateWindow(0.020.200.260.53"System Teleportow"true)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetVisible(GUIEditor.window[1], false)

        GUIEditor.button[1] = guiCreateButton(0.370.910.260.06"Exit"trueGUIEditor.window[1])
        guiSetFont(GUIEditor.button[1], "clear-normal")
        guiSetProperty(GUIEditor.button[1], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[2] = guiCreateButton(102306014"Teleport"falseGUIEditor.window[1])
        guiSetFont(GUIEditor.button[2], "clear-normal")
        guiSetProperty(GUIEditor.button[2], "NormalTextColour""FFAAAAAA")   
        GUIEditor.gridlist[1] = guiCreateGridList(0.050.050.890.84trueGUIEditor.window[1])
        local Kolumna1 guiGridListAddColumn(GUIEditor.gridlist[2],"X",0.5)
        local Kolumna2 guiGridListAddColumn(GUIEditor.gridlist[2],"Y",0.5)
        local Kolumna3 guiGridListAddColumn(GUIEditor.gridlist[2],"Z",0.5)
        local Kolumna4 guiGridListAddColumn(GUIEditor.gridlist[2],"Wiadomosc",0.5)
        guiSetAlpha(GUIEditor.gridlist[1], 0.80)

function open ()        
if guiGetVisible(GUIEditor.window[1]) == false then -- Patrzenie czy okno jest zamki?te
    guiGridListClear(GUIEditor.gridlist[1]) -- Od?wie?anie Listy
    showCursor(true) -- w?aczanie Kursora
    guiSetVisible(GUIEditor.window[1], true) -- pokazywanie okna gui
        for i=1,#tabela do -- Tworzenie p?tli
        xxD tabela[i][1] -- pobieranie argumentu tabeli x
        yxD tabela[i][2] -- pobieranie argumentu tabeli y
        zxD tabela[i][3] -- pobieranie argumentu tabeli z
        wxD tabela[i][4] -- pobieranie argumentu tabeli wiadomosci
        local row guiGridListAddRow(GUIEditor.gridlist[1]) -- Tworzenie row listy
        guiGridListSetItemText(GUIEditor.gridlist[1], rowKolumna1xxDfalsefalse) -- Dodawanie do listy pozycji x
        guiGridListSetItemText(GUIEditor.gridlist[1], rowKolumna2yxDfalsefalse) -- Dodawanie do listy pozycji y
        guiGridListSetItemText(GUIEditor.gridlist[1], rowKolumna3zxDfalsefalse) -- Dodawanie do listy pozycji z
        guiGridListSetItemText(GUIEditor.gridlist[1], rowKolumna4wxDfalsefalse) -- Dodawanie do listy wiadomosc
        end
end
end

function klik ()
if (source == GUIEditor.button[2]) then -- spawdza czy klik??es na button.
local x guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), Kolumna1) -- pobieranie pozycji x    
local y guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), Kolumna2) -- pobieranie pozycji y    
local z guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), Kolumna3) -- pobieranie pozycji z
local w guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), Kolumna4) -- pobieranie wiadomosci     
triggerServerEvent("Teleport"getRootElement(), xyzwplayer) -- Tworzenie Tigger na strone Serwer
end
end
addEventHandler("onClientGUIClick"GUIEditor.button[2], wylaczpanelurzadufalse) -- Tworzenie Eventu

function oknoclose ()
if (source == GUIEditor.button[1]) then -- spawdza czy klik??es na button.
showCursor(false) -- w?aczanie Kursora
guiSetVisible(GUIEditor.window[1], false) -- Zamykanie Okna
end
end
addEventHandler("onClientGUIClick"GUIEditor.button[1], oknoclosefalse)


-Serwer:
function Teleport_S (xyzwplayer)
setElementPosition(playerxy)
outputChatBoxwplayer2552550)
end
addEvent("Teleport"true)
addEventHandler("Teleport"getRootElement(), Teleport_S )


Kod z gui editor:
GUIEditor = {
    gridlist = {},
    window = {},
    button = {}
}
addEventHandler("onClientResourceStart"resourceRoot,
    function()
        GUIEditor.window[1] = guiCreateWindow(0.020.200.260.53"System Teleportow"true)
        guiWindowSetSizable(GUIEditor.window[1], false)

        GUIEditor.button[1] = guiCreateButton(0.550.910.390.06"Exit"trueGUIEditor.window[1])
        guiSetFont(GUIEditor.button[1], "clear-normal")
        guiSetProperty(GUIEditor.button[1], "NormalTextColour""FFAAAAAA")
        GUIEditor.gridlist[1] = guiCreateGridList(0.050.050.890.84trueGUIEditor.window[1])
        guiGridListAddColumn(GUIEditor.gridlist[1], "Teleporty"0.9)
        guiGridListAddRow(GUIEditor.gridlist[1])
        guiGridListSetItemText(GUIEditor.gridlist[1], 01"-"falsefalse)
        guiSetAlpha(GUIEditor.gridlist[1], 0.80)
        GUIEditor.button[2] = guiCreateButton(102306014"Teleport"falseGUIEditor.window[1])
        guiSetFont(GUIEditor.button[2], "clear-normal")
        guiSetProperty(GUIEditor.button[2], "NormalTextColour""FFAAAAAA")    
    end
)


Podpis
Moje skrypty i mapy:
-Baza by Zuraw [SAMP]
-RC Vehicles enter by Zuraw [SAMP]
-Neony by zuraw [SAMP]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-01-31, 19:35


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

local player getLocalPlayer()


tabela = {
{ 2500.5952, -1669.445413.3532"Witamy w Los Santos!" }, -- Teleport LS
2140.8190986.227310.8203"Witamy w Las Venturas!" }, -- Teleport LV
{ -2041.2288136.267528.8359 "Witamy w San Fierro!" }, -- Teleport SF
1945.4160, -2305.642315.0583"Witamy na Lotnisku w Los Santos!" }, -- Teleport LS LOT
{ -1642.90136718751203.98303222667.25"Witamy przed Salonem w San Fierro!" }, -- Teleport SF Salon
428.48662533.769516.5045"Witamy na Pustyni!" }, -- Pustynia
776.6111, -2834.73584.2433"Witamy na Wyspie!" }, -- Wyspa
{ -924.34002019.723460.9141"Witamy na Tamie!" }, -- Tama
836.2119, -2057.713612.8671"Witamy na Molo!"}, -- Molo
{ -841.3732, -1940.709412.5643"Witamy na Bagnach!" }, -- Bagno
2294.0693558.90817.7813"Witamy w Porcie!" }, -- Port
{ -2301.9609, -1648.8076483.6195"Witamy na G?rze Chilliad!" }, -- G?ra  CHILLIAD
2041.7806856.4257790.5769"Witamy na Dragu!" }, -- Drag
2071.7295284.0156403.1366"Witamy na Wyskoku!" }, -- Wyskok
2160.729469, -4034.183105.2526798"Witamy na Torze!" } -- Tor
}

GUIEditor = {
    gridlist = {},
    window = {},
    button = {}
}

        GUIEditor.window[1] = guiCreateWindow(0.020.200.260.53"System Teleportow"true)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetVisible(GUIEditor.window[1], false)

        GUIEditor.button[1] = guiCreateButton(0.370.910.260.06"Exit"trueGUIEditor.window[1])
        guiSetFont(GUIEditor.button[1], "clear-normal")
        guiSetProperty(GUIEditor.button[1], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[2] = guiCreateButton(102306014"Teleport"falseGUIEditor.window[1])
        guiSetFont(GUIEditor.button[2], "clear-normal")
        guiSetProperty(GUIEditor.button[2], "NormalTextColour""FFAAAAAA")   
        GUIEditor.gridlist[1] = guiCreateGridList(0.050.050.890.84trueGUIEditor.window[1])
        local Kolumna1 guiGridListAddColumn(GUIEditor.gridlist[2],"X",0.5)
        local Kolumna2 guiGridListAddColumn(GUIEditor.gridlist[2],"Y",0.5)
        local Kolumna3 guiGridListAddColumn(GUIEditor.gridlist[2],"Z",0.5)
        local Kolumna4 guiGridListAddColumn(GUIEditor.gridlist[2],"Wiadomosc",0.5)
        guiSetAlpha(GUIEditor.gridlist[1], 0.80)

function open ()        
if guiGetVisible(GUIEditor.window[1]) == false then -- Patrzenie czy okno jest zamki?te
    guiGridListClear(GUIEditor.gridlist[1]) -- Od?wie?anie Listy
    showCursor(true) -- w?aczanie Kursora
    guiSetVisible(GUIEditor.window[1], true) -- pokazywanie okna gui
        for i=1,#tabela do -- Tworzenie p?tli
        xxD tabela[i][1] -- pobieranie argumentu tabeli x
        yxD tabela[i][2] -- pobieranie argumentu tabeli y
        zxD tabela[i][3] -- pobieranie argumentu tabeli z
        wxD tabela[i][4] -- pobieranie argumentu tabeli wiadomosci
        local row guiGridListAddRow(GUIEditor.gridlist[1]) -- Tworzenie row listy
        guiGridListSetItemText(GUIEditor.gridlist[1], rowKolumna1xxDfalsefalse) -- Dodawanie do listy pozycji x
        guiGridListSetItemText(GUIEditor.gridlist[1], rowKolumna2yxDfalsefalse) -- Dodawanie do listy pozycji y
        guiGridListSetItemText(GUIEditor.gridlist[1], rowKolumna3zxDfalsefalse) -- Dodawanie do listy pozycji z
        guiGridListSetItemText(GUIEditor.gridlist[1], rowKolumna4wxDfalsefalse) -- Dodawanie do listy wiadomosc
        end
end
end
bindKey("F2""down"open )

function klik ()
if (source == GUIEditor.button[2]) then -- spawdza czy klik??es na button.
local x guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), Kolumna1) -- pobieranie pozycji x    
local y guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), Kolumna2) -- pobieranie pozycji y    
local z guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), Kolumna3) -- pobieranie pozycji z
local w guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), Kolumna4) -- pobieranie wiadomosci     
triggerServerEvent("Teleport"getRootElement(), xyzwplayer) -- Tworzenie Tigger na strone Serwer
end
end
addEventHandler("onClientGUIClick"GUIEditor.button[2], wylaczpanelurzadufalse) -- Tworzenie Eventu

function oknoclose ()
if (source == GUIEditor.button[1]) then -- spawdza czy klik??es na button.
showCursor(false) -- w?aczanie Kursora
guiSetVisible(GUIEditor.window[1], false) -- Zamykanie Okna
end
end
addEventHandler("onClientGUIClick"GUIEditor.button[1], oknoclosefalse)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-01-31, 20:58


zuraw13







Wiek: 27
Na forum: 5073 dni
Posty: 95
Nick w MP: zuraw113

Piwa: 191

Respekt: 50

Jak klikam teleport, to nie teleportuje i nie wypisuje wiadomo?ci.

Da?o by si? zrobi? tak, aby w gui by?a tylko nazwa, a dzi?ki niej po klikni?ciu teleport pobiera pozycje i wiadomo??.

Kod:
local player getLocalPlayer()

tabela = {
{ 2500.5952, -1669.445413.3532"Witamy w Los Santos!""Los Santos" }, -- Teleport LS
2140.8190986.227310.8203"Witamy w Las Venturas!""Las Venturas" }, -- Teleport LV
{ -2041.2288136.267528.8359"Witamy w San Fierro!""San Fierro" }, -- Teleport SF
1945.4160, -2305.642315.0583"Witamy na Lotnisku w Los Santos!""Lotnisko w Los Santos" }, -- Teleport LS LOT
{ -1642.90136718751203.98303222667.25"Witamy przed Salonem w San Fierro!""Salon w San Fierro" }, -- Teleport SF Salon
428.48662533.769516.5045"Witamy na Pustyni!""Pustynia" }, -- Pustynia
776.6111, -2834.73584.2433"Witamy na Wyspie!""Wyspa" }, -- Wyspa
{ -924.34002019.723460.9141"Witamy na Tamie!""Tama" }, -- Tama
836.2119, -2057.713612.8671"Witamy na Molo!""Molo" }, -- Molo
{ -841.3732, -1940.709412.5643"Witamy na Bagnach!""Bagna" }, -- Bagno
2294.0693558.90817.7813"Witamy w Porcie!""Port" }, -- Port
{ -2301.9609, -1648.8076483.6195"Witamy na G?rze Chilliad!""G?ra  Chilliad" }, -- G?ra  CHILLIAD
2041.7806856.4257790.5769"Witamy na Dragu!""Drag" }, -- Drag
2071.7295284.0156403.1366"Witamy na Wyskoku!""Wyskok" }, -- Wyskok
2160.729469, -4034.183105.2526798"Witamy na Torze!""Tor" } -- Tor
}

GUIEditor = {
    gridlist = {},
    window = {},
    button = {}
}

        GUIEditor.window[1] = guiCreateWindow(0.020.200.260.53"System Teleportow"true)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetVisible(GUIEditor.window[1], false)

        GUIEditor.button[1] = guiCreateButton(0.600.910.390.06"Exit"trueGUIEditor.window[1])
        guiSetFont(GUIEditor.button[1], "clear-normal")
        guiSetProperty(GUIEditor.button[1], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[2] = guiCreateButton(0.050.910.390.06"Teleport"trueGUIEditor.window[1])
        guiSetFont(GUIEditor.button[2], "clear-normal")
        guiSetProperty(GUIEditor.button[2], "NormalTextColour""FFAAAAAA")   
        GUIEditor.gridlist[1] = guiCreateGridList(0.050.050.890.84trueGUIEditor.window[1])
        local Kolumna guiGridListAddColumn(GUIEditor.gridlist[1],"Miejsce teleportacji",0.5)
        guiSetAlpha(GUIEditor.gridlist[1], 0.80)

function open ()        
if guiGetVisible(GUIEditor.window[1]) == false then -- Patrzenie czy okno jest zamki?te
    guiGridListClear(GUIEditor.gridlist[1]) -- Od?wie?anie Listy
    showCursor(true) -- w?aczanie Kursora
    guiSetVisible(GUIEditor.window[1], true) -- pokazywanie okna gui
        for i=1,#tabela do -- Tworzenie p?tli
        xxD tabela[i][1] -- pobieranie argumentu tabeli x
        yxD tabela[i][2] -- pobieranie argumentu tabeli y
        zxD tabela[i][3] -- pobieranie argumentu tabeli z
        wxD tabela[i][4] -- pobieranie argumentu tabeli wiadomosci
        nxD tabela[i][5] -- pobieranie nazwy miejsca
        local row guiGridListAddRow(GUIEditor.gridlist[1]) -- Tworzenie row listy
        guiGridListSetItemText(GUIEditor.gridlist[1], rowKolumnanxDfalsefalse) -- Dodawanie do listy nazw
        end
end
end
bindKey("F2""down"open )

function klik ()
if (source == GUIEditor.button[2]) then -- spawdza czy klik??es na button.
local x guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), Kolumna1) -- pobieranie pozycji x    
local y guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), Kolumna2) -- pobieranie pozycji y    
local z guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), Kolumna3) -- pobieranie pozycji z
local w guiGridListGetItemText(GUIEditor.gridlist[1], guiGridListGetSelectedItem(GUIEditor.gridlist[1]), Kolumna4) -- pobieranie wiadomosci  

triggerServerEvent("Teleport"getRootElement(), xyzwplayer) -- Tworzenie Tigger na strone Serwer
end
end
addEventHandler("onClientGUIClick"GUIEditor.button[2], wylaczpanelurzadufalse) -- Tworzenie Eventu

function oknoclose ()
if (source == GUIEditor.button[1]) then -- spawdza czy klik??es na button.
showCursor(false) -- w?aczanie Kursora
guiSetVisible(GUIEditor.window[1], false) -- Zamykanie Okna
end
end
addEventHandler("onClientGUIClick"GUIEditor.button[1], oknoclosefalse)



Jakby co zrobi?em plik xml:
Kod:

<root>
<name="Los Santos" x="2500.5952" y="-1669.4454" z="13.3532" w="Witamy w Los Santos!"/>
<name="Las Venturas" x="2140.8190" y="986.2273" z="10.8203" w="Witamy w Las Venturas!"/>
<name="San Fierro" x="-2041.2288" y="136.2675" z="28.8359" w="Witamy w San Fierro!"/>
<name="Lotnisko w Los Santos" x="1945.4160" y="-2305.6423" z="15.0583" w="Witamy na Lotnisku w Los Santos!"/>
<name="Salon w San Fierro" x="-1642.9013671875" y="1203.9830322266" z="7.25" w="Witamy przed Salonem w San Fierro!"/>
<name="Pustynia" x="428.4866" y="2533.7695" z="16.5045" w="Witamy na Pustyni!"/>
<name="Wyspa" x="776.6111" y="-2834.7358" z="4.2433" w="Witamy na Wyspie!"/>
<name="Tama" x="-924.3400" y="2019.7234" z="60.9141" w="Witamy na Tamie!"/>
<name="Molo" x="836.2119" y="-2057.7136" z="12.8671" w="Witamy na Molo!"/>
<name="Bagna" x="-841.3732" y="-1940.7094" z="12.5643" w="Witamy na Bagnach!"/>
<name="Port" x="2294.0693" y="558.9081" z="7.7813" w="Witamy w Porcie!"/>
<name="G?ra Chilliad" x="-2301.9609" y="-1648.8076" z="483.6195" w="Witamy na G?rze Chilliad!"/>
<name="Drag" x="2041.7806" y="856.4257" z="790.5769" w="Witamy na Dragu!"/>
<name="Wyskok" x="2071.7295" y="284.0156" z="403.1366" w="Witamy na Wyskoku!"/>
<name="Tor" x="2160.729469" y="-4034.18310" z="5.2526798" w="Witamy na Torze!"/>
</root>


Podpis
Moje skrypty i mapy:
-Baza by Zuraw [SAMP]
-RC Vehicles enter by Zuraw [SAMP]
-Neony by zuraw [SAMP]
Ostatnio zmieniony przez zuraw13 2014-01-31, 22:08, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-01-31, 21:27


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

zuraw13, najpierw zaznacz na gridList jakos pozycje

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-01-31, 22:07


zuraw13







Wiek: 27
Na forum: 5073 dni
Posty: 95
Nick w MP: zuraw113

Piwa: 191

Respekt: 50

Zaznaczy?em i nie tepa

Podpis
Moje skrypty i mapy:
-Baza by Zuraw [SAMP]
-RC Vehicles enter by Zuraw [SAMP]
-Neony by zuraw [SAMP]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-01-31, 23:00


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

zuraw13, Jutro ci napisz? posta o okolo godzinie 18

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-20, 23:27


zuraw13







Wiek: 27
Na forum: 5073 dni
Posty: 95
Nick w MP: zuraw113

Piwa: 191

Respekt: 50

Pomo?esz?

Podpis
Moje skrypty i mapy:
-Baza by Zuraw [SAMP]
-RC Vehicles enter by Zuraw [SAMP]
-Neony by zuraw [SAMP]
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-21, 10:47


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Dalej z tym podaj kodzik :

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-02-22, 09:14


zuraw13







Wiek: 27
Na forum: 5073 dni
Posty: 95
Nick w MP: zuraw113

Piwa: 191

Respekt: 50

Naprawi?em

Podpis
Moje skrypty i mapy:
-Baza by Zuraw [SAMP]
-RC Vehicles enter by Zuraw [SAMP]
-Neony by zuraw [SAMP]
Postaw piwo autorowi tego posta
 

 
Tagi: teleport :: gui
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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