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: 42
Na forum: 4945 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(481, 309, 654, 434, "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(53, 158, 152, 55, "Fort Carson", false, GUIEditor.window[1])
        local lp = guiCreateButton(254, 157, 150, 56, "Las Paysadas", false, GUIEditor.window[1])
        local sl = guiCreateButton(448, 158, 139, 55, "Stare Lotnisko", false, GUIEditor.window[1])
        local ls = guiCreateButton(54, 260, 151, 55, "Los Santos", false, GUIEditor.window[1])
        local sf = guiCreateButton(256, 260, 148, 55, "San Fierro", false, GUIEditor.window[1])
        local lv = guiCreateButton(449, 262, 138, 53, "Las Venturas", false, GUIEditor.window[1])
        local bull = guiCreateButton(375, 349, 232, 63, "Bullet", false, GUIEditor.window[1])


    function xd()
        dxDrawText("Teleport", 596, 333, 1015, 404, tocolor(255, 255, 255, 255), 3.00, "bankgothic", "left", "top", false, false, true, false, false)
        dxDrawText("BONUS :", 555, 642, 809, 705, tocolor(255, 255, 255, 255), 3.00, "pricedown", "left", "top", false, false, true, false, false)
    end
    
function gui() 
if (guiGetVisible (GUIEditor.window[1]) == false) then 
guiSetVisible(GUIEditor.window[1], true) 
showCursor(true) 
addEventHandler("onClientRender", getRootElement(), xd)
else 
guiSetVisible(GUIEditor.window[1], false) 
showCursor(false) 
removeEventHandler("onClientRender", getRootElement(), xd)
end 
end 
bindKey ("F3", "down", gui) 


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

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

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

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

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

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

function bullet()
outputChatBox("Otrzymales auto o nazwie Bullet", 255, 0, 0, true)
triggerServerEvent("bullet", getRootElement(), player)
end
addEventHandler ( "onClientGUIClick", bull, bullet)


SERVER:
function fort( thePlayer )
    setElementPosition ( thePlayer, -192, 1188, 20 )
end
addEvent("fort", true)
addEventHandler("fort", getRootElement(), fort)

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

function las( thePlayer )
    setElementPosition ( thePlayer, -192, 1188, 20 )
end
addEvent("las", true)
addEventHandler("las", getRootElement(), las)

function stare( thePlayer )
    setElementPosition ( thePlayer, -192, 1188, 20 )
end
addEvent("stare", true)
addEventHandler("stare", getRootElement(), stare)

function los( thePlayer )
    setElementPosition ( thePlayer, -192, 1188, 20 )
end
addEvent("los", true)
addEventHandler("los", getRootElement(), los)

function san( thePlayer )
    setElementPosition ( thePlayer, -192, 1188, 20 )
end
addEvent("san", true)
addEventHandler("san", getRootElement(), san)

function lasv( thePlayer )
    setElementPosition ( thePlayer, -192, 1188, 20 )
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: 5387 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: 42
Na forum: 4945 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: 5387 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: 42
Na forum: 4945 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: 5387 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: 5416 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6103

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