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

Wysłany: 2015-08-04, 00:27


serek123

Lua, MySql, Sql






Wiek: 27
Na forum: 4334 dni
Posty: 217
Nick w MP: Serek.

Piwa: 374

Respekt: 70

Witajcie mam problem z wybieraniem spawnu po zalogowaniu si?, bo on mi si? wy?wietla w czasie logowania wiem ?e trzeba da? chyba onPlayerLogin ale nie wiem gdzie za pomoc :piwo:
c-side

GUIEditor = {
    button = {},
    window = {}
}
GUIEditor.window[1] = guiCreateWindow(00220600"Wybierz gdzie chcesz rozpocz?? gr?"false)
guiWindowSetSizable(GUIEditor.window[1], false)

btnsf guiCreateButton(192918169"San Fierro"falseGUIEditor.window[1])

function teleportsf (player)
    guiSetVisible(GUIEditor.window[1], false)
    showCursor(false)
    triggerServerEvent("tpsf"rootlocalPlayer)
end
addEventHandler"onClientGUIClick"btnsfteleportsf )

s-side

function teleportsf (source)
spawnPlayersource, -1971.94470884.9084545.20313 )
end
addEvent("tpsf",true)
addEventHandler("tpsf"rootteleportsf)


Ostatnio zmieniony przez serek123 2015-08-04, 11:42, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-04, 01:02


#404







Wiek: 26
Na forum: 4771 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
Regulamin dzia?u Lua

Cytat:


2. Je?eli problem dotyczy gotowego kodu, nale?y takowy doda?.


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-04, 12:18


Vxen







Wiek: 27
Na forum: 4086 dni
Posty: 293

Piwa: 1299

Respekt: 130,5
Respekt: 130,5

Ogarnij sobie to w panelu logowania i po klikni?ciu na gui ma si? wy?wietli? wypiera?ka..
onClientGUIClick i do tego jeszcze normalne robisz gui i jeszcze raz onClientGUIClick i spawnPlayer.
https://wiki.multitheftauto.com/wiki/SpawnPlayer
https://wiki.multitheftauto.com/wiki/OnClientGUIClick


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-04, 14:00


serek123

Lua, MySql, Sql






Wiek: 27
Na forum: 4334 dni
Posty: 217
Nick w MP: Serek.

Piwa: 374

Respekt: 70

Vxen mam to pod panelem logowania ale i tak jak daje addEventHadler ("onPlayerLogin" , root, nazwa funkcji) to i tak nic nie robi bo jest dalej tak samo

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-08-04, 15:02


Vxen







Wiek: 27
Na forum: 4086 dni
Posty: 293

Piwa: 1299

Respekt: 130,5
Respekt: 130,5

Mam tu kogo? kod:
Spawn = {}
    showed true


    Spawn.Los_Santos guiCreateLabel(0.000.080.300.07""true)
    Spawn.San_Fierro guiCreateLabel(0.000.160.300.07""true)
    Spawn.Las_Venturas guiCreateLabel(0.000.250.300.07""true)
    Spawn.Fort_Carson guiCreateLabel(0.000.330.300.07""true)
    --Spawn.OZP guiCreateLabel(0.000.410.300.07""true)    
    Spawn.Los_Santos:setVisible false );
    Spawn.San_Fierro:setVisible false );
    Spawn.Las_Venturas:setVisible false );
    Spawn.Fort_Carson:setVisible false );
    --.OZP:setVisible false );

function Spawn.Panel()
    if showed == true then
        dxDrawRectangle(screenW 0.000screenH 0.000screenW 0.299screenH 0.069tocolor(000172), false)
        dxDrawText("Wyb?r Spawnu!"screenW 0.007screenH 0.000, (screenW 0.007) + 397, ( screenH 0.000) + 53tocolor(255255255255), 2.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Los Santos"screenW 0.000screenH 0.082screenW 0.299screenH 0.151tocolor(255255255255), 2.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("San Fierro"screenW 0.000screenH 0.164screenW 0.299screenH 0.233tocolor(255255255255), 2.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Las Venturas"screenW 0.000screenH 0.246screenW 0.299screenH 0.315tocolor(255255255255), 2.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Fort Carson"screenW 0.000screenH 0.328screenW 0.299screenH 0.397tocolor(255255255255), 2.00"default-bold""center""center"falsefalsefalsefalsefalse)
        dxDrawText("Aby zaakceptowa? sw?j wyb?r\n kliknij dwa razy!"screenW 0.000screenH 0.410screenW 0.299screenH 0.479tocolor(255255255255), 1.60"default-bold""center""center"falsefalsefalsefalsefalse)
    end
end

function Spawn.Los_Santos_Dx()
    if showed == true then
        dxDrawRectangle(screenW 0.000screenH 0.082screenW 0.299screenH 0.069tocolor(000172), false)
    end
end

function Spawn.San_Fierro_Dx()
    if showed == true then
        dxDrawRectangle(screenW 0.000screenH 0.164screenW 0.299screenH 0.069tocolor(000172), false)
    end
end

function Spawn.Las_Venturas_Dx()
    if showed == true then
        dxDrawRectangle(screenW 0.000screenH 0.246screenW 0.299screenH 0.069tocolor(000172), false)
    end
end

function Spawn.Fort_Carson_Dx()
    if showed == true then
        dxDrawRectangle(screenW 0.000screenH 0.328screenW 0.299screenH 0.069tocolor(000172), false)
    end
end

function Spawn.OZP_Dx()
    if showed == true then
        dxDrawRectangle(screenW 0.000screenH 0.410screenW 0.299screenH 0.069tocolor(000172), false)
    end
end 

-- Add

function Spawn.Los_Santos_Dx_On()
    dxDrawRectangle(screenW 0.000screenH 0.082screenW 0.299screenH 0.069tocolor(71173195212), false)
end

function Spawn.San_Fierro_Dx_On()
    dxDrawRectangle(screenW 0.000screenH 0.164screenW 0.299screenH 0.069tocolor(71173195212), false)
end

function Spawn.Las_Venturas_Dx_On()
    dxDrawRectangle(screenW 0.000screenH 0.246screenW 0.299screenH 0.069tocolor(71173195212), false)
end

function Spawn.Fort_Carson_Dx_On()
    dxDrawRectangle(screenW 0.000screenH 0.328screenW 0.299screenH 0.069tocolor(71173195212), false)
end

--function Spawn.OZP_Dx_On()
    --dxDrawRectangle(screenW 0.000screenH 0.410screenW 0.299screenH 0.069tocolor(71173195212), false)
--end 


addEvent ("Zacznij"true)
addEventHandler ("Zacznij"root,
function ()
    show false
    showed =  true
    Panel.Edit_Haslo:setVisible false );
    Panel.Edit_Login:setVisible false );
    Panel.Label_Login:setVisible false );
    Panel.Informacje:setVisible false );
    Panel.Label_Rejka:setVisible false );
    removeEventHandler ("onClientRender"rootPanel.Grafika);
    removeEventHandler ("onClientRender"rootPanel.Button_Haslo_Off);
    removeEventHandler ("onClientRender"rootPanel.Button_Login_Off);
    removeEventHandler ("onClientRender"rootPanel.Button_Haslo_On);
    removeEventHandler ("onClientRender"rootPanel.Button_Login_On);
    addEventHandler ("onClientRender"rootSpawn.Los_Santos_Dx)
    addEventHandler ("onClientRender"rootSpawn.San_Fierro_Dx)
    addEventHandler ("onClientRender"rootSpawn.Las_Venturas_Dx)
    addEventHandler ("onClientRender"rootSpawn.Fort_Carson_Dx)
    addEventHandler ("onClientRender"rootSpawn.OZP_Dx)
    removeEventHandler ("onClientRender"rootSpawn.Los_Santos_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.San_Fierro_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Las_Venturas_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Fort_Carson_Dx_On)
    --removeEventHandler ("onClientRender"rootSpawn.OZP_Dx_On)
    addEventHandler ("onClientRender"rootSpawn.Panel)
    Spawn.Los_Santos:setVisible true );
    Spawn.San_Fierro:setVisible true );
    Spawn.Las_Venturas:setVisible true );
    Spawn.Fort_Carson:setVisible true );
    --Spawn.OZP:setVisible true );
end)

addEventHandler ("onClientMouseEnter"Spawn.Los_Santos,
function ()
    removeEventHandler ("onClientRender"rootSpawn.Los_Santos_Dx)
    addEventHandler ("onClientRender"rootSpawn.Los_Santos_Dx_On)
    smoothMoveCameraa (1895.091796875, -1807.142089843870.458423614502,
    1573.9093017578, -1722.677001953152.467288970947,
    1422.9503173828, -1728.380004882822.484668731689,
    1478.8485107422, -1662.471801757825.742967605591,
    12000 );
    removeEventHandler ("onClientRender"rootSpawn.Panel)
    addEventHandler ("onClientRender"rootSpawn.Panel)
endfalse)


addEventHandler ("onClientMouseLeave"Spawn.Los_Santos,
function ()
    addEventHandler ("onClientRender"rootSpawn.Los_Santos_Dx)
    removeEventHandler ("onClientRender"rootSpawn.Los_Santos_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Panel)
    addEventHandler ("onClientRender"rootSpawn.Panel)
endfalse)

-- Sf

addEventHandler ("onClientMouseEnter"Spawn.San_Fierro,
function ()
    removeEventHandler ("onClientRender"rootSpawn.San_Fierro_Dx)
    addEventHandler ("onClientRender"rootSpawn.San_Fierro_Dx_On)
    smoothMoveCameraa (-2680.894781677.4040589.47169,
    -2681.046391438.6342876.17654,
    -2680.825201294.8214165.73161,
    -2680.113771197.1873875.04411,
    12000 );
    removeEventHandler ("onClientRender"rootSpawn.Panel)
    addEventHandler ("onClientRender"rootSpawn.Panel)
endfalse)


addEventHandler ("onClientMouseLeave"Spawn.San_Fierro,
function ()
    addEventHandler ("onClientRender"rootSpawn.San_Fierro_Dx)
    removeEventHandler ("onClientRender"rootSpawn.San_Fierro_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Panel)
    addEventHandler ("onClientRender"rootSpawn.Panel)
endfalse)

-- LV

addEventHandler ("onClientMouseEnter"Spawn.Las_Venturas,
function ()
    removeEventHandler ("onClientRender"rootSpawn.Las_Venturas_Dx)
    addEventHandler ("onClientRender"rootSpawn.Las_Venturas_Dx_On)
    smoothMoveCameraa (2323.818851283.0836297.47743,
    2292.171631283.9635061.43044,
    2129.380861286.0981449.42192,
    2176.603271285.8728041.17391,
    12000)
    removeEventHandler ("onClientRender"rootSpawn.Panel)
    addEventHandler ("onClientRender"rootSpawn.Panel)
endfalse)


addEventHandler ("onClientMouseLeave"Spawn.Las_Venturas,
function ()
    addEventHandler ("onClientRender"rootSpawn.Las_Venturas_Dx)
    removeEventHandler ("onClientRender"rootSpawn.Las_Venturas_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Panel)
    addEventHandler ("onClientRender"rootSpawn.Panel)
endfalse)

-- FC

addEventHandler ("onClientMouseEnter"Spawn.Fort_Carson,
function ()
    removeEventHandler ("onClientRender"rootSpawn.Fort_Carson_Dx)
    addEventHandler ("onClientRender"rootSpawn.Fort_Carson_Dx_On)
    smoothMoveCameraa (206.528521035.6744438.83426,
    189.906481078.4890143.67355,
    173.141421161.0489526.81353,
    169.982701200.9669230.19880,
    12000 );
    removeEventHandler ("onClientRender"rootSpawn.Panel)
    addEventHandler ("onClientRender"rootSpawn.Panel)
endfalse)


addEventHandler ("onClientMouseLeave"Spawn.Fort_Carson,
function ()
    addEventHandler ("onClientRender"rootSpawn.Fort_Carson_Dx)
    removeEventHandler ("onClientRender"rootSpawn.Fort_Carson_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Panel)
    addEventHandler ("onClientRender"rootSpawn.Panel)
endfalse)

-- OZP

--addEventHandler ("onClientMouseEnter"Spawn.OZP,
--function ()
    --removeEventHandler ("onClientRender"rootSpawn.OZP_Dx)
    --addEventHandler ("onClientRender"rootSpawn.OZP_Dx_On)
    --removeEventHandler ("onClientRender"rootSpawn.Panel)
    --addEventHandler ("onClientRender"rootSpawn.Panel)
--endfalse)


--addEventHandler ("onClientMouseLeave"Spawn.OZP,
--function ()
    --addEventHandler ("onClientRender"rootSpawn.OZP_Dx)
    --removeEventHandler ("onClientRender"rootSpawn.OZP_Dx_On)
    --removeEventHandler ("onClientRender"rootSpawn.Panel)
    --addEventHandler ("onClientRender"rootSpawn.Panel)
--endfalse)

-- Klikanie

addEventHandler ("onClientGUIDoubleClick"Spawn.Los_Santos,
function ()
    showed false
    showPlayerHudComponent("all",true);
    triggerServerEvent ("LS_Spawn"rootlocalPlayer)
    player getLocalPlayer()
    setCameraTarget (player)
    showChat true )
    showCursor false )
    removeEventHandler "onClientPreRender"getRootElement(), camRender )
    removeEventHandler ("onClientRender"rootSpawn.Los_Santos_Dx)
    removeEventHandler ("onClientRender"rootSpawn.San_Fierro_Dx)
    removeEventHandler ("onClientRender"rootSpawn.Las_Venturas_Dx)
    removeEventHandler ("onClientRender"rootSpawn.Fort_Carson_Dx)
    removeEventHandler ("onClientRender"rootSpawn.OZP_Dx)
    removeEventHandler ("onClientRender"rootSpawn.Los_Santos_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.San_Fierro_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Las_Venturas_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Fort_Carson_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.OZP_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Panel)
    Spawn.Los_Santos:setVisible false );
    Spawn.San_Fierro:setVisible false );
    Spawn.Las_Venturas:setVisible false );
    Spawn.Fort_Carson:setVisible false );
    --Spawn.OZP:setVisible false );
endfalse
)

addEventHandler ("onClientGUIDoubleClick"Spawn.San_Fierro,
function ()
    showed false
    showPlayerHudComponent("all",true);
    triggerServerEvent ("SF_Spawn"rootlocalPlayer)
    player getLocalPlayer()
    setCameraTarget (player)
    showChat true )
    showCursor false )
    removeEventHandler "onClientPreRender"getRootElement(), camRender )
    removeEventHandler ("onClientRender"rootSpawn.Los_Santos_Dx)
    removeEventHandler ("onClientRender"rootSpawn.San_Fierro_Dx)
    removeEventHandler ("onClientRender"rootSpawn.Las_Venturas_Dx)
    removeEventHandler ("onClientRender"rootSpawn.Fort_Carson_Dx)
    removeEventHandler ("onClientRender"rootSpawn.OZP_Dx)
    removeEventHandler ("onClientRender"rootSpawn.Los_Santos_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.San_Fierro_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Las_Venturas_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Fort_Carson_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.OZP_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Panel)
    Spawn.Los_Santos:setVisible false );
    Spawn.San_Fierro:setVisible false );
    Spawn.Las_Venturas:setVisible false );
    Spawn.Fort_Carson:setVisible false );
    --Spawn.OZP:setVisible false );
endfalse
)

addEventHandler ("onClientGUIDoubleClick"Spawn.Las_Venturas,
function ()
    showed false
    showPlayerHudComponent("all",true);
    triggerServerEvent ("LV_Spawn"rootlocalPlayer)
    player getLocalPlayer()
    setCameraTarget (player)
    showChat true )
    showCursor false )
    removeEventHandler "onClientPreRender"getRootElement(), camRender )
    removeEventHandler ("onClientRender"rootSpawn.Los_Santos_Dx)
    removeEventHandler ("onClientRender"rootSpawn.San_Fierro_Dx)
    removeEventHandler ("onClientRender"rootSpawn.Las_Venturas_Dx)
    removeEventHandler ("onClientRender"rootSpawn.Fort_Carson_Dx)
    removeEventHandler ("onClientRender"rootSpawn.OZP_Dx)
    removeEventHandler ("onClientRender"rootSpawn.Los_Santos_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.San_Fierro_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Las_Venturas_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Fort_Carson_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.OZP_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Panel)
    Spawn.Los_Santos:setVisible false );
    Spawn.San_Fierro:setVisible false );
    Spawn.Las_Venturas:setVisible false );
    Spawn.Fort_Carson:setVisible false );
    --Spawn.OZP:setVisible false );
endfalse
)

addEventHandler ("onClientGUIDoubleClick"Spawn.Fort_Carson,
function ()
    showed false
    showPlayerHudComponent("all",true);
    triggerServerEvent ("For_Spawn"rootlocalPlayer)
    player getLocalPlayer()
    setCameraTarget (player)
    showChat true )
    showCursor false )
    removeEventHandler "onClientPreRender"getRootElement(), camRender )
    removeEventHandler ("onClientRender"rootSpawn.Los_Santos_Dx)
    removeEventHandler ("onClientRender"rootSpawn.San_Fierro_Dx)
    removeEventHandler ("onClientRender"rootSpawn.Las_Venturas_Dx)
    removeEventHandler ("onClientRender"rootSpawn.Fort_Carson_Dx)
    removeEventHandler ("onClientRender"rootSpawn.OZP_Dx)
    removeEventHandler ("onClientRender"rootSpawn.Los_Santos_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.San_Fierro_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Las_Venturas_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Fort_Carson_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.OZP_Dx_On)
    removeEventHandler ("onClientRender"rootSpawn.Panel)
    Spawn.Los_Santos:setVisible false );
    Spawn.San_Fierro:setVisible false );
    Spawn.Las_Venturas:setVisible false );
    Spawn.Fort_Carson:setVisible false );
    --Spawn.OZP:setVisible false );
endfalse
)

--addEventHandler ("onClientGUIDoubleClick"Spawn.OZP,
--function ()
--outputChatBox ("OStatnio Zapisana Pozycja")
--endfalse
--)

Jak ja to wklei?em do swojego to mi to dzia?a?o...

Postaw piwo autorowi tego posta
 

 
Tagi: pozalogowaniu :: gry
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