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: 3754 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()
screenW, screenH = guiGetScreenSize()
mx, my = sw * 0.122, sw * 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", x = sw * 0.5, y = sh * 0.5 - ( sh * 0.400)/2, w = 0, h = sw * 0.244, colorS = tocolor(0, 0, 0), erbox = "bialy", text = "Witamy na My World, zaloguj sie!", messageBox = "1"}
}

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

editbox = {
{ typ = "login", x = sw * 0.5 - sw * 0.244 + sw * 0.545 * 0.3, y = sh * 0.5 - ( sh * 0.405)/2 + sw * 0.244 * 0.34, w = sw * 0.270 * 0.6, h = sw * 0.0270, image = "Img/ebox.png", color = tocolor( 25, 25, 25, AlphaEditBox), text = "", textup = "Login:", name = "Loglogin"},
{ typ = "login", x = sw * 0.5 - sw * 0.244 + sw * 0.545 * 0.3, y = sh * 0.5 - ( sh * 0.405)/2 + sw * 0.270 * 0.34 + sw * 0.0244 + sw * 0.0122, w = sw * 0.270 * 0.6, h = sw * 0.0270, image = "Img/ebox.png", color = tocolor( 25, 25, 25, AlphaEditBox), text = "", textup = "Has?o:", name = "Logpass", hide = true},
{ typ = "register", x = sw * 0.5 - sw * 0.244 + sw * 0.545 * 0.3, y = sh * 0.5 - ( sh * 0.405)/2 + sw * 0.244 * 0.34, w = sw * 0.270 * 0.6, h = sw * 0.0270, image = "Img/ebox.png", color = tocolor( 25, 25, 25, AlphaEditBox), text = "", textup = "Login:", name = "loginRej"},
{ typ = "register", x = sw * 0.5 - sw * 0.244 + sw * 0.545 * 0.3, y = sh * 0.5 - ( sh * 0.405)/2 + sw * 0.270 * 0.34 + sw * 0.0244 + sw * 0.0122, w = sw * 0.270 * 0.6, h = sw * 0.0270, image = "Img/ebox.png", color = tocolor( 25, 25, 25, AlphaEditBox), text = "", textup = "Has?o:", name = "passRej", hide = true}
}
checkboxs = {
  { x =  sw * 0.6 + sw * 0.900 * 0.06, y = sh * 0.5 - ( sh * 0.405)/2 + sw * 0.320 * 0.34 + sw * 0.0244 + sw * 0.0122 + sw * 0.0244 + sw * 0.0122, wh = sw * 0.244 * 0.05, state = false, text = "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.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000, ":ec-PaneLogowania/Img/69.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(screenW * 0.2672, screenH * 0.1159, screenW * 0.4758, screenH * 0.8464, ":ec-PaneLogowania/Img/panelek.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(screenW * 0.4034, screenH * 0.2031, screenW * 0.2196, screenH * 0.1953, ":ec-PaneLogowania/Img/ec.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
local Alpha, Alpha2 = interpolateBetween(0, 0, 0, 158, 255, 0, ((getTickCount() - czas) / 2500), "Linear") 
    for index, login 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 ( 0, 200, 0, 210 )
              elseif ( login.erbox == "red") then 
                login.colorS = tocolor( 200, 0, 0, 210 )
              elseif ( login.erbox == "bialy") then 
                login.colorS = tocolor( 255, 255, 255, 210 )
              end
            end
              if login.text then 
                dxDrawText( login.text, login.x, login.y + login.h * 0.2  , login.x + login.w, login.y + login.h  , login.colorS, sw/1900, Font, "center")
              end
            end
        end 
    end
end 

function renderLoginContent()
AlphaEditBox, AlphaButton = interpolateBetween(0, 0, 0, 190, 160, 0, ((getTickCount() - czas) / 2500), "Linear")
if logopanel == true then
  for i,ebox in ipairs(editbox) do
    if ebox.typ then 
      if ( ebox.typ == "login" ) then 
        dxDrawImage( ebox.x, ebox.y + sy  , ebox.w, ebox.h, ebox.image, 0, 0, 0, ebox.color )
          if ebox.textup then
            dxDrawText( ebox.textup, ebox.x - ebox.x * 0.12, ebox.y + ebox.h * 0.25 + sy  , ebox.x + ebox.w, ebox.y + ebox.h  , tocolor( 230,230,230), sw/1600, Font)
          end
            if isMouseWithinRangeOf(ebox.x, ebox.y + sy  , ebox.w, ebox.h) then
              ebox.color = tocolor(25, 25, 25, 240)
            else
              ebox.color = tocolor(25, 25, 25, 170)
            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.x + 10, ebox.y + sy  , ebox.x + ebox.w, ebox.y + ebox.h + sy  , tocolor( 230,230,230), sw/1600, Font, "left", "center",true)
                  end
              end
                if eboxClickI == i then
                  dxDrawImage( ebox.x, ebox.y  , ebox.w, ebox.h, "Img/border.png", 0, 0, 0, tocolor(255,255,255))
                end
      elseif ( ebox.typ == "register" ) then 
        dxDrawImage( ebox.x, ebox.y + ssy  , ebox.w, ebox.h, ebox.image, 0, 0, 0, ebox.color )
          if ebox.textup then
            dxDrawText( ebox.textup, ebox.x - ebox.x * 0.12, ebox.y + ebox.h * 0.25 + ssy  , ebox.x + ebox.w, ebox.y + ebox.h  , tocolor( 230,230,230), sw/1600, Font)
          end
            if isMouseWithinRangeOf(ebox.x, ebox.y + ssy  , ebox.w, ebox.h) then
              ebox.color = tocolor( 25, 25, 25, 240)
            else
              ebox.color = tocolor( 25, 25, 25, 170)
            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.x + 10, ebox.y + ssy  , ebox.x + ebox.w, ebox.y + ebox.h + ssy  , tocolor( 230,230,230), sw/1600, Font, "left", "center",true)
                  end
              end
                if eboxClickI == i then
                  dxDrawImage( ebox.x, ebox.y  , ebox.w, ebox.h, "Img/border.png", 0, 0, 0, tocolor(255,255,255))
                end
      end 
    end 
  end
    for index, cbox in ipairs ( checkboxs ) do 
    if ( cbox.state == true ) then 
      dxDrawImage(cbox.x , cbox.y  + sy  , cbox.wh, cbox.wh, "Img/accept.png")
      else
        dxDrawImage(cbox.x , cbox.y  + sy  , cbox.wh, cbox.wh, "Img/decline.png")
      end
    if cbox.text then
        dxDrawText (cbox.text, cbox.x + cbox.wh + 5, cbox.y + sy  , cbox.x + cbox.wh*10, cbox.y + cbox.wh  + sy  , tocolor( 230,230,230), sw/2000, Font, "left", "center",true)
      end
  end 
  for index, but in ipairs ( buttons ) do
    if but.typ then 
      if ( but.typ == "login" ) then 
        dxDrawImage( but.x, but.y + sy  , but.w, but.h, "Img/ebox.png", 0, 0, 0, but.color)
          if isMouseWithinRangeOf(but.x, but.y  + sy  , but.w, but.h) then
            but.color = tocolor( 246, 151, 2)
          else
            but.color = tocolor( 246, 151, 2)
          end
            if but.text then 
              dxDrawText( but.text, but.x, but.y + sy  , but.x + but.w, but.y + but.h + sy  , tocolor( 230,230,230), sw/1600, Font, "center", "center")
            end
      elseif ( but.typ == "register" ) then 
        dxDrawImage( but.x, but.y + ssy  , but.w, but.h, "Img/ebox.png", 0, 0, 0, but.color)
          if isMouseWithinRangeOf(but.x, but.y  + ssy  , but.w, but.h) then
            but.color = tocolor( 246, 151, 2)
          else
            but.color = tocolor( 246, 151, 2)
          end
            if but.text then 
              dxDrawText( but.text, but.x, but.y + ssy  , but.x + but.w, but.y + but.h + ssy  , tocolor( 230,230,230), sw/1600, Font, "center", "center")
            end               
      end      
    end
  end 
end
end 
addEventHandler("onClientCharacter", getRootElement(), getCharacter)

function pressLogin()
  for i, ebox 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(), login, pass, checkboxs[1].state)
end
function pressRegister()
  for i, ebox 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(), rejlogin, rejpass)
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(progress, p_Move.easingFunction)
 
  local move = fAnimationTime*sw * 0.122
  removeEventHandler("onClientRender", getRootElement(), renderLoginContent)
  setTimer( function() addEventHandler("onClientRender", getRootElement(), renderLoginContent) end, 1200, 1 )
  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 
   end, 1200, 1 )
  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(progress, p_Move.easingFunction)
  local move = fAnimationTime* sw * 0.122
  removeEventHandler("onClientRender", getRootElement(), renderLoginContent)
  setTimer( function() addEventHandler("onClientRender", getRootElement(), renderLoginContent) end, 1200, 1 )
  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 
   end, 1200, 1 )
  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(mesBox, newMessage, boxColor)
  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.x, b.y + sy, b.w, b.h) then
          outputDebugString("Pressed "..b.text)
            if b.func then
              loadstring("return "..b.func.."()")()
            end
        end
      elseif ( b.typ == "register" ) then
        if isMouseWithinRangeOf(b.x, b.y + ssy, b.w, b.h) then
          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.x, ebox.y + sy, ebox.w, ebox.h) then
          outputDebugString("Pressed "..ebox.textup)
          eboxClickI = i
          return true
        end 
      elseif ( ebox.typ == "register" ) then 
        if isMouseWithinRangeOf(ebox.x, ebox.y + ssy, ebox.w, ebox.h) then
          outputDebugString("Pressed "..ebox.textup)
          eboxClickI = i
            return true
        end 
      end 
    end
  end
  for i,cbox in pairs(checkboxs) do
    if isMouseWithinRangeOf(cbox.x, cbox.y + sy, cbox.wh, cbox.wh) then
      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(posX, posY, sizeX, sizeY)
  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 >= 2000) then 
 end
    logopanel = false
    end, 2000, 1 )
  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 screenW, screenH = guiGetScreenSize()
Font = dxCreateFont( "font1.ttf", 8 )
 
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 isEventHandlerAdded( sEventName, pElementAttachedTo, func )
    if
        type( sEventName ) == 'string' and
        isElement( pElementAttachedTo ) and
        type( func ) == 'function'
    then
        local aAttachedFunctions = getEventHandlers( sEventName, pElementAttachedTo )
        if type( aAttachedFunctions ) == 'table' and #aAttachedFunctions > 0 then
            for i, v in ipairs( aAttachedFunctions ) do
                if v == func then
                    return true
                end
            end
        end
    end
 
    return false
end
 
function renderZoneBox()
if panelspawn == true then
local Alpha, Alpha2 = interpolateBetween(0, 0, 0, 170, 255, 0, ((getTickCount() - czasspawn) / 2500), "Linear")
 dxDrawImage(screenW * 0.0000, screenH * 0.0000, screenW * 1.0000, screenH * 1.0000, ":ec-PaneLogowania/Img/69.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
 dxDrawImage(screenW * 0.2672, screenH * 0.1159, screenW * 0.4758, screenH * 0.8464, ":ec-PaneLogowania/Img/panelek.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
        dxDrawImage(screenW * 0.4034, screenH * 0.2031, screenW * 0.2196, screenH * 0.1953, ":ec-PaneLogowania/Img/ec.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
dxDrawImage(screenW * 0.3104, screenH * 0.6849, screenW * 0.4122, screenH * 0.1953, ":ec-PaneLogowania/Img/spawn.png", 0, 0, 0, tocolor(255, 255, 255, 255), false)
if not isMouseIn(screenW * 0.4429, screenH * 0.6237, screenW * 0.1157, screenH * 0.0456) then
dxDrawImage(screenW * 0.4429, screenH * 0.6237, screenW * 0.1157, screenH * 0.0456, "Img/ebox.png", 0, 0, 0, tocolor(246, 151, 2, Alpha), false)
 
else
dxDrawImage(screenW * 0.4429, screenH * 0.6237, screenW * 0.1157, screenH * 0.0456, "Img/ebox.png", 0, 0, 0, tocolor(246, 151, 2), false)
end
 
if not isMouseIn(screenW * 0.4429, screenH * 0.3893, screenW * 0.1157, screenH * 0.0456) then
dxDrawImage(screenW * 0.4429, screenH * 0.3893, screenW * 0.1157, screenH * 0.0456, "Img/ebox.png", 0, 0, 0, tocolor(246, 151, 2, Alpha), false)
 
else
dxDrawImage(screenW * 0.4429, screenH * 0.3893, screenW * 0.1157, screenH * 0.0456, "Img/ebox.png", 0, 0, 0, tocolor(246, 151, 2), false)
end
 
if not isMouseIn(screenW * 0.4429, screenH * 0.4479, screenW * 0.1157, screenH * 0.0456) then --Przycisk 1
dxDrawImage(screenW * 0.4429, screenH * 0.4479, screenW * 0.1157, screenH * 0.0456, "Img/ebox.png", 0, 0, 0, tocolor(246, 151, 2, Alpha), false)
 
else
dxDrawImage(screenW * 0.4429, screenH * 0.4479, screenW * 0.1157, screenH * 0.0456, "Img/ebox.png", 0, 0, 0, tocolor(246, 151, 2), false)
end
     
if not isMouseIn(screenW * 0.4429, screenH * 0.5065, screenW * 0.1157, screenH * 0.0456) then --Przycisk 1
dxDrawImage(screenW * 0.4429, screenH * 0.5065, screenW * 0.1157, screenH * 0.0456, "Img/ebox.png", 0, 0, 0, tocolor(246, 151, 2, Alpha), false)
 
else
dxDrawImage(screenW * 0.4429, screenH * 0.5065, screenW * 0.1157, screenH * 0.0456, "Img/ebox.png", 0, 0, 0, tocolor(246, 151, 2), false)
end
 
if not isMouseIn(screenW * 0.4429, screenH * 0.5651, screenW * 0.1157, screenH * 0.0456) then --Przycisk 1
dxDrawImage(screenW * 0.4429, screenH * 0.5651, screenW * 0.1157, screenH * 0.0456, "Img/ebox.png", 0, 0, 0, tocolor(246, 151, 2, Alpha), false)
 
else
dxDrawImage(screenW * 0.4429, screenH * 0.5651, screenW * 0.1157, screenH * 0.0456, "Img/ebox.png", 0, 0, 0, tocolor(246, 151, 2), false)  
end      
 
dxDrawText("Urz?d SF", screenW * 0.4458, screenH * 0.6237, screenW * 0.5498, screenH * 0.6693, tocolor(255, 255, 255, Alpha2), 1.30, Font, "center", "center", false, false, false, false, false)
dxDrawText("Przechowalnia SF", screenW * 0.4473, screenH * 0.3893, screenW * 0.5512, screenH * 0.4349, tocolor(255, 255, 255, Alpha2), 1.30, Font, "center", "center", false, false, false, false, false)      
dxDrawText("Mieszkanie",  screenW * 0.4473, screenH * 0.4479, screenW * 0.5512, screenH * 0.4935, tocolor(255, 255, 255, Alpha2), 1.30, Font, "center", "center", false, false, false, false, false)
dxDrawText("Spawn LV", screenW * 0.4473, screenH * 0.5065, screenW * 0.5512, screenH * 0.5521, tocolor(255, 255, 255, Alpha2), 1.30, Font, "center", "center", false, false, false, false, false)
dxDrawText("Spawn BB", screenW * 0.4473, screenH * 0.5651, screenW * 0.5512, screenH * 0.6107, tocolor(255, 255, 255, Alpha2), 1.30, Font, "center", "center", false, false, false, false, false)
end
end
 
addEventHandler("onClientClick", root, function(button,state)
    if panelspawn and button == "left" and state == "down" then
        if isMouseIn(screenW * 0.4429, screenH * 0.6237, screenW * 0.1157, screenH * 0.0456) then
         setElementData(localPlayer,"player:spawn",{-1909.40,486.91,35.17+0.1})
         closeZones()
        end
        if isMouseIn(screenW * 0.4429, screenH * 0.3893, screenW * 0.1157, screenH * 0.0456) then
         setElementData(localPlayer,"player:spawn",{-1972.57,616.49,35.17+0.1})
         closeZones()
        end
        if isMouseIn(screenW * 0.4429, screenH * 0.5065, screenW * 0.1157, screenH * 0.0456) then
         setElementData(localPlayer,"player:spawn",{944.06, 1733.24, 8.85+0.1})
         closeZones()
        end
        if isMouseIn(screenW * 0.4429, screenH * 0.5651, screenW * 0.1157, screenH * 0.0456) then
         setElementData(localPlayer,"player:spawn",{203.57,-65.10,1.58+0.1})
         closeZones()
        end
        if isMouseIn(screenW * 0.4429, screenH * 0.4479, screenW * 0.1157, screenH * 0.0456) then
        local domek=getElementData(localPlayer,"player:house")
        if not domek then
                setElementData(localPlayer,"player:spawn",{387.31, -1521.30, 32.32+0.1})
        outputChatBox("* Nie posiadasz wykupionego domku. Zostajesz teleportowany na spawna!")
    end
        closeZones()
        end
    end
end)
 
function closeZones()
setTimer( function()
    removeEventHandler("onClientRender", root, renderZoneBox)
    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(triggerEvent, 250, 1, "gui:start", localPlayer)
end, 400, 1)
end
 
addEvent("pokaz:wyborspawnu", true)
addEventHandler("pokaz:wyborspawnu", getRootElement(), function()
            if isEventHandlerAdded("onClientRender",root,renderZoneBox) then
                removeEventHandler ( "onClientRender", root, renderZoneBox)
            end
setTimer( function()
        panelspawn = true
    showPlayerHudComponent("all",false)
    showCursor(true)
    guiSetInputMode("no_binds_when_editing")
    addEventHandler("onClientRender", root, renderZoneBox)
        czasspawn = getTickCount()
end,2000,1)
end)




server.lua


&#65279;function onLogin(login,pass,checkboxState,save)
   if string.len(login) < 3 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(pass) then
            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(client, login)
            else
            setPlayerName(client, result[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) < 4 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 (?,?,?,?)", login, teaEncode(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: 4248 dni
Posty: 552
Nick w MP: Nexisten

Piwa: 1486

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: 26
Na forum: 4653 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1667

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: 3754 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: 26
Na forum: 4653 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1667

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: 3761 dni
Posty: 380
Nick w MP: 1944

Piwa: 702

Respekt: 57,8

Daj nam stron? serwera od logowania.

Postaw piwo autorowi tego posta
 

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


Query

SyndicateMTA






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

Piwa: 5238

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: 3761 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.

Postaw piwo autorowi tego posta
 

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


killercycDDS

Migacz






Wiek: 26
Na forum: 4653 dni
Posty: 629
Nick w MP: killer_cyc[DDS]

Piwa: 1667

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