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

Wysłany: 2016-03-26, 17:05


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

Hej. Przetestowa?em panel logowania na lokalnym, problem tkwi w tym, ?e po ponownym zalogowaniu na serwer mamy skina o ID: 0 ,,CJ".
Podaje kod, chcia?bym aby nie dawa?o skina o ID 0 przeszuka?em ca?e dwa pliki i nic nie znalaz?em o skinach. Mo?e wam si? uda. O zapisywanie skina i itp. to ja mam osobny na to skrypt.
Strona clienta:

local Panel = {}
local show true
local sm = {}
sm.moov 0
sm.object1sm.object2 nilnil

local function camRender ()
    local x1y1z1 getElementPosition sm.object1 )
    local x2y2z2 getElementPosition sm.object2 )
    setCameraMatrix x1y1z1x2y2z2 )
end
 
local function removeCamHandler ()
    if(sm.moov == 1then
        sm.moov 0
        removeEventHandler "onClientPreRender"getRootElement(), camRender )
    end
end
 
function smoothMoveCameraa x1y1z1x1ty1tz1tx2y2z2x2ty2tz2ttime )
    if(sm.moov == 1then return false end
    sm.object1 createObject 1337x1y1z1 )
    sm.object2 createObject 1337x1ty1tz1t )
    setElementAlpha sm.object1)
    setElementAlpha sm.object2)
    setObjectScale(sm.object10.01)
    setObjectScale(sm.object20.01)
    moveObject sm.object1timex2y2z2000"InOutQuad" )
    moveObject sm.object2timex2ty2tz2t000"InOutQuad" )
 
    addEventHandler "onClientPreRender"getRootElement(), camRender )
    sm.moov 1
    setTimer removeCamHandlertime)
    setTimer destroyElementtime1sm.object1 )
    setTimer destroyElementtime1sm.object2 )
    return true
end


Panel.Label_Login guiCreateLabel(0.420.5540.150.04"Zaloguj"true)
guiSetFont(Panel.Label_Login"default-bold-small")
guiLabelSetHorizontalAlign(Panel.Label_Login"center"false)
guiLabelSetVerticalAlign(Panel.Label_Login"center")
Panel.Label_Login:setVisible false );
Panel.Label_Rejka guiCreateLabel(0.420.6110.150.04"Zarejestruj"true)
guiSetFont(Panel.Label_Rejka"default-bold-small")
guiLabelSetHorizontalAlign(Panel.Label_Rejka"center"false)
guiLabelSetVerticalAlign(Panel.Label_Rejka"center")
Panel.Label_Rejka:setVisible false );
Panel.Edit_Login guiCreateEdit(0.420.450.150.04""true)
Panel.Edit_Login:setVisible false );
Panel.Edit_Haslo guiCreateEdit(0.420.510.150.04""true)    
guiEditSetMasked(Panel.Edit_Haslotrue)    
Panel.Edit_Haslo:setVisible false );
Panel.Informacje guiCreateLabel(0.260.380.470.05""true)
guiSetFont(Panel.Informacje"default-bold-small")
guiLabelSetColor(Panel.Informacje71173195)
guiLabelSetHorizontalAlign(Panel.Informacje"center"false)
guiLabelSetVerticalAlign(Panel.Informacje"center")    
Panel.Informacje:setVisible false );

local screenWscreenH guiGetScreenSize()
function Panel.Grafika()
    dxDrawRectangle(screenW 0.263screenH 0.378screenW 0.474screenH 0.284tocolor(000188), false)
    dxDrawRectangle(screenW 0.263screenH 0.313screenW 0.474screenH 0.065tocolor(686868182), false)
    dxDrawText("DeteStories [RPG]"screenW 0.558screenH 0.313screenW 0.738screenH 0.378tocolor(255255255255), 1.20"default-bold""center""center"falsefalsefalsefalsefalse)
    dxDrawText("Nick:"screenW 0.329screenH 0.453screenW 0.424screenH 0.488tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
    dxDrawText("Has?o:"screenW 0.329screenH 0.507screenW 0.424screenH 0.542tocolor(255255255255), 1.00"default-bold""center""center"falsefalsefalsefalsefalse)
end

function Panel.Button_Login_Off()
    if show == true then
        dxDrawRectangle(screenW 0.420screenH 0.555screenW 0.150screenH 0.043tocolor(686868209), false)
    end
end

function Panel.Button_Haslo_Off()
    dxDrawRectangle(screenW 0.420screenH 0.611screenW 0.150screenH 0.043tocolor(686868209), false)
end

function Panel.Button_Login_On()
    dxDrawRectangle(screenW 0.420screenH 0.555screenW 0.150screenH 0.043tocolor(71173195212), false)
end

function Panel.Button_Haslo_On()
    dxDrawRectangle(screenW 0.420screenH 0.611screenW 0.150screenH 0.043tocolor(71173195212), false)
end

addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()), 
function ()
    smoothMoveCameraa (1895.091796875, -1807.142089843870.458423614502,
    1573.9093017578, -1722.677001953152.467288970947,
    1422.9503173828, -1728.380004882822.484668731689,
    1478.8485107422, -1662.471801757825.742967605591,
    12000 );
    show true
    fadeCamera (true);
    showChat (false);
    showPlayerHudComponent("all",false);
    showCursor true );
    Panel.Edit_Haslo:setVisible true );
    Panel.Edit_Login:setVisible true );
    Panel.Label_Login:setVisible true );
    Panel.Informacje:setVisible true );
    Panel.Label_Rejka:setVisible true );
    addEventHandler ("onClientRender"rootPanel.Grafika);
    addEventHandler ("onClientRender"rootPanel.Button_Haslo_Off);
    addEventHandler ("onClientRender"rootPanel.Button_Login_Off);
    removeEventHandler ("onClientRender"rootPanel.Button_Haslo_On);
    removeEventHandler ("onClientRender"rootPanel.Button_Login_On);
end)

addEventHandler ("onClientMouseEnter"Panel.Label_Login,
function ()
    removeEventHandler ("onClientRender"rootPanel.Button_Login_Off)
    addEventHandler ("onClientRender"rootPanel.Button_Login_On)
endfalse)


addEventHandler ("onClientMouseLeave"Panel.Label_Login,
function ()
    addEventHandler ("onClientRender"rootPanel.Button_Login_Off)
    removeEventHandler ("onClientRender"rootPanel.Button_Login_On)
endfalse)

addEventHandler ("onClientMouseEnter"Panel.Label_Rejka,
function ()
    removeEventHandler ("onClientRender"rootPanel.Button_Haslo_Off)
    removeEventHandler ("onClientRender"rootPanel.Button_Haslo_On)
    addEventHandler ("onClientRender"rootPanel.Button_Haslo_On)
endfalse)


addEventHandler ("onClientMouseLeave"Panel.Label_Rejka,
function ()
    removeEventHandler ("onClientRender"rootPanel.Button_Haslo_Off)
    addEventHandler ("onClientRender"rootPanel.Button_Haslo_Off)
    removeEventHandler ("onClientRender"rootPanel.Button_Haslo_On)
endfalse)

function onClickBtnLogin(button,state)
    if(button == "left" and state == "up"then
        username guiGetText(Panel.Edit_Login)
        password guiGetText(Panel.Edit_Haslo)
        checksave true
        triggerServerEvent("onRequestLogin",getLocalPlayer(),username,password,passwordConfirm,checksave)
    end
end
addEventHandler ("onClientGUIClick"Panel.Label_LoginonClickBtnLoginfalse)

function onClickBtnRegister(button,state)
    if(button == "left" and state == "up"then
        username guiGetText(Panel.Edit_Login)
        password guiGetText(Panel.Edit_Haslo)
        triggerServerEvent("onRequestRegister",getLocalPlayer(),username,password,password)
    end
end
addEventHandler ("onClientGUIClick"Panel.Label_RejkaonClickBtnRegisterfalse)

addEvent ("Spawn"true)
addEventHandler ("Spawn"root,
function ()

end
)

addEvent ("nick"true)
addEventHandler ("nick"root, 
function ()
    text Panel.Informacje:setText ("Uzupe?nij nick.")
end)

addEvent ("Zaloguj"true)
addEventHandler ("Zaloguj"root,
function ()
    text Panel.Informacje:setText ("Rejestracja udana. Mo?esz si? zalogowa?.")
end)

addEvent ("Konto_jest"true)
addEventHandler ("Konto_jest"root,
function ()
    text Panel.Informacje:setText ("Takie konto nie istnieje!")
end
)

addEvent ("Nick_Konto"true)
addEventHandler ("Nick_Konto"root,
function ()
    text Panel.Informacje:setText ("Podany nick jest ju? zaj?ty. Wybierz inny.")
end
)

addEvent ("Brak_Haslo"true)
addEventHandler ("Brak_Haslo"root,
function ()
    text Panel.Informacje:setText ("Uzupe?nij has?o.")
end
)



    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("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)
    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 ()
--endfalse
--)


Troch? du?o tego kodu jest ;/ W razie potrzeby dam stron? serwera.

Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-26, 17:08


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Login panel nic nie ma, a przynajmniej nie c-side.

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-26, 17:12


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

AteX, s-side:


function PlayerLogin(username,password,checksave)
    if not (username == ""then
        if not (password == ""then
            local account getAccount username,password )
                if ( account ~= false then
                    logIn(sourceaccountpassword)
                        setCameraTarget(sourcesource)
                    outputChatBox ("Gratulacje! Zalogowa?e? si? poprawnie!")
                triggerClientEvent (source,"Zacznij",getRootElement())
                toggleControl (source"fire"false)
                toggleControl (source"aim_weapon"false)
            end
        end
    end
end                        
addEvent("onRequestLogin",true)
addEventHandler("onRequestLogin",getRootElement(),PlayerLogin)

function registerPlayer(username,password,passwordConfirm)
    if not (username == ""then
        if not (password == ""then
                    local account getAccount (username,password)
                    if (account == falsethen
                        local accountAdded addAccount(tostring(username),tostring(password))
                        if (accountAddedthen
                            triggerClientEvent (source"Zaloguj"rootsource)
                        else
                            triggerClientEventsource"Konto_jest"rootsource)                        
                        end
                    else
                        triggerClientEvent source"Nick_Konto"rootsource)
                    end
        else
            triggerClientEvent source"Brak_Haslo"rootsource)
        end
    else
        triggerClientEvent (source"nick"rootsource)
        end
        end
                                               
        
addEvent("onRequestRegister",true)
addEventHandler("onRequestRegister",getRootElement(),registerPlayer)


function playerLoginthePlayer )
end
addEventHandler("onPlayerLogin"getRootElement(), playerLogin)

function playerJointhePlayer )
spawnPlayer(thePlayer,0,0,0,0)
end
addEventHandler("onPlayerJoin"getRootElement(), playerLogin)

addEvent ("For_Spawn"true)
addEventHandler ("For_Spawn"root,
function ( plr )
plr:spawn 13.960341189.9810819.31405)
end)

addEvent ("LV_Spawn"true)
addEventHandler ("LV_Spawn"root,
function ( plr )
plr:spawn 2080.886471285.6953110.82031 )
end
)

addEvent ("LS_Spawn"true)
addEventHandler ("LS_Spawn"root,
function ( plr )
plr:spawn 1481.23022, -1749.4438515.44531 )
end
)

addEvent ("SF_Spawn"true)
addEventHandler ("SF_Spawn"root,
function ( plr )
plr:spawn ( -1931.59668487.3322134.30988 )
end
)


Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-26, 17:13


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Nic nie ma, w takim razie to zapis ci co? nie dzia?a.

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-26, 17:14


Emm

***** ***






Wiek: 32
Na forum: 3880 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6162

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
function playerJointhePlayer )
spawnPlayer(thePlayer,0,0,0,0)
end
addEventHandler("onPlayerJoin"getRootElement(), playerLogin)


Tutaj masz - w spawnPlayer

Więcej informacji znajdziesz w Wikipedii MTA:

spawnPlayer

W ostatnim argumencie masz id skina - ustawione na 0

Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-26, 17:15


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

AteX, yhymm..
ka?dy zapis patrza?em i nie zapisuje... ;)

[ Dodano: 2016-03-26, 17:16 ]
Emm, a ok. Czyli usun? ostatni argument i b?dzie dzia?a?o?

Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-26, 17:21


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

"Emm" napisał/a:

function playerJointhePlayer )
spawnPlayer(thePlayer,0,0,0,0)
end
addEventHandler("onPlayerJoin"getRootElement(), playerLogin)


Tutaj masz - w spawnPlayer

Więcej informacji znajdziesz w Wikipedii MTA:

spawnPlayer

W ostatnim argumencie masz id skina - ustawione na 0


To rotacja, a nie skin.

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Ostatnio zmieniony przez AteX 2016-03-26, 17:21, w całości zmieniany 2 razy  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-26, 17:21


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

Emm, Nadal nic. Przy wybieraniu spawnu wida? chwilowo m?j stary skin, ale po zalogowaniu nadal skin 0.

Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-26, 17:22


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Mo?e masz inny skrypt, kt?ry ci zmienia skin?

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-26, 17:23


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

AteX, zapisuje... nie zmienia

Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-26, 17:25


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

... chodzi mi oto ?e mo?esz mie? jaki? skrypt, kt?ry zmienia ci tego skina na id 0 i nawet o nim nie wiesz.

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-26, 17:26


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

AteX, Nie mam ?adnego.

Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-26, 17:27


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Poka? ten zapis, bo w login panelu nic nie ma. Wi?c albo inny skrypt ci to robi albo zapis jest ?le napisany.

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-26, 17:30


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

AteX, zapis wzi??em z community jedynie taki znalaz?em:
S-side

function playerLogin (thePreviousAccounttheCurrentAccountautoLogin)
  if  not (isGuestAccount (getPlayerAccount (source))) then
    local accountData getAccountData (theCurrentAccount"funmodev2-money")
    if (accountDatathen
      local playerMoney getAccountData (theCurrentAccount"funmodev2-money")
      local playerSkin getAccountData (theCurrentAccount"funmodev2-skin")
      local playerHealth getAccountData (theCurrentAccount"funmodev2-health")
      local playerArmor getAccountData (theCurrentAccount"funmodev2-armor")
      local playerX getAccountData (theCurrentAccount"funmodev2-x")
      local playerY getAccountData (theCurrentAccount"funmodev2-y")
      local playerZ getAccountData (theCurrentAccount"funmodev2-z")
      local playerInt getAccountData (theCurrentAccount"funmodev2-int")
      local playerDim getAccountData (theCurrentAccount"funmodev2-dim")
      local playerWanted getAccountData (theCurrentAccount"funmodev2-wantedlevel")
     local playerTeam getAccountData (theCurrentAccount"funmodev2-Team")
      local playerWeaponID0 getAccountData (theCurrentAccount"funmodev2-weaponID0")
      local playerWeaponID1 getAccountData (theCurrentAccount"funmodev2-weaponID1")
      local playerWeaponID2 getAccountData (theCurrentAccount"funmodev2-weaponID2")
      local playerWeaponID3 getAccountData (theCurrentAccount"funmodev2-weaponID3")
      local playerWeaponID4 getAccountData (theCurrentAccount"funmodev2-weaponID4")
      local playerWeaponID5 getAccountData (theCurrentAccount"funmodev2-weaponID5")
      local playerWeaponID6 getAccountData (theCurrentAccount"funmodev2-weaponID6")
      local playerWeaponID7 getAccountData (theCurrentAccount"funmodev2-weaponID7")
      local playerWeaponID8 getAccountData (theCurrentAccount"funmodev2-weaponID8")
      local playerWeaponID9 getAccountData (theCurrentAccount"funmodev2-weaponID9")
      local playerWeaponID10 getAccountData (theCurrentAccount"funmodev2-weaponID10")
      local playerWeaponID11 getAccountData (theCurrentAccount"funmodev2-weaponID11")
      local playerWeaponID12 getAccountData (theCurrentAccount"funmodev2-weaponID12")
      local playerWeaponAmmo0 getAccountData (theCurrentAccount"funmodev2-weaponAmmo0")
      local playerWeaponAmmo1 getAccountData (theCurrentAccount"funmodev2-weaponAmmo1")
      local playerWeaponAmmo2 getAccountData (theCurrentAccount"funmodev2-weaponAmmo2")
      local playerWeaponAmmo3 getAccountData (theCurrentAccount"funmodev2-weaponAmmo3")
      local playerWeaponAmmo4 getAccountData (theCurrentAccount"funmodev2-weaponAmmo4")
      local playerWeaponAmmo5 getAccountData (theCurrentAccount"funmodev2-weaponAmmo5")
      local playerWeaponAmmo6 getAccountData (theCurrentAccount"funmodev2-weaponAmmo6")
      local playerWeaponAmmo7 getAccountData (theCurrentAccount"funmodev2-weaponAmmo7")
      local playerWeaponAmmo8 getAccountData (theCurrentAccount"funmodev2-weaponAmmo8")
      local playerWeaponAmmo9 getAccountData (theCurrentAccount"funmodev2-weaponAmmo9")
      local playerWeaponAmmo10 getAccountData (theCurrentAccount"funmodev2-weaponAmmo10")
      local playerWeaponAmmo11 getAccountData (theCurrentAccount"funmodev2-weaponAmmo11")
      local playerWeaponAmmo12 getAccountData (theCurrentAccount"funmodev2-weaponAmmo12")
      spawnPlayer (sourceplayerXplayerYplayerZ +10playerSkinplayerIntplayerDim)
      setPlayerMoney (sourceplayerMoney)
      setTimer (setElementHealth5001sourceplayerHealth)
      setTimer (setPedArmor5001sourceplayerArmor)
      setTimer (setPlayerWantedLevel5001sourceplayerWanted)
      giveWeapon(sourceplayerWeaponID0playerWeaponAmmo0true)
      giveWeapon(sourceplayerWeaponID1playerWeaponAmmo1false)
      giveWeapon(sourceplayerWeaponID2playerWeaponAmmo2false)
      giveWeapon(sourceplayerWeaponID3playerWeaponAmmo3false)
      giveWeapon(sourceplayerWeaponID4playerWeaponAmmo4false)
      giveWeapon(sourceplayerWeaponID5playerWeaponAmmo5false)
      giveWeapon(sourceplayerWeaponID6playerWeaponAmmo6false)
      giveWeapon(sourceplayerWeaponID7playerWeaponAmmo7false)
      giveWeapon(sourceplayerWeaponID8playerWeaponAmmo8false)
      giveWeapon(sourceplayerWeaponID9playerWeaponAmmo9false)
      giveWeapon(sourceplayerWeaponID10playerWeaponAmmo10false)
      giveWeapon(sourceplayerWeaponID11playerWeaponAmmo11false)
      giveWeapon(sourceplayerWeaponID12playerWeaponAmmo12false)
      setCameraTarget (sourcesource)
      fadeCamera(sourcetrue2.0)
    else
      spawnPlayer (source1481.0855712891, -1771.299682617218.7957534790040,7800)
      setPlayerMoney (source200)
      setCameraTarget (sourcesource)
      fadeCamera(sourcetrue2.0)  
    end   
  end
end
addEventHandler ("onPlayerLogin"getRootElement(), playerLogin)

function onLogout ()
    kickPlayer (sourcenil"Logging out is disallowed.")
end
addEventHandler ("onPlayerLogout"getRootElement(), onLogout)

function onQuit (quitTypereasonresponsibleElement)
  if not (isGuestAccount (getPlayerAccount (source))) then
    account getPlayerAccount (source)
    if (accountthen
      local x,y,getElementPosition (source)
      setAccountData (account"funmodev2-money"tostring (getPlayerMoney (source)))
      setAccountData (account"funmodev2-skin"tostring (getPedSkin (source)))
      setAccountData (account"funmodev2-health"tostring (getElementHealth (source)))
      setAccountData (account"funmodev2-armor"tostring (getPedArmor (source)))
      setAccountData (account"funmodev2-R"r)
      setAccountData (account"funmodev2-G"g)
      setAccountData (account"funmodev2-B"b)
      setAccountData (account"funmodev2-x"x)
      setAccountData (account"funmodev2-y"y)
      setAccountData (account"funmodev2-z"z)
      setAccountData (account"funmodev2-int"getElementInterior (source))
      setAccountData (account"funmodev2-dim"getElementDimension (source))
      setAccountData (account"funmodev2-wantedlevel"getPlayerWantedLevel (source))
      setAccountData (account"funmodev2-weaponID0"getPedWeapon (source0))
      setAccountData (account"funmodev2-weaponID1"getPedWeapon (source1))
      setAccountData (account"funmodev2-weaponID2"getPedWeapon (source2))
      setAccountData (account"funmodev2-weaponID3"getPedWeapon (source3))
      setAccountData (account"funmodev2-weaponID4"getPedWeapon (source4))
      setAccountData (account"funmodev2-weaponID5"getPedWeapon (source5))
      setAccountData (account"funmodev2-weaponID6"getPedWeapon (source6))
      setAccountData (account"funmodev2-weaponID7"getPedWeapon (source7))
      setAccountData (account"funmodev2-weaponID8"getPedWeapon (source8))
      setAccountData (account"funmodev2-weaponID9"getPedWeapon (source9))
      setAccountData (account"funmodev2-weaponID10"getPedWeapon (source10))
      setAccountData (account"funmodev2-weaponID11"getPedWeapon (source11))
      setAccountData (account"funmodev2-weaponID12"getPedWeapon (source12))
      setAccountData (account"funmodev2-weaponAmmo0"getPedTotalAmmo (source0))
      setAccountData (account"funmodev2-weaponAmmo1"getPedTotalAmmo (source1))
      setAccountData (account"funmodev2-weaponAmmo2"getPedTotalAmmo (source2))
      setAccountData (account"funmodev2-weaponAmmo3"getPedTotalAmmo (source3))
      setAccountData (account"funmodev2-weaponAmmo4"getPedTotalAmmo (source4))
      setAccountData (account"funmodev2-weaponAmmo5"getPedTotalAmmo (source5))
      setAccountData (account"funmodev2-weaponAmmo6"getPedTotalAmmo (source6))
      setAccountData (account"funmodev2-weaponAmmo7"getPedTotalAmmo (source7))
      setAccountData (account"funmodev2-weaponAmmo8"getPedTotalAmmo (source8))
      setAccountData (account"funmodev2-weaponAmmo9"getPedTotalAmmo (source9))
      setAccountData (account"funmodev2-weaponAmmo10"getPedTotalAmmo (source10))
      setAccountData (account"funmodev2-weaponAmmo11"getPedTotalAmmo (source11))
      setAccountData (account"funmodev2-weaponAmmo12"getPedTotalAmmo (source12))
    end
  end
end
addEventHandler ("onPlayerQuit"getRootElement(), onQuit)

function onWasted(totalAmmokillerkillerWeaponbodypartstealth)
  if notisGuestAccount (getPlayerAccount(source)) ) then
    local theWeapon getPedWeapon (source)
    local weaponAmmo getPedTotalAmmo (source)
    fadeCamera (sourcefalse)
    setTimer (spawnPlayer10001source2036.1735839844, -1413.056396484416.99218750getPedSkin (source), 00getPlayerTeam(source))
    setTimer (setCameraTarget12501sourcesource)
    setTimer (fadeCamera20001sourcetrue)
    setTimer (giveWeapon20001sourcetheWeaponweaponAmmotrue)
  end
end
addEventHandler ("onPlayerWasted"getRootElement(), onWasted)

---

function setTeam()
local account getPlayerAccount(source) -- gets players account
local team getAccountData (account"team") -- gets players team
if (team) and getTeamFromName(teamthen
      setPlayerTeam(sourcegetTeamFromName(team)) -- sets players team
     end
end
addEventHandler("onPlayerLogin",root,setTeam) -- sets players team on login
 
function save()
 local team getPlayerTeam(source) -- Gets the players team
local account getPlayerAccount(source)
if (team) and not isGuestAccount(accountthen -- Checks to see if the player is a guest or not
setAccountData(account"team"getTeamName(team)) --saves team
 end
    end
addEventHandler("onPlayerQuit"getRootElement(), save) -- saves team on quit


Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-26, 17:32


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

No i tu jest problem, spawnPlayer masz i w panelu logowania i tutaj przez co mog? si? bugowa?. Usu? t? funkcj? z panelu logowania.

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Tagi: jak :: usunąć :: linijkę?
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Jak usunąć linijkę? 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