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

Wysłany: 2016-08-07, 17:09


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

Witam mo?e kto? mi pom?c z tym skryptem pr?bowa?em to sam zrobi? ale mi nie wychodzi i chyba co? pomiesza?em wi?c wklejam ca?y kod nie edytowany.Chodzi mi o to ?eby usun?? zapis i spawn tak jak napisa?em pr?bowa?em ale mi nie wychodzi?o
Za pomoc :piwo:
c_login:
mojeW,mojeH 800600
sW,sH guiGetScreenSize()
widthheight = (sW/mojeW), (sH/mojeH)

local sm = {}
sm.moov 0
sm.object1,sm.object2 nil,nil
 
local function removeCamHandler()
    if(sm.moov == 1)then
        sm.moov 0
    end
end
 
local function camRender()
    if (sm.moov == 1then
        local x1,y1,z1 getElementPosition(sm.object1)
        local x2,y2,z2 getElementPosition(sm.object2)
        setCameraMatrix(x1,y1,z1,x2,y2,z2)
    end
end
addEventHandler("onClientPreRender",root,camRender)
 
function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time)
    if(sm.moov == 1)then return false end
    sm.object1 createObject(1337,x1,y1,z1)
    sm.object2 createObject(1337,x1t,y1t,z1t)
    setElementAlpha(sm.object1,0)
    setElementAlpha(sm.object2,0)
    setObjectScale(sm.object1,0.01)
    setObjectScale(sm.object2,0.01)
    moveObject(sm.object1,time,x2,y2,z2,0,0,0,"InOutQuad")
    moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,"InOutQuad")
    sm.moov 1
    setTimer(removeCamHandler,time,1)
    setTimer(destroyElement,time,1,sm.object1)
    setTimer(destroyElement,time,1,sm.object2)
    return true
end


function muzyka opcja )
    if opcja == "on" then
        sound playSound "dzwiek.mp3"true )
        setSoundVolume(sound1.0)
    elseif opcja == "off" then
        stopSound sound )
    end
end

onPanelShow false
onTimerStart false
onGUIHide false

addEventHandler("onClientPreRender",root,function()
    if onPanelShow then
        local obrot=math.sin(getTickCount()/2500)*20
        setCameraMatrix 1500.18, -1638.9935, -13000, -30000-obrot, -5000 )
        dxDrawRectangle(0*width729*height1200*width127*heighttocolor(000234), false)
        dxDrawImage(260*width168*height342*width65*height"logo.png"000tocolor(255255255255), false)
        dxDrawText("Login:"147*width335*height254*width369*heighttocolor(255255255255), 2.10*width"clear""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Has?o:"147*width389*height254*width423*heighttocolor(255255255255), 2.10*width"clear""center""top"falsefalsefalsefalsefalse)
    end
    
    if onTimerStart then
        if not upTimer then
            upTimer getTickCount ()
        end
        local tick getTickCount()
        if tick upTimer >= 6600 then
        guiSetVisible (okno2true)
        guiSetText (nazwa"Witaj na serwerze (nazwa twojego serwera) "..getPlayerName(localPlayer).."!")
        bindKey "enter""down"onClientChoose )
        onTimerStart false
        removeEventHandler("onClientPreRender"getRootElement(), camRender)
        end
    end
    
    if onGUIHide then
        local mnoznik getTickCount()
        local wynik mnoznik startTime
        local duracja endTime startTime
        local progress wynik duracja

        local newX interpolateBetween ( 
            533*width00, 
            785*width00, 
            progress"Linear")
     
        guiSetPosition(okno2newX width/2116*heightfalse)
     
        if mnoznik >= endTime then
            onGUIHide false
            guiSetVisible(okno2false)
        end
    end
end)

loguj guiCreateButton(571*width342*height174*width45*height"Zaloguj"false)
rejestruj guiCreateButton(571*width395*height174*width45*height"Zarejestruj"false)
blad guiCreateLabel(230*width427*height327*width25*height""false)
guiSetFont(blad"clear-normal")
guiLabelSetColor(blad25500)
guiLabelSetHorizontalAlign(blad"center"false)
guiLabelSetVerticalAlign(blad"center")
login guiCreateEdit(244*width343*height303*width30*height""false)
haslo guiCreateEdit(244*width393*height303*width30*height""false)
guiEditSetMasked(haslotrue)
guiSetVisible loginfalse )
guiSetVisible haslofalse )
guiSetVisible bladfalse )
guiSetVisible logujfalse )
guiSetVisible rejestrujfalse )

okno2 guiCreateGridList(533*width116*height266*width368*heightfalse)
guiSetAlpha(okno20.86)
nazwa guiCreateLabel(0.020.010.970.07"Witaj, na (nazwa twojego serwera)"trueokno2)
guiSetFont(nazwa"clear-normal")
guiLabelSetHorizontalAlign(nazwa"center"false)
guiLabelSetVerticalAlign(nazwa"center")
opis guiCreateLabel(0.020.090.970.89"Kliknij enter aby rozpcz?? gr?. "trueokno2)
guiSetFont(opis"clear-normal")
guiLabelSetHorizontalAlign(opis"center"false)
guiLabelSetVerticalAlign(opis"center")
guiSetVisible (okno2false)

addEventHandler ("onClientResourceStart"getResourceRootElement(getThisResource()), 
function()
    guiSetVisible logintrue )
    guiSetVisible haslotrue )
    guiSetVisible bladtrue )
    guiSetVisible logujtrue )
    guiSetVisible rejestrujtrue )
    onPanelShow true
    showCursor (true)
    muzyka "on" )
    showChat(false)
    fadeCamera true )
end
)

function onClientLogin(buttonstate)
       if button == "left" and state == "up" then
        local username guiGetText(login)
         local password guiGetText(haslo)
          if username and password then
           triggerServerEvent("login:zaloguj"getRootElement(), localPlayerusernamepassword)
          else
         guiSetText(blad"Musisz napisac login i haslo aby zaczac gre.")
      end    
   end
end
addEventHandler("onClientGUIClick"logujonClientLoginfalse)

function onClientRegister(buttonstate)
       if button == "left" and state == "up" then
        local username guiGetText(login)
         local password guiGetText(haslo)
          if username and password then
           triggerServerEvent("login:zarejestruj"getRootElement(), localPlayerusernamepassword)
          else
         guiSetText(blad"Musisz wpisa? login i has?o.")
      end    
   end
end
addEventHandler("onClientGUIClick"rejestrujonClientRegisterfalse)

addEvent "login:blad"true )
addEventHandler "login:blad"root, function ( text )
    if source == localPlayer then
        if guiGetVisible(blad) == false then
            guiSetVisible(bladtrue)
        end
    guiSetText bladtext )
    end
end)

function onHideLoginWindow(skin)
    guiSetVisible loginfalse )
    guiSetVisible haslofalse )
    guiSetVisible bladfalse )
    guiSetVisible logujfalse )
    guiSetVisible rejestrujfalse )
    showCursor(false)
    onPanelShow false
    ped createPed (skin1507.85,-1747.84,13.55312.05767822266 )
    setPedAnimation ped"ON_LOOKERS""wave_loop", -1truefalse )
    setElementDimension (localPlayer0)
    setElementDimension (ped0)
    smoothMoveCamera 1500.18, -1638.9935, -13000, -30000, -50001495.82, -1740.3015.446500, -500007000 )
    onTimerStart true
end
addEvent("login:schowaj"true)
addEventHandler("login:schowaj"getResourceRootElement(getThisResource()), onHideLoginWindow)


function onClientChoose()
  if getElementDimension (localPlayer) == 0 then
    local nick getPlayerName localPlayer )
    triggerServerEvent("login:spawn"getRootElement(), localPlayernick)
    destroyElement (ped)
    unbindKey "enter""down"onClientChoose )
    muzyka ("off")
    startTime getTickCount()
    endTime startTime 3000
    onGUIHide true
    showChat (true)
    setElementData localPlayer"login:zalogowany"true)
  end
end

addEvent "login:opis"true )
addEventHandler "login:opis"root, function ( text )
    if source == localPlayer then
        guiSetText opistext )
    end
end)

s_login:
function onPlayerLogin(graczusernamehaslo)
local account getAccount(usernamehaslo)
    if (account ~= falsethen
        if (logIn(graczaccounthaslo) == truethen
            triggerClientEvent(gracz,"login:schowaj",getRootElement(),getAccountData(getPlayerAccount(gracz),"zapis-skin"))
            outputChatBox "*Zalogowa?e? si? poprwanie."gracz255255255true)
            
            local hajs getPlayerMoney gracz )
            local nick getPlayerName gracz )
            local hp getAccountData(getPlayerAccount(gracz),"funmodev2-health")
            local skin getAccountData(getPlayerAccount(gracz),"zapis-skin")

            if not skin then
                skin 0
            elseif not hp then
                hp 0
            end
            
            triggerClientEvent("login:opis",gracz,"Hajs: "..hajs.."$\nNick Gracza: "..nick.."\n?ycie: "..hp.."%\nSkin: "..skin.."\n\n\nAby wej?? do gry kliknij ENTER.")

        else
            triggerClientEvent("login:blad",gracz,"B??d musisz zrobi? /reconnect ")
        end
    else
            triggerClientEvent("login:blad",gracz,"Poda?e? z?y login lub has?o, mo?liwe ze takie konto nie istnieje.")
    end
end
addEvent("login:zaloguj",true)
addEventHandler("login:zaloguj",getRootElement(),onPlayerLogin)

function onPlayerRegister(graczusernamehaslo)
local account getAccount(usernamehaslo)
    if (account ~= falsethen
        triggerClientEvent("login:blad",gracz,"Takie konto ju? istnieje na serwerze.")
    else
        account addAccount(usernamehaslo)
    if (logIn(graczaccounthaslo) == truethen
        triggerClientEvent("login:blad",gracz,"Teraz mo?esz si? zalogowa? na serwer.")
    end
    if (account ~= falsethen end
  end
end
addEvent("login:zarejestruj",true)
addEventHandler("login:zarejestruj",getRootElement(),onPlayerRegister)

function onPlayerSpawn(gracz)
    setCameraTarget graczgracz )
    setElementFrozen graczfalse )

    if getAccountData(getPlayerAccount(gracz),"zapis-x"then
        spawnPlayer(graczgetAccountData(getPlayerAccount(gracz),"zapis-x"), getAccountData(getPlayerAccount(gracz),"zapis-y"), getAccountData(getPlayerAccount(gracz),"zapis-z"),getAccountData(getPlayerAccount(gracz),"zapis-skin"), 00)
    else
        spawnPlayer(gracz1474.15234,-1700.55823,14.04688000) --spawn graczax,y,z Pocz?tkowe 3reszty prosze nei zmienia?.
    end

    fadeCamera gracztrue )
    setCameraTarget graczgracz )
    toggleControl (gracz,"fire",false)
    toggleControl (gracz,"action",false)
    toggleControl (gracz,"aim_weapon",false)
end
addEvent("login:spawn",true)
addEventHandler("login:spawn",root,onPlayerSpawn)




function onPlayerQuit(quitTypereason)
  if not (isGuestAccount (getPlayerAccount (source))) then
    account getPlayerAccount (source)
    if (accountthen
        local x,y,getElementPositon source )
        setAccountData account"zapis-x",)
        setAccountData account"zapis-y",)
        setAccountData account"zapis-z",)
        setAccountData account"zapis-skin",getElementModel(source) )
    end
  end
end
addEventHandler ("onPlayerQuit"getRootElement(), onPlayerQuit)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-07, 17:14


marcin778

Krytyk serwerów MTA






Wiek: 24
Na forum: 4149 dni
Posty: 2268
Nick w MP: Marcineg

Piwa: 4662

Respekt: 1436,8
Respekt: 1436,8

function onPlayerLogin(graczusernamehaslolocal account getAccount(usernamehaslo) 
if (account ~= falsethen 
if (logIn(graczaccounthaslo) == truethen 
triggerClientEvent(gracz,"login:schowaj",getRootElement(),getAccountData(getPlayerAccount(gracz),"zapis-skin")) 
outputChatBox "*Zalogowa?e? si? poprwanie."gracz255255255truelocal hajs getPlayerMoney gracz local nick getPlayerName gracz local hp getAccountData(getPlayerAccount(gracz),"funmodev2-health"local skin getAccountData(getPlayerAccount(gracz),"zapis-skin") 

if not skin then 
skin elseif not hp then 
hp 0 
end 

triggerClientEvent("login:opis",gracz,"Hajs: "..hajs.."$\nNick Gracza: "..nick.."\n?ycie: "..hp.."%\nSkin: "..skin.."\n\n\nAby wej?? do gry kliknij ENTER.") 

else 
triggerClientEvent("login:blad",gracz,"B??d musisz zrobi? /reconnect "end 
else 
triggerClientEvent("login:blad",gracz,"Poda?e? z?y login lub has?o, mo?liwe ze takie konto nie istnieje."end 
end 
addEvent("login:zaloguj",trueaddEventHandler("login:zaloguj",getRootElement(),onPlayerLogin) 

function onPlayerRegister(graczusernamehaslolocal account getAccount(usernamehaslo) 
if (account ~= falsethen 
triggerClientEvent("login:blad",gracz,"Takie konto ju? istnieje na serwerze.") 
else 
account addAccount(usernamehaslo) 
if (logIn(graczaccounthaslo) == truethen 
triggerClientEvent("login:blad",gracz,"Teraz mo?esz si? zalogowa? na serwer."end 
if (account ~= falsethen end 
end 
end 
addEvent("login:zarejestruj",trueaddEventHandler("login:zarejestruj",getRootElement(),onPlayerRegister) 

function onPlayerSpawn(graczsetCameraTarget graczgracz setElementFrozen graczfalse ) 

--if getAccountData(getPlayerAccount(gracz),"zapis-x"then 
--spawnPlayer(graczgetAccountData(getPlayerAccount(gracz),"zapis-x"), --getAccountData(getPlayerAccount(gracz),"zapis-y"), --getAccountData(getPlayerAccount(gracz),"zapis-z"),--getAccountData(getPlayerAccount(gracz),"zapis-skin"), 00) 
else 
--spawnPlayer(gracz1474.15234,-1700.55823,14.04688000) --spawn graczax,y,z Pocz?tkowe 3reszty prosze nei zmienia?. 
end 

fadeCamera gracztrue setCameraTarget graczgracz toggleControl (gracz,"fire",falsetoggleControl (gracz,"action",falsetoggleControl (gracz,"aim_weapon",falseend 
addEvent("login:spawn",trueaddEventHandler("login:spawn",root,onPlayerSpawn) 




function onPlayerQuit(quitTypereason) 
if not (isGuestAccount (getPlayerAccount (source))) then 
account getPlayerAccount (source) 
if (accountthen 
local x,y,getElementPositon source ) 
--setAccountData account"zapis-x",) 
--setAccountData account"zapis-y",) 
--setAccountData account"zapis-z",) 
--setAccountData account"zapis-skin",getElementModel(source) ) 
end 
end 
end 
addEventHandler ("onPlayerQuit"getRootElement(), onPlayerQuit)


Podpis
Moje prace: https://www.youtube.com/c...MuaWGHPp1mhlGnw

-- obecnie
-- obecnie
-- dawniej
-- dawniej
-- dawniej
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-07, 17:22


STOPseba

Emeryt na scenie MTA






Wiek: 25
Na forum: 3771 dni
Posty: 448
Nick w MP: STOPseba

Piwa: 5014

Respekt: 576,3
Respekt: 576,3

"marcin778" napisał/a:

function onPlayerLogin(graczusernamehaslolocal account getAccount(usernamehaslo) 
if (account ~= falsethen 
if (logIn(graczaccounthaslo) == truethen 
triggerClientEvent(gracz,"login:schowaj",getRootElement(),getAccountData(getPlayerAccount(gracz),"zapis-skin")) 
outputChatBox "*Zalogowa?e? si? poprwanie."gracz255255255truelocal hajs getPlayerMoney gracz local nick getPlayerName gracz local hp getAccountData(getPlayerAccount(gracz),"funmodev2-health"local skin getAccountData(getPlayerAccount(gracz),"zapis-skin") 

if not skin then 
skin elseif not hp then 
hp 0 
end 

triggerClientEvent("login:opis",gracz,"Hajs: "..hajs.."$\nNick Gracza: "..nick.."\n?ycie: "..hp.."%\nSkin: "..skin.."\n\n\nAby wej?? do gry kliknij ENTER.") 

else 
triggerClientEvent("login:blad",gracz,"B??d musisz zrobi? /reconnect "end 
else 
triggerClientEvent("login:blad",gracz,"Poda?e? z?y login lub has?o, mo?liwe ze takie konto nie istnieje."end 
end 
addEvent("login:zaloguj",trueaddEventHandler("login:zaloguj",getRootElement(),onPlayerLogin) 

function onPlayerRegister(graczusernamehaslolocal account getAccount(usernamehaslo) 
if (account ~= falsethen 
triggerClientEvent("login:blad",gracz,"Takie konto ju? istnieje na serwerze.") 
else 
account addAccount(usernamehaslo) 
if (logIn(graczaccounthaslo) == truethen 
triggerClientEvent("login:blad",gracz,"Teraz mo?esz si? zalogowa? na serwer."end 
if (account ~= falsethen end 
end 
end 
addEvent("login:zarejestruj",trueaddEventHandler("login:zarejestruj",getRootElement(),onPlayerRegister) 

function onPlayerSpawn(graczsetCameraTarget graczgracz setElementFrozen graczfalse ) 

--if getAccountData(getPlayerAccount(gracz),"zapis-x"then 
--spawnPlayer(graczgetAccountData(getPlayerAccount(gracz),"zapis-x"), --getAccountData(getPlayerAccount(gracz),"zapis-y"), --getAccountData(getPlayerAccount(gracz),"zapis-z"),--getAccountData(getPlayerAccount(gracz),"zapis-skin"), 00) 
else 
--spawnPlayer(gracz1474.15234,-1700.55823,14.04688000) --spawn graczax,y,z Pocz?tkowe 3reszty prosze nei zmienia?. 
end 

fadeCamera gracztrue setCameraTarget graczgracz toggleControl (gracz,"fire",falsetoggleControl (gracz,"action",falsetoggleControl (gracz,"aim_weapon",falseend 
addEvent("login:spawn",trueaddEventHandler("login:spawn",root,onPlayerSpawn) 




function onPlayerQuit(quitTypereason) 
if not (isGuestAccount (getPlayerAccount (source))) then 
account getPlayerAccount (source) 
if (accountthen 
local x,y,getElementPositon source ) 
--setAccountData account"zapis-x",) 
--setAccountData account"zapis-y",) 
--setAccountData account"zapis-z",) 
--setAccountData account"zapis-skin",getElementModel(source) ) 
end 
end 
end 
addEventHandler ("onPlayerQuit"getRootElement(), onPlayerQuit)

Teraz to nie mog? si? nawet zalogowa?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-08-08, 00:11


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

w s-side usuwasz funkcj? onPlayerSpawn i onPlayerQuit kolego :)

A to twoj c-side

mojeW,mojeH 800600
sW,sH guiGetScreenSize()
widthheight = (sW/mojeW), (sH/mojeH)

local sm = {}
sm.moov 0
sm.object1,sm.object2 nil,nil
 
local function removeCamHandler()
    if(sm.moov == 1)then
        sm.moov 0
    end
end
 
local function camRender()
    if (sm.moov == 1then
        local x1,y1,z1 getElementPosition(sm.object1)
        local x2,y2,z2 getElementPosition(sm.object2)
        setCameraMatrix(x1,y1,z1,x2,y2,z2)
    end
end
addEventHandler("onClientPreRender",root,camRender)
 
function smoothMoveCamera(x1,y1,z1,x1t,y1t,z1t,x2,y2,z2,x2t,y2t,z2t,time)
    if(sm.moov == 1)then return false end
    sm.object1 createObject(1337,x1,y1,z1)
    sm.object2 createObject(1337,x1t,y1t,z1t)
    setElementAlpha(sm.object1,0)
    setElementAlpha(sm.object2,0)
    setObjectScale(sm.object1,0.01)
    setObjectScale(sm.object2,0.01)
    moveObject(sm.object1,time,x2,y2,z2,0,0,0,"InOutQuad")
    moveObject(sm.object2,time,x2t,y2t,z2t,0,0,0,"InOutQuad")
    sm.moov 1
    setTimer(removeCamHandler,time,1)
    setTimer(destroyElement,time,1,sm.object1)
    setTimer(destroyElement,time,1,sm.object2)
    return true
end


function muzyka opcja )
    if opcja == "on" then
        sound playSound "dzwiek.mp3"true )
        setSoundVolume(sound1.0)
    elseif opcja == "off" then
        stopSound sound )
    end
end

onPanelShow false
onTimerStart false
onGUIHide false

addEventHandler("onClientPreRender",root,function()
    if onPanelShow then
        local obrot=math.sin(getTickCount()/2500)*20
        setCameraMatrix 1500.18, -1638.9935, -13000, -30000-obrot, -5000 )
        dxDrawRectangle(0*width729*height1200*width127*heighttocolor(000234), false)
        dxDrawImage(260*width168*height342*width65*height"logo.png"000tocolor(255255255255), false)
        dxDrawText("Login:"147*width335*height254*width369*heighttocolor(255255255255), 2.10*width"clear""center""top"falsefalsefalsefalsefalse)
        dxDrawText("Has?o:"147*width389*height254*width423*heighttocolor(255255255255), 2.10*width"clear""center""top"falsefalsefalsefalsefalse)
    end
    
    if onTimerStart then
        if not upTimer then
            upTimer getTickCount ()
        end
        local tick getTickCount()
        if tick upTimer >= 6600 then
        guiSetVisible (okno2true)
        guiSetText (nazwa"Witaj na serwerze (nazwa twojego serwera) "..getPlayerName(localPlayer).."!")
        bindKey "enter""down"onClientChoose )
        onTimerStart false
        removeEventHandler("onClientPreRender"getRootElement(), camRender)
        end
    end
    
    if onGUIHide then
        local mnoznik getTickCount()
        local wynik mnoznik startTime
        local duracja endTime startTime
        local progress wynik duracja

        local newX interpolateBetween ( 
            533*width00, 
            785*width00, 
            progress"Linear")
     
        guiSetPosition(okno2newX width/2116*heightfalse)
     
        if mnoznik >= endTime then
            onGUIHide false
            guiSetVisible(okno2false)
        end
    end
end)

loguj guiCreateButton(571*width342*height174*width45*height"Zaloguj"false)
rejestruj guiCreateButton(571*width395*height174*width45*height"Zarejestruj"false)
blad guiCreateLabel(230*width427*height327*width25*height""false)
guiSetFont(blad"clear-normal")
guiLabelSetColor(blad25500)
guiLabelSetHorizontalAlign(blad"center"false)
guiLabelSetVerticalAlign(blad"center")
login guiCreateEdit(244*width343*height303*width30*height""false)
haslo guiCreateEdit(244*width393*height303*width30*height""false)
guiEditSetMasked(haslotrue)
guiSetVisible loginfalse )
guiSetVisible haslofalse )
guiSetVisible bladfalse )
guiSetVisible logujfalse )
guiSetVisible rejestrujfalse )

okno2 guiCreateGridList(533*width116*height266*width368*heightfalse)
guiSetAlpha(okno20.86)
nazwa guiCreateLabel(0.020.010.970.07"Witaj, na (nazwa twojego serwera)"trueokno2)
guiSetFont(nazwa"clear-normal")
guiLabelSetHorizontalAlign(nazwa"center"false)
guiLabelSetVerticalAlign(nazwa"center")
opis guiCreateLabel(0.020.090.970.89"Kliknij enter aby rozpcz?? gr?. "trueokno2)
guiSetFont(opis"clear-normal")
guiLabelSetHorizontalAlign(opis"center"false)
guiLabelSetVerticalAlign(opis"center")
guiSetVisible (okno2false)

addEventHandler ("onClientResourceStart"getResourceRootElement(getThisResource()), 
function()
    guiSetVisible logintrue )
    guiSetVisible haslotrue )
    guiSetVisible bladtrue )
    guiSetVisible logujtrue )
    guiSetVisible rejestrujtrue )
    onPanelShow true
    showCursor (true)
    muzyka "on" )
    showChat(false)
    fadeCamera true )
end
)

function onClientLogin(buttonstate)
       if button == "left" and state == "up" then
        local username guiGetText(login)
         local password guiGetText(haslo)
          if username and password then
           triggerServerEvent("login:zaloguj"getRootElement(), localPlayerusernamepassword)
          else
         guiSetText(blad"Musisz napisac login i haslo aby zaczac gre.")
      end    
   end
end
addEventHandler("onClientGUIClick"logujonClientLoginfalse)

function onClientRegister(buttonstate)
       if button == "left" and state == "up" then
        local username guiGetText(login)
         local password guiGetText(haslo)
          if username and password then
           triggerServerEvent("login:zarejestruj"getRootElement(), localPlayerusernamepassword)
          else
         guiSetText(blad"Musisz wpisa? login i has?o.")
      end    
   end
end
addEventHandler("onClientGUIClick"rejestrujonClientRegisterfalse)

addEvent "login:blad"true )
addEventHandler "login:blad"root, function ( text )
    if source == localPlayer then
        if guiGetVisible(blad) == false then
            guiSetVisible(bladtrue)
        end
    guiSetText bladtext )
    end
end)

function onHideLoginWindow(skin)
    guiSetVisible loginfalse )
    guiSetVisible haslofalse )
    guiSetVisible bladfalse )
    guiSetVisible logujfalse )
    guiSetVisible rejestrujfalse )
    showCursor(false)
    onPanelShow false
    ped createPed (skin1507.85,-1747.84,13.55312.05767822266 )
    setPedAnimation ped"ON_LOOKERS""wave_loop", -1truefalse )
    setElementDimension (localPlayer0)
    setElementDimension (ped0)
    smoothMoveCamera 1500.18, -1638.9935, -13000, -30000, -50001495.82, -1740.3015.446500, -500007000 )
    onTimerStart true
end
addEvent("login:schowaj"true)
addEventHandler("login:schowaj"getResourceRootElement(getThisResource()), onHideLoginWindow)


function onClientChoose()
  if getElementDimension (localPlayer) == 0 then
    local nick getPlayerName localPlayer )
    fadeCamera localPlayertrue )
    setCameraTarget localPlayer)
    toggleControl ("fire",false)
    toggleControl ("action",false)
    toggleControl ("aim_weapon",false)
    destroyElement (ped)
    unbindKey "enter""down"onClientChoose )
    muzyka ("off")
    startTime getTickCount()
    endTime startTime 3000
    onGUIHide true
    showChat (true)
    setElementData localPlayer"login:zalogowany"true)
  end
end

addEvent "login:opis"true )
addEventHandler "login:opis"root, function ( text )
    if source == localPlayer then
        guiSetText opistext )
    end
end)



Nie testowa?em :)

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Tagi: logowanie
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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