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

Wysłany: 2018-11-24, 20:19


dawidmajka

tfuj stary






Wiek: 22
Na forum: 3613 dni
Posty: 137
Nick w MP: kutas

Piwa: 13

Respekt: 40

Witam,robie serwer na east city co mam wkleic i gdzie dokladnie kod aby po za?o?eniu nowego konta gracza automatycznie dostaje premium typu jak na cash life oto kod:

client.lua
if getElementData(localPlayer, "player:uid") then return end
sw,sh guiGetScreenSize()
screenWscreenH guiGetScreenSize()
mxmy sw 0.122sw 0.244
sy 0
ssy sh
myy 0
Font dxCreateFont"font1.ttf"100)
time getTickCount()

logopanel false

local data={ misc=nil, }

function createLoginPanel()
    addEventHandler("onClientRender",getRootElement(),renderLoginPanel)
    addEventHandler("onClientRender",getRootElement(),renderLoginContent)
    czas getTickCount()
    showPlayerHudComponent("all"false)
    showCursor(true,true)
    showChat(false)
    fadeCamera(true)
    setElementAlpha(localPlayer,255)
    logopanel true
    xml xmlLoadFile("userdata.xml")
    loadXML()
    data.misc playSound("Muzyka/muzaaa.mp3",true)
    setSoundVolume(data.misc 1.0)
end
addEventHandler("onClientResourceStart"getResourceRootElement(getThisResource()), createLoginPanel)

function loadXML()
  if not xml then
    xml xmlCreateFile("userdata.xml","login")
    usernameChild xmlCreateChild(xml,"login")
    passwordChild xmlCreateChild(xml,"pass")
    checkboxChild xmlCreateChild(xml,"state")
    xmlSaveFile(xml)
  else
    usernameChild xmlFindChild(xml,"login",0)
    passwordChild xmlFindChild(xml,"pass",0)
    checkboxChild xmlFindChild(xml,"state",0)
  end
  if xmlNodeGetValue(checkboxChild) == "true" then
    checkboxs[1].state true
  end
    usernameLoad xmlNodeGetValue(usernameChild)
    passwordLoad xmlNodeGetValue(passwordChild)
    for w in string.gmatch(usernameLoad".") do
      for i,ebox in ipairs(editbox) do
        if ebox.name == "Loglogin" then
          table.insert(text[i], w)
        end
      end
    end
    for w in string.gmatch(passwordLoad".") do
      for i,ebox in ipairs(editbox) do
        if ebox.name == "Logpass" then
          table.insert(text[i], w)
        end
      end
    end
end
function saveXML(login,pass,checkboxState)
  if checkboxs[1].state == true then
    xmlNodeSetValue(usernameChild,login)
    xmlNodeSetValue(passwordChild,pass)
    xmlNodeSetValue(checkboxChild,tostring(checkboxState))
    xmlSaveFile(xml)
  else
    xmlNodeSetValue(usernameChild,"")
    xmlNodeSetValue(passwordChild,"")
    xmlNodeSetValue(checkboxChild,"")
    xmlSaveFile(xml)
  end
end
addEvent("saveXML",true)
addEventHandler("saveXML",getRootElement(),saveXML)

field = {
{ typ "login"sw 0.5sh 0.5 - ( sh 0.400)/20sw 0.244colorS tocolor(000), erbox "bialy"text "Witamy na My World, zaloguj sie!"messageBox "1"}
}

buttons = {
{ typ "login"sw 0.5 sw 0.0290sh 0.5 - ( sh 0.405)/sw 0.0854 sw 0.0530 sw 0.0244 sw 0.0122 +  sw 0.0244 sw 0.244 0.02sw 0.370 0.3sw 0.0290color tocolor000AlphaButton), text "Zaloguj si?!"func "pressLogin"},
{ typ "login"sw 0.5 sw 0.1400 sw 0.0005sh 0.5 - ( sh 0.405)/sw *  0.1145 +  sw 0.0244 sw 0.0122 +  sw 0.0244 sw 0.0244 sw 0.244 0.02sw 0.370 0.3sw 0.0290color tocolor000AlphaButton), text "Rejestruj si?!"func "pressRegisterBut"},
{ typ "register"sw 0.5 sw 0.0290sh 0.5 - ( sh 0.405)/sw 0.0854 sw 0.0530 sw 0.0244 sw 0.0122 +  sw 0.0244 sw 0.244 0.02sw 0.370 0.3sw 0.0290color tocolor000160), text "Rejestruj si?!"func "pressRegister"},
{ typ "register"sw 0.5 sw 0.1400 sw 0.0005sh 0.5 - ( sh 0.405)/sw *  0.1145 +  sw 0.0244 sw 0.0122 +  sw 0.0244 sw 0.0244 sw 0.244 0.02sw 0.370 0.3sw 0.0290color tocolor000160), text "Cofnij"func "pressBack"},
}

editbox = {
{ typ "login"sw 0.5 sw 0.244 sw 0.545 0.3sh 0.5 - ( sh 0.405)/sw 0.244 0.34sw 0.270 0.6sw 0.0270image "Img/ebox.png"color tocolor252525AlphaEditBox), text ""textup "Login:"name "Loglogin"},
{ typ "login"sw 0.5 sw 0.244 sw 0.545 0.3sh 0.5 - ( sh 0.405)/sw 0.270 0.34 sw 0.0244 sw 0.0122sw 0.270 0.6sw 0.0270image "Img/ebox.png"color tocolor252525AlphaEditBox), text ""textup "Has?o:"name "Logpass"hide true},
{ typ "register"sw 0.5 sw 0.244 sw 0.545 0.3sh 0.5 - ( sh 0.405)/sw 0.244 0.34sw 0.270 0.6sw 0.0270image "Img/ebox.png"color tocolor252525AlphaEditBox), text ""textup "Login:"name "loginRej"},
{ typ "register"sw 0.5 sw 0.244 sw 0.545 0.3sh 0.5 - ( sh 0.405)/sw 0.270 0.34 sw 0.0244 sw 0.0122sw 0.270 0.6sw 0.0270image "Img/ebox.png"color tocolor252525AlphaEditBox), text ""textup "Has?o:"name "passRej"hide true}
}
checkboxs = {
  { =  sw 0.6 sw 0.900 0.06sh 0.5 - ( sh 0.405)/sw 0.320 0.34 sw 0.0244 sw 0.0122 sw 0.0244 sw 0.0122wh sw 0.244 0.05state falsetext "Zapami?taj" }
} 
text = {}
for i,ebox in ipairs(editbox) do
table.insert(text,{})
end
bindKey("backspace""down", function ()
  table.remove(text[eboxClickI], #text[eboxClickI])
end)
function getCharacter(character)
  for i,ebox in ipairs(editbox) do
    if eboxClickI == i then
      table.insert(text[i], character)
    end
  end
end
function renderLoginPanel()
        dxDrawImage(screenW 0.0000screenH 0.0000screenW 1.0000screenH 1.0000":ec-PaneLogowania/Img/69.png"000tocolor(255255255255), false)
        dxDrawImage(screenW 0.2672screenH 0.1159screenW 0.4758screenH 0.8464":ec-PaneLogowania/Img/panelek.png"000tocolor(255255255255), false)
        dxDrawImage(screenW 0.4034screenH 0.2031screenW 0.2196screenH 0.1953":ec-PaneLogowania/Img/ec.png"000tocolor(255255255255), false)
local AlphaAlpha2 interpolateBetween(0001582550, ((getTickCount() - czas) / 2500), "Linear") 
    for indexlogin in ipairs field ) do
      if login.typ then 
        if (login.typ == "login"then
            if login.erbox then 
              if (login.erbox == "green"then
                login.colorS tocolor 02000210 )
              elseif ( login.erbox == "red"then 
                login.colorS tocolor20000210 )
              elseif ( login.erbox == "bialy"then 
                login.colorS tocolor255255255210 )
              end
            end
              if login.text then 
                dxDrawTextlogin.textlogin.xlogin.login.0.2  login.login.wlogin.login.h  login.colorSsw/1900Font"center")
              end
            end
        end 
    end
end 

function renderLoginContent()
AlphaEditBoxAlphaButton interpolateBetween(0001901600, ((getTickCount() - czas) / 2500), "Linear")
if logopanel == true then
  for i,ebox in ipairs(editbox) do
    if ebox.typ then 
      if ( ebox.typ == "login" then 
        dxDrawImageebox.xebox.sy  ebox.webox.hebox.image000ebox.color )
          if ebox.textup then
            dxDrawTextebox.textupebox.ebox.0.12ebox.ebox.0.25 sy  ebox.ebox.webox.ebox.h  tocolor230,230,230), sw/1600Font)
          end
            if isMouseWithinRangeOf(ebox.xebox.sy  ebox.webox.hthen
              ebox.color tocolor(252525240)
            else
              ebox.color tocolor(252525170)
            end
              if ebox.text then
                ebox.text table.concat(text[i],"")
                  if ebox.hide == true then
                    dxDrawText (string.rep("•",#text[i],""), ebox.x + 10, ebox.y + sy  , ebox.x + ebox.w, ebox.y + ebox.h + sy  , tocolor( 230,230,230), sw/1700, Font, "left", "center", true)
                  else
                    dxDrawText table.concat(text[i],""), ebox.10ebox.sy  ebox.ebox.webox.ebox.sy  tocolor230,230,230), sw/1600Font"left""center",true)
                  end
              end
                if eboxClickI == i then
                  dxDrawImageebox.xebox.y  ebox.webox.h"Img/border.png"000tocolor(255,255,255))
                end
      elseif ( ebox.typ == "register" then 
        dxDrawImageebox.xebox.ssy  ebox.webox.hebox.image000ebox.color )
          if ebox.textup then
            dxDrawTextebox.textupebox.ebox.0.12ebox.ebox.0.25 ssy  ebox.ebox.webox.ebox.h  tocolor230,230,230), sw/1600Font)
          end
            if isMouseWithinRangeOf(ebox.xebox.ssy  ebox.webox.hthen
              ebox.color tocolor252525240)
            else
              ebox.color tocolor252525170)
            end
              if ebox.text then
                ebox.text table.concat(text[i],"")
                  if ebox.hide == true then
                    dxDrawText (string.rep("•",#text[i],""), ebox.x + 10, ebox.y + ssy  , ebox.x + ebox.w, ebox.y + ebox.h + ssy  , tocolor( 230,230,230), sw/1600, Font, "left", "center", true)
                  else
                    dxDrawText table.concat(text[i],""), ebox.10ebox.ssy  ebox.ebox.webox.ebox.ssy  tocolor230,230,230), sw/1600Font"left""center",true)
                  end
              end
                if eboxClickI == i then
                  dxDrawImageebox.xebox.y  ebox.webox.h"Img/border.png"000tocolor(255,255,255))
                end
      end 
    end 
  end
    for indexcbox in ipairs checkboxs ) do 
    if ( cbox.state == true then 
      dxDrawImage(cbox.cbox.y  sy  cbox.whcbox.wh"Img/accept.png")
      else
        dxDrawImage(cbox.cbox.y  sy  cbox.whcbox.wh"Img/decline.png")
      end
    if cbox.text then
        dxDrawText (cbox.textcbox.cbox.wh 5cbox.sy  cbox.cbox.wh*10cbox.cbox.wh  sy  tocolor230,230,230), sw/2000Font"left""center",true)
      end
  end 
  for indexbut in ipairs buttons ) do
    if but.typ then 
      if ( but.typ == "login" then 
        dxDrawImagebut.xbut.sy  but.wbut.h"Img/ebox.png"000but.color)
          if isMouseWithinRangeOf(but.xbut.y  sy  but.wbut.hthen
            but.color tocolor2461512)
          else
            but.color tocolor2461512)
          end
            if but.text then 
              dxDrawTextbut.textbut.xbut.sy  but.but.wbut.but.sy  tocolor230,230,230), sw/1600Font"center""center")
            end
      elseif ( but.typ == "register" then 
        dxDrawImagebut.xbut.ssy  but.wbut.h"Img/ebox.png"000but.color)
          if isMouseWithinRangeOf(but.xbut.y  ssy  but.wbut.hthen
            but.color tocolor2461512)
          else
            but.color tocolor2461512)
          end
            if but.text then 
              dxDrawTextbut.textbut.xbut.ssy  but.but.wbut.but.ssy  tocolor230,230,230), sw/1600Font"center""center")
            end               
      end      
    end
  end 
end
end 
addEventHandler("onClientCharacter"getRootElement(), getCharacter)

function pressLogin()
  for iebox in ipairs(editbox) do
    if ebox.name == "Loglogin" then
      login ebox.text
    elseif ebox.name == "Logpass" then
      pass ebox.text
    end
  end 
triggerServerEvent "onLogin"getLocalPlayer(), loginpasscheckboxs[1].state)
end
function pressRegister()
  for iebox in ipairs(editbox) do
    if ebox.name == "loginRej" then
      rejlogin ebox.text
    elseif ebox.name == "passRej" then
      rejpass ebox.text
    end
  end 
triggerServerEvent "onRegister"getLocalPlayer(), rejloginrejpass)
end

function pressRegisterBut()
  p_Move = {}
  p_Move.startTime getTickCount()
  p_Move.endTime p_Move.startTime 1200
  p_Move.easingFunction "InOutQuad"
  addEventHandler("onClientRender"getRootElement(), movePanelOut)
end
function pressBack()
  p_Move = {}
  p_Move.startTime getTickCount()
  p_Move.endTime p_Move.startTime 1200
  p_Move.easingFunction "InOutQuad"
  addEventHandler("onClientRender"getRootElement(), movePanelIn)
end
addEvent("pressBack",true)
addEventHandler("pressBack",getRootElement(),pressBack)
function movePanelOut()
  local now getTickCount()
  local elapsedTime now p_Move.startTime
  local duration p_Move.endTime p_Move.startTime
  local progress elapsedTime duration
 
  local fAnimationTime getEasingValue(progressp_Move.easingFunction)
 
  local move fAnimationTime*sw 0.122
  removeEventHandler("onClientRender"getRootElement(), renderLoginContent)
  setTimer( function() addEventHandler("onClientRender"getRootElement(), renderLoginContentend1200)
  removeEventHandler("onClientClick",getRootElement(),onClick)
  for i,v in ipairs field ) do 
   if v.text then 
    v.text ""
    v.erbox "bialy"
   end
  end 
  setTimer( function()
    for i,v in ipairs field ) do 
      if v.text then 
        v.text "Panel Rejestracji!"
      end 
    end 
   end1200)
  mx move
  my move 2
  sy sh
  ssy 0
  if now p_Move.endTime then
    removeEventHandler("onClientRender"getRootElement(), movePanelOut)
    addEventHandler("onClientClick",getRootElement(),onClick)
  end
end
function movePanelIn()
  local now getTickCount()
  local elapsedTime now p_Move.startTime
  local duration p_Move.endTime p_Move.startTime
  local progress elapsedTime duration
  local fAnimationTime getEasingValue(progressp_Move.easingFunction)
  local move fAnimationTimesw 0.122
  removeEventHandler("onClientRender"getRootElement(), renderLoginContent)
  setTimer( function() addEventHandler("onClientRender"getRootElement(), renderLoginContentend1200)
  removeEventHandler("onClientClick",getRootElement(),onClick)
  for i,v in ipairs field ) do 
   if v.text then 
    v.text ""
    v.erbox "bialy"
   end
  end 
  setTimer( function()
    for i,v in ipairs field ) do 
      if v.text then 
        v.text "Witamy na MyWorld, zaloguj sie!"
      end 
    end 
   end1200)
  mx = -move
  my = -move 2
  sy 0
  ssy sh
  if now p_Move.endTime then
    removeEventHandler("onClientRender"getRootElement(), movePanelIn)
    addEventHandler("onClientClick",getRootElement(),onClick)
  end
end

function changeMessage(mesBoxnewMessageboxColor)
  for i,box in ipairs(field) do
    if box.messageBox ==  mesBox then
      box.text newMessage
      box.erbox boxColor
    end
  end
end
addEvent("changeMessage",true)
addEventHandler("changeMessage",getRootElement(),changeMessage)

function onClick(mButton,state,ax,ay)
if logopanel == true then
  if not (state == "down" and mButton == "left"then
    return false
  end
  for i,b in pairs(buttons) do
    if b.typ then 
      if ( b.typ == "login" then 
        if isMouseWithinRangeOf(b.xb.syb.wb.hthen
          outputDebugString("Pressed "..b.text)
            if b.func then
              loadstring("return "..b.func.."()")()
            end
        end
      elseif ( b.typ == "register" then
        if isMouseWithinRangeOf(b.xb.ssyb.wb.hthen
          outputDebugString("Pressed "..b.text)
            if b.func then
              loadstring("return "..b.func.."()")()
            end
        end
      end 
    end
  end 
  for i,ebox in pairs(editbox) do
    if ebox.typ then 
      if ( ebox.typ == "login" then 
        if isMouseWithinRangeOf(ebox.xebox.syebox.webox.hthen
          outputDebugString("Pressed "..ebox.textup)
          eboxClickI i
          return true
        end 
      elseif ( ebox.typ == "register" then 
        if isMouseWithinRangeOf(ebox.xebox.ssyebox.webox.hthen
          outputDebugString("Pressed "..ebox.textup)
          eboxClickI i
            return true
        end 
      end 
    end
  end
  for i,cbox in pairs(checkboxs) do
    if isMouseWithinRangeOf(cbox.xcbox.sycbox.whcbox.whthen
      outputDebugString("Pressed "..i.." checkbox")
      if cbox.state == false then
      cbox.state true
      else
      cbox.state false
      end
    end
  end
  eboxClickI nil
  return false
end
end
addEventHandler("onClientClick",getRootElement(),onClick)

function isMouseWithinRangeOf(posXposYsizeXsizeY)
  if isCursorShowing() == false then
    return false
  end
  local cx,cy getCursorPosition()
  cx,cy cx*sw,cy*sh
  if cx >= posX and cx <= posX+sizeX and cy >= posY and cy <= posY+sizeY then
    return true,cx,cy
  else
    return false
  end
end

function hideLoginPanel()
  addEventHandler("onClientRender"getRootElement(), hidePanelOut)
end
function hidePanelOut()
    setTimer( function() 
    removeEventHandler("onClientRender",getRootElement(),renderLoginPanel)
    removeEventHandler("onClientRender",getRootElement(),renderLoginContent)
     if (getTickCount() - time >= 2000then 
 end
    logopanel false
    end2000)
  end
addEvent("hideLoginPanel",true)
addEventHandler("hideLoginPanel",getRootElement(),hideLoginPanel)

function muzaoff()
    stopSound(data.misc)
end
addEvent("stop:muzaLogin",true)
addEventHandler("stop:muzaLogin",getRootElement(),muzaoff)

function apagarScript()
    if fileExists("client.lua"then
        fileDelete("client.lua")
    end
end
addEventHandler("onClientResourceStart"getResourceRootElement(getThisResource()), apagarScript)
addEventHandler("onClientPlayerQuit"getRootElement(), apagarScript)
addEventHandler("onClientPlayerJoin"getRootElement(), apagarScript)






c_zone.lua

local screenWscreenH guiGetScreenSize()
Font dxCreateFont"font1.ttf")
 
panelspawn false
 
function isMouseIn(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*screenW,cy*screenH
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end
 
function isEventHandlerAddedsEventNamepElementAttachedTofunc )
    if
        typesEventName ) == 'string' and
        isElementpElementAttachedTo ) and
        typefunc ) == 'function'
    then
        local aAttachedFunctions getEventHandlerssEventNamepElementAttachedTo )
        if typeaAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
            for iv in ipairsaAttachedFunctions ) do
                if == func then
                    return true
                end
            end
        end
    end
 
    return false
end
 
function renderZoneBox()
if panelspawn == true then
local AlphaAlpha2 interpolateBetween(0001702550, ((getTickCount() - czasspawn) / 2500), "Linear")
 dxDrawImage(screenW 0.0000screenH 0.0000screenW 1.0000screenH 1.0000":ec-PaneLogowania/Img/69.png"000tocolor(255255255255), false)
 dxDrawImage(screenW 0.2672screenH 0.1159screenW 0.4758screenH 0.8464":ec-PaneLogowania/Img/panelek.png"000tocolor(255255255255), false)
        dxDrawImage(screenW 0.4034screenH 0.2031screenW 0.2196screenH 0.1953":ec-PaneLogowania/Img/ec.png"000tocolor(255255255255), false)
dxDrawImage(screenW 0.3104screenH 0.6849screenW 0.4122screenH 0.1953":ec-PaneLogowania/Img/spawn.png"000tocolor(255255255255), false)
if not isMouseIn(screenW 0.4429screenH 0.6237screenW 0.1157screenH 0.0456then
dxDrawImage(screenW 0.4429screenH 0.6237screenW 0.1157screenH 0.0456"Img/ebox.png"000tocolor(2461512Alpha), false)
 
else
dxDrawImage(screenW 0.4429screenH 0.6237screenW 0.1157screenH 0.0456"Img/ebox.png"000tocolor(2461512), false)
end
 
if not isMouseIn(screenW 0.4429screenH 0.3893screenW 0.1157screenH 0.0456then
dxDrawImage(screenW 0.4429screenH 0.3893screenW 0.1157screenH 0.0456"Img/ebox.png"000tocolor(2461512Alpha), false)
 
else
dxDrawImage(screenW 0.4429screenH 0.3893screenW 0.1157screenH 0.0456"Img/ebox.png"000tocolor(2461512), false)
end
 
if not isMouseIn(screenW 0.4429screenH 0.4479screenW 0.1157screenH 0.0456then --Przycisk 1
dxDrawImage(screenW 0.4429screenH 0.4479screenW 0.1157screenH 0.0456"Img/ebox.png"000tocolor(2461512Alpha), false)
 
else
dxDrawImage(screenW 0.4429screenH 0.4479screenW 0.1157screenH 0.0456"Img/ebox.png"000tocolor(2461512), false)
end
     
if not isMouseIn(screenW 0.4429screenH 0.5065screenW 0.1157screenH 0.0456then --Przycisk 1
dxDrawImage(screenW 0.4429screenH 0.5065screenW 0.1157screenH 0.0456"Img/ebox.png"000tocolor(2461512Alpha), false)
 
else
dxDrawImage(screenW 0.4429screenH 0.5065screenW 0.1157screenH 0.0456"Img/ebox.png"000tocolor(2461512), false)
end
 
if not isMouseIn(screenW 0.4429screenH 0.5651screenW 0.1157screenH 0.0456then --Przycisk 1
dxDrawImage(screenW 0.4429screenH 0.5651screenW 0.1157screenH 0.0456"Img/ebox.png"000tocolor(2461512Alpha), false)
 
else
dxDrawImage(screenW 0.4429screenH 0.5651screenW 0.1157screenH 0.0456"Img/ebox.png"000tocolor(2461512), false)  
end      
 
dxDrawText("Urz?d SF"screenW 0.4458screenH 0.6237screenW 0.5498screenH 0.6693tocolor(255255255Alpha2), 1.30Font"center""center"falsefalsefalsefalsefalse)
dxDrawText("Przechowalnia SF"screenW 0.4473screenH 0.3893screenW 0.5512screenH 0.4349tocolor(255255255Alpha2), 1.30Font"center""center"falsefalsefalsefalsefalse)      
dxDrawText("Mieszkanie",  screenW 0.4473screenH 0.4479screenW 0.5512screenH 0.4935tocolor(255255255Alpha2), 1.30Font"center""center"falsefalsefalsefalsefalse)
dxDrawText("Spawn LV"screenW 0.4473screenH 0.5065screenW 0.5512screenH 0.5521tocolor(255255255Alpha2), 1.30Font"center""center"falsefalsefalsefalsefalse)
dxDrawText("Spawn BB"screenW 0.4473screenH 0.5651screenW 0.5512screenH 0.6107tocolor(255255255Alpha2), 1.30Font"center""center"falsefalsefalsefalsefalse)
end
end
 
addEventHandler("onClientClick"root, function(button,state)
    if panelspawn and button == "left" and state == "down" then
        if isMouseIn(screenW 0.4429screenH 0.6237screenW 0.1157screenH 0.0456then
         setElementData(localPlayer,"player:spawn",{-1909.40,486.91,35.17+0.1})
         closeZones()
        end
        if isMouseIn(screenW 0.4429screenH 0.3893screenW 0.1157screenH 0.0456then
         setElementData(localPlayer,"player:spawn",{-1972.57,616.49,35.17+0.1})
         closeZones()
        end
        if isMouseIn(screenW 0.4429screenH 0.5065screenW 0.1157screenH 0.0456then
         setElementData(localPlayer,"player:spawn",{944.061733.248.85+0.1})
         closeZones()
        end
        if isMouseIn(screenW 0.4429screenH 0.5651screenW 0.1157screenH 0.0456then
         setElementData(localPlayer,"player:spawn",{203.57,-65.10,1.58+0.1})
         closeZones()
        end
        if isMouseIn(screenW 0.4429screenH 0.4479screenW 0.1157screenH 0.0456then
        local domek=getElementData(localPlayer,"player:house")
        if not domek then
                setElementData(localPlayer,"player:spawn",{387.31, -1521.3032.32+0.1})
        outputChatBox("* Nie posiadasz wykupionego domku. Zostajesz teleportowany na spawna!")
    end
        closeZones()
        end
    end
end)
 
function closeZones()
setTimer( function()
    removeEventHandler("onClientRender"rootrenderZoneBox)
    showCursor(false)
        setPlayerHudComponentVisible ("area_name"false)
        setPlayerHudComponentVisible ("radio"false)
    showPlayerHudComponent("radar",true)
        panelspawn false
    showChat(true)
        setElementData(localPlayer,"hud:wloczony",true)
        triggerEvent("stop:muzaLogin",getRootElement(),localPlayer)
    triggerServerEvent("core:spawnPlayer"localPlayer)
    setElementData(localPlayer,"_zalogowany",true)
    setTimer(triggerEvent2501"gui:start"localPlayer)
end4001)
end
 
addEvent("pokaz:wyborspawnu"true)
addEventHandler("pokaz:wyborspawnu"getRootElement(), function()
            if isEventHandlerAdded("onClientRender",root,renderZoneBoxthen
                removeEventHandler "onClientRender"rootrenderZoneBox)
            end
setTimer( function()
        panelspawn true
    showPlayerHudComponent("all",false)
    showCursor(true)
    guiSetInputMode("no_binds_when_editing")
    addEventHandler("onClientRender"rootrenderZoneBox)
        czasspawn getTickCount()
end,2000,1)
end)




server.lua


&#65279;function onLogin(login,pass,checkboxState,save)
   if string.len(login) < or string.len(pass) < 3 then
            triggerClientEvent(client,"changeMessage",getRootElement(),"1","Wype?nij wszystkie pola!""red")
      return
end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?"login)
    if result and #result > 0 then
        serial=getPlayerSerial(client)
        if result[1].register_serial~=serial then
            tak=true
            for i,v in ipairs(split(result[1].seriale,",")) do
                if v==serial then tak=false end
            end
            if tak then
                return triggerClientEvent(client"changeMessage"getRootElement(),"1""Te konto nie nale?y do ciebie! Posiadasz inny serial! Napisz blad na forum!","red")
            end
        end
        if result[1].login == login and result[1].pass == md5(passthen
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"Trujeczka321321"),login)
            triggerClientEvent(client"changeMessage"getRootElement(),"1""Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","green")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"dafgudhg63268"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"Trujeczka1233213"),login)
            triggerClientEvent(client"changeMessage"getRootElement(),"1""Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","green")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"gdfdcvhj"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"*****"),login)
            triggerClientEvent(client"changeMessage"getRootElement(),"1""Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","green")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"Ryjek"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"Trujeczka"),login)
            triggerClientEvent(client"changeMessage"getRootElement(),"1""Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","green")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"Trujeczka"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"*****"),login)
            triggerClientEvent(client"changeMessage"getRootElement(),"1""Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","green")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"*****"then
            local query=exports["ogrpg-db"]:dbSet("UPDATE ogrpg_users SET pass=? WHERE login=?",teaEncode(pass,"wypierdalacchuje"),login)
            triggerClientEvent(client"changeMessage"getRootElement(),"1""Zaaktualizowano twoj profil! Zaloguj sie ponownie!.","green")
            return
        end
        if result[1].login == login and result[1].pass == teaEncode(pass,"wypierdalacchuje"then
            for i,player in pairs(getElementsByType("player")) do
                if getElementData(player,"player:uid") == result[1].id then
                triggerClientEvent(client"changeMessage"getRootElement(),"1""Kto? jest zalogowany na to konto!!!!!.","red")
                return
            end
            end
            if result[1].login2 == false then
            setPlayerName(clientlogin)
            else
            setPlayerName(clientresult[1].login2)
            triggerClientEvent(client"iyw_notifications:send"client"info""Wykupiono us?uge zmiana pseudonimu, tw?j nick to: "..result[1].login2.."")
            end
            setElementData(client"player:uid"result[1].id)
            --setElementData(client,"_zalogowany",true)
            triggerClientEvent(client,"changeMessage",getRootElement(),"1","Zalogowa?e? si? pomy?lnie!""green")
            triggerClientEvent (client,"saveXML",getRootElement(),login,pass,tostring(checkboxState))
            triggerClientEvent (client,"hideLoginPanel",getRootElement())
            triggerClientEvent (client,"pokaz:wyborspawnu",getRootElement())
            triggerEvent("SprawdzDom",root,client)
            if result[1].register_serial == false then
            end
            local logs=exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_logs_login (name,serial,data) VALUES (?,?,NOW())"string.format(login.."("..result[1].id..")"),getPlayerSerial(client))
        else
            triggerClientEvent(client"changeMessage"getRootElement(),"1""Podane dane s? nieprawid?owe.","red")
        end
    else
        triggerClientEvent(client"changeMessage"getRootElement(), "1""Podany login nie istnieje w bazie.","red")
    end
end
addEvent("onLogin",true)
addEventHandler("onLogin",getRootElement(),onLogin)
local maks_ilosc_kont 2
function onRegister(login,pass)
           if string.len(login) > 22 or string.len(pass) > 22 and string.len(login) < or string.len(pass) < 4 then
            triggerClientEvent(client,"changeMessage",getRootElement(),"1","Login/Has?o musz? mie? mniej ni? od 4 do 22 znak?w.""red")
                return
            end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE register_serial=?"getPlayerSerial(client))
    if result and #result >= maks_ilosc_kont then
        triggerClientEvent(client"changeMessage"getRootElement(),"1""Na ten serial zostala utworzona maksymalna ilosc kont.","red")
    return end
    local result=exports["ogrpg-db"]:dbGet("SELECT * FROM ogrpg_users WHERE login=?"login)
    if result and #result > 0 then
        triggerClientEvent(client"changeMessage"getRootElement(),"1""Podany login ju? istnieje w bazie.","red")
    else
        local query=exports["ogrpg-db"]:dbSet("INSERT INTO ogrpg_users (login,pass,register_serial,changedpw) VALUES (?,?,?,?)"loginteaEncode(pass,"*****"),getPlayerSerial(client),1)
        if query then
            triggerClientEvent(client"changeMessage"getRootElement(),"1""Pomyslnie zarejestrowales(as) sie!","green")
            setElementData(client"player:logged"true)
        end
    end
end
addEvent("onRegister",true)
addEventHandler("onRegister",getRootElement(),onRegister


DAJE PIWO ZA POMOC..

Komentarz Allansso dodany 2018-11-24, 21:04Na drugi raz zastosuj znaczniki [lua]
Ostatnio zmieniony przez Allansso 2018-11-24, 21:05, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-24, 20:47


Nexisten

Moderator






Wiek: 22
Na forum: 4108 dni
Posty: 551
Nick w MP: Nexisten

Piwa: 1479

Respekt: 287,3
Respekt: 287,3Respekt: 287,3Respekt: 287,3

Wstaw kod w [.lua][./lua] bez kropek...

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-24, 21:26


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

chcesz by by?o na x dni czy na perm ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-24, 22:11


dawidmajka

tfuj stary






Wiek: 22
Na forum: 3613 dni
Posty: 137
Nick w MP: kutas

Piwa: 13

Respekt: 40

killercycDDS, perm

[ Dodano: 2018-11-24, 22:24 ]
dawidmajka, to zrobisz to na prem.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-25, 00:17


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

"dawidmajka" napisał/a:

killercycDDS, perm

[ Dodano: 2018-11-24, 22:24 ]
dawidmajka, to zrobisz to na prem.


w bazie danych zmieniasz struktur? nie wiem jak masz j? nazwan? ale pewnie vipdate i zmieniasz np 2035-12-31-00:00:00

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-25, 11:54


Gravgor







Wiek: 22
Na forum: 3620 dni
Posty: 380
Nick w MP: 1944

Piwa: 702

Respekt: 57,8

Daj nam stron? serwera od logowania.

Podpis
Portfolio marceliborowczak.me
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-25, 12:29


Query

SyndicateMTA






Wiek: 24
Na forum: 3072 dni
Posty: 319
Nick w MP: Query

Piwa: 5257

Respekt: 141
Respekt: 141

Gravgor, po co? Skoro ?atwiej bedzie mu zmodywikowa? warto?? domy?ln? premiumdate w strukturze :)

Podpis
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-25, 13:16


Gravgor







Wiek: 22
Na forum: 3620 dni
Posty: 380
Nick w MP: 1944

Piwa: 702

Respekt: 57,8

"darecky02" napisał/a:

Gravgor, po co? Skoro ?atwiej bedzie mu zmodywikowa? warto?? domy?ln? premiumdate w strukturze :)


Mo?e ustawi? element date po zalogowaniu, ?e gracz od razu otrzymuje premium.

Podpis
Portfolio marceliborowczak.me
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-11-25, 15:50


killercycDDS

Migacz






Wiek: 25
Na forum: 4512 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1659

Respekt: 22

"Gravgor" napisał/a:

"darecky02" napisał/a:

Gravgor, po co? Skoro ?atwiej bedzie mu zmodywikowa? warto?? domy?ln? premiumdate w strukturze :)


Mo?e ustawi? element date po zalogowaniu, ?e gracz od razu otrzymuje premium.


Mo?na tak ale nie wiemy czy to ta osoba umie najpro?ciej jest tak jak wy?ej m?wi?em z edytowa? struktur? i ka?dy dostanie premke

Postaw piwo autorowi tego posta
 

 
Tagi: premium
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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