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

Wysłany: 2013-04-28, 12:14


Ciastkooo







Wiek: 41
Na forum: 4804 dni
Posty: 78
Nick w MP: Ciastko

Piwa: 24

Respekt: 50

Ostrzeżeń: 100%
Zrobilem pelny kod ale tak to juz u mnie jest, bez bledow sie nie obejdzie :)

CLIENT:

GUIEditor = {
    button = {},
    window = {}
}
        GUIEditor.window[1] = guiCreateWindow(481309654434"Teleport Panel"false)
        guiWindowSetMovable(GUIEditor.window[1], false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetAlpha(GUIEditor.window[1], 1.00)
        guiSetVisible GUIEditor.window[1], false)

        local fc guiCreateButton(5315815255"Fort Carson"falseGUIEditor.window[1])
        local lp guiCreateButton(25415715056"Las Paysadas"falseGUIEditor.window[1])
        local sl guiCreateButton(44815813955"Stare Lotnisko"falseGUIEditor.window[1])
        local ls guiCreateButton(5426015155"Los Santos"falseGUIEditor.window[1])
        local sf guiCreateButton(25626014855"San Fierro"falseGUIEditor.window[1])
        local lv guiCreateButton(44926213853"Las Venturas"falseGUIEditor.window[1])
        local bull guiCreateButton(37534923263"Bullet"falseGUIEditor.window[1])


    function xd()
        dxDrawText("Teleport"5963331015404tocolor(255255255255), 3.00"bankgothic""left""top"falsefalsetruefalsefalse)
        dxDrawText("BONUS :"555642809705tocolor(255255255255), 3.00"pricedown""left""top"falsefalsetruefalsefalse)
    end
    
function gui() 
if (guiGetVisible (GUIEditor.window[1]) == falsethen 
guiSetVisible(GUIEditor.window[1], trueshowCursor(trueaddEventHandler("onClientRender"getRootElement(), xd)
else 
guiSetVisible(GUIEditor.window[1], falseshowCursor(falseremoveEventHandler("onClientRender"getRootElement(), xd)
end 
end 
bindKey ("F3""down"gui) 


function fort()
outputChatBox("Przenios?e? si? do Fort Carson"25500true)
triggerServerEvent("fort"getRootElement(), player)
end
addEventHandler "onClientGUIClick"fcfort)

function las()
outputChatBox("Przenios?e? si? do Las Paysadas"25500true)
triggerServerEvent("las"getRootElement(), player)
end
addEventHandler "onClientGUIClick"lolas)

function stare()
outputChatBox("Przenios?e? si? na Stare Lotnisko"25500true)
triggerServerEvent("stare"getRootElement(), player)
end
addEventHandler "onClientGUIClick"slstare)

function los()
outputChatBox("Przenios?e? si? do Los Santos"25500true)
triggerServerEvent("los"getRootElement(), player)
end
addEventHandler "onClientGUIClick"lslos)

function san()
outputChatBox("Przenios?e? si? do San Fierro"25500true)
triggerServerEvent("san"getRootElement(), player)
end
addEventHandler "onClientGUIClick"sansf)

function lasv()
outputChatBox("Przenios?e? si? do Las Venturas"25500true)
triggerServerEvent("lasv"getRootElement(), player)
end
addEventHandler "onClientGUIClick"lvlasv)

function bullet()
outputChatBox("Otrzymales auto o nazwie Bullet"25500true)
triggerServerEvent("bullet"getRootElement(), player)
end
addEventHandler "onClientGUIClick"bullbullet)


SERVER:
function fortthePlayer )
    setElementPosition thePlayer, -192118820 )
end
addEvent("fort"true)
addEventHandler("fort"getRootElement(), fort)

function bullet(thePlayer)
    local x,y,getElementPosition source )
    local bullet createVehicle562yz)
    warpPedIntoVehicle playerbullet )
    if isPedInVehicle then
    outputChatBox "Twoje auto zostanie usuniete po twoim wyjsciu z niego"thePlayer )
end    
addEvent("bullet"true)
addEventHandler("bullet"getRootElement(), bullet)

function lasthePlayer )
    setElementPosition thePlayer, -192118820 )
end
addEvent("las"true)
addEventHandler("las"getRootElement(), las)

function starethePlayer )
    setElementPosition thePlayer, -192118820 )
end
addEvent("stare"true)
addEventHandler("stare"getRootElement(), stare)

function losthePlayer )
    setElementPosition thePlayer, -192118820 )
end
addEvent("los"true)
addEventHandler("los"getRootElement(), los)

function santhePlayer )
    setElementPosition thePlayer, -192118820 )
end
addEvent("san"true)
addEventHandler("san"getRootElement(), san)

function lasvthePlayer )
    setElementPosition thePlayer, -192118820 )
end
addEvent("lasv"true)
addEventHandler("lasv"getRootElement(), lasv)



Przenosi mnie do danego miejsca lecz wybucham O.o Jesli ktos znajdzie blad podajdzie gdzie on jest .

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-28, 12:40


Oski

LUA Scripter






Wiek: 30
Na forum: 5246 dni
Posty: 428
Nick w MP: Oski

Piwa: 56

Respekt: 75,1

Czy tylko po teleportacji wybuchasz czy te? po teleportacji bierzesz auto z eventu "bullet"?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-28, 13:27


Ciastkooo







Wiek: 41
Na forum: 4804 dni
Posty: 78
Nick w MP: Ciastko

Piwa: 24

Respekt: 50

Ostrzeżeń: 100%
Po teleportacji, fpsy spadaja do 2 w tle widze jak tworzy sie sterta aut i nagle sie respie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-28, 13:55


Oski

LUA Scripter






Wiek: 30
Na forum: 5246 dni
Posty: 428
Nick w MP: Oski

Piwa: 56

Respekt: 75,1

Do funkcji wywo?anych eventem onClientGUIClick dodaj warunki sprawdzaj?ce czy naciskany przycisk przez ciebie jest tym podpi?tym pod event.
Przyk?ad

function blabla()
if source == przycisk then
[...]
end
end
addEventHandler ( "onClientGUIClick", przycisk , blabla)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-28, 14:05


Ciastkooo







Wiek: 41
Na forum: 4804 dni
Posty: 78
Nick w MP: Ciastko

Piwa: 24

Respekt: 50

Ostrzeżeń: 100%
po then dodac to co ma miec przycisk tak?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-28, 14:15


Oski

LUA Scripter






Wiek: 30
Na forum: 5246 dni
Posty: 428
Nick w MP: Oski

Piwa: 56

Respekt: 75,1

tak po then dodajesz co ma robi? dana funkcja

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-28, 14:16


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Ciastkooo,
function blabla()
if (source == przycisk then
[...]
end
end
addEventHandler "onClientGUIClick"przycisk blabla)


przycisk - button w gui, funkcja guiCreateButton.

Postaw piwo autorowi tego posta
 

 
Tagi: panel :: teleportacji
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