Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local screenWidth, screenHeight = guiGetScreenSize()
- function callClientFunction_s(funcname, ...)
- local arg = { ... }
- if (arg[1]) then
- for key, value in next, arg do arg[key] = tonumber(value) or value end
- end
- loadstring("return "..funcname)()(unpack(arg))
- end
- addEvent("onServerCallsClientFunction_s", true)
- addEventHandler("onServerCallsClientFunction_s", root, callClientFunction_s)
- local language = 1
- local Hud_Data = {acc = "",kills = "",deaths = "",pos = "",ratio = ""}
- local colors_t = {black2=tocolor( 69 ,69 ,69),gold=tocolor(238,180,34,255),gray=tocolor(200,200,200,255),green=tocolor(100,180,34,255),green2=tocolor(100,200,34,255),black=tocolor(0,0,0,255),gray2=tocolor( 25 ,24 ,24),red=tocolor( 225 ,25 ,25),blue=tocolor( 5 ,50 ,225)}
- function math.format(number)
- return tonumber(string.format("%.4f", number))
- end
- function math.round(number, decimals, method)
- decimals = decimals or 0
- local factor = 10 ^ decimals
- if (method == "ceil" or method == "floor") then return math[method](number * factor) / factor
- else return tonumber(("%."..decimals.."f"):format(number)) end
- end
- function getScreenPositionByRelative(x,y)
- local nX,nY =x*screenWidth,y*screenHeight
- return math.format(nX),math.format(nY)
- end
- function yhy2(h,s)
- local mn = s/h
- return tonumber(string.format("%.1f", screenHeight*mn))
- end
- function UpdateHudData(type_d,val)
- if type_d == "t" then
- for k,v in pairs(val) do
- if k == "ratio" then
- Hud_Data[k] = tostring(math.round(v ,2))
- else
- Hud_Data[k] = tostring(v)
- end
- end
- else
- if type_d == "ratio" then
- Hud_Data[type_d] = tostring(math.round(val ,2))
- else
- Hud_Data[type_d] = tostring(val)
- end
- end
- end
- function callServerFunction_s(funcname, ...)
- local arg = { ... }
- if (arg[1]) then
- for key, value in next, arg do
- if (type(value) == "number") then arg[key] = tostring(value) end
- end
- end
- triggerServerEvent("onClientCallsServerFunction_s", root, funcname, unpack(arg))
- end
- function getSizeFromResolution2(x)
- local s1,s2 = 0,0
- if x > 1279 then
- s1 = 1.4 s2 = 1.0
- elseif x > 1023 then
- s1 = 1.2 s2 = 1.0
- elseif x > 799 then
- s1 = 1.0 s2 = 1.0
- else
- s1 = 0.85 s2 = 1.0
- end
- return s1,s2
- end
- local window_login
- local edit
- local edit1
- local obrazek
- function outputEditBox ( )
- if source == edit or source == edit1 then
- toggleControl ( "chatbox", false )
- else
- toggleControl ( "chatbox",true )
- end
- end
- local spawn = false
- addEventHandler( "onClientPlayerSpawn", getLocalPlayer( ),
- function (res )
- if spawn == false then
- spawn = true
- --LoginMenu_hs()
- chooseLang()
- end
- end
- )
- function LoginMenu_hs()
- if window_login == nil then
- local x_,y_ = guiGetScreenSize()
- fadeCamera(false)
- addEventHandler("onClientRender", getRootElement(), draw_loginf)
- local as_x= x_/3.53103448
- local as_y= y_/25.6
- guiCreateStaticImage ( (x_-as_x)/2, 0, as_x, as_y, "mini.png", false )
- edit = guiCreateEdit ( 0.41, 0.495, 0.12, 0.035, "", true)
- guiSetAlpha(edit,0.8)
- guiSetFont ( edit, "default-bold-small" )
- edit1 = guiCreateEdit ( 0.41, 0.55, 0.12, 0.035, "", true )
- guiSetAlpha(edit1,0.8)
- guiSetFont ( edit1, "default-bold-small" )
- guiEditSetMaxLength ( edit,16 )
- guiEditSetMaxLength ( edit1,16 )
- button = guiCreateButton ( 0.3, 0.625, 0.15, 0.04, "Login", true )
- addEventHandler ( "onClientGUIClick", button, Login )
- button2 = guiCreateButton ( 0.5 ,0.625, 0.15, 0.04, "Register", true )
- addEventHandler ( "onClientGUIClick", button2,Register )
- showChat(true)
- showCursor(true)
- addEventHandler ( "onClientGUIClick", getRootElement(), outputEditBox )
- end
- end
- local texts_t = {
- info= {
- [1]="Regulamin:",
- [2]="Rules",
- [3]="ARABIC"},
- rule = {
- [1]="1. Wykazujemy sie kultura osobist¹ i szanujemy innych graczy. \n2. Dzia³anie zgodnie z zasadami serwera, oraz regulaminem. \n3. Team Say (Nie piszemy na ogólnym czacie niepotrzebnych rzeczy) \n4. Czysta gra. \n5. Nie mo¿na wychodzic po za teren areny. \n6. Wykonywanie poleceñ admina \n7. W ka¿dym przypadku nie przestrzegania regulaminu gracz zostaje\n ukarany kick'iem\ban'em.",
- [2]="1. Be fully cultural towards other players, respect their. \n2. Follow the rules of the server. \n3. Use Team Say (do not write unnecessary things at global chat) \n4. Do not use any cheats, only clean playing. \n5. Do not try to run away from the arena's area. \n6. Follow the admin's orders. \n7. Everyone, who won't follow the rules, will be kicked or banned.",
- [3]="1. Be fully cultural towards other players, respect their. \n2. Follow the rules of the server. \n3. Use Team Say (do not write unnecessary things at global chat) \n4. Do not use any cheats, only clean playing. \n5. Do not try to run away from the arena's area. \n6. Follow the admin's orders. \n7. Everyone, who won't follow the rules, will be kicked or banned."},
- has = {
- [1]="Haslo:",
- [2]="Password:",
- [3]="Password:"},
- aut = {
- [1]="Podany login, bedzie automatycznie ustawiany jako nick gracza.",
- [2]="The given login name will be set as your player nickname automatically.",
- [3]="The given login name will be set as your player nickname automatically."}
- }
- local draw_login = {
- box={getScreenPositionByRelative(0.25,0.15)},
- boxsize={getScreenPositionByRelative(0.5,0.55)},
- boxcolor = tocolor(255,255,255,25),
- info={getScreenPositionByRelative(0.35,0.155)},
- rule={getScreenPositionByRelative(0.265,0.22)},
- login={getScreenPositionByRelative(0.345,0.50)},
- register={getScreenPositionByRelative(0.345,0.555)},
- att={getScreenPositionByRelative(0.275,0.45)},
- size1=yhy2(768,1.2),
- size2=yhy2(640,1.0),
- }
- function draw_loginf()
- dxDrawRectangle ( draw_login.box[1],draw_login.box[2],draw_login.boxsize[1],draw_login.boxsize[2] ,draw_login.boxcolor )
- --dxDrawImage ( draw_login.box[1],draw_login.box[2],draw_login.boxsize[1],draw_login.boxsize[2], "s.png" ,0, 0, 0, draw_login.boxcolor )
- dxDrawText (texts_t.info[language], draw_login.info[1],draw_login.info[2] , 0, 0,colors_t.gold,draw_login.size1 , "bankgothic")
- dxDrawText (texts_t.rule[language], draw_login.rule[1],draw_login.rule[2] , 0, 0,colors_t.gray,draw_login.size2 , "default")
- dxDrawText (" Nick:", draw_login.login[1],draw_login.login[2] , 0, 0,colors_t.gold,draw_login.size1 , "default-bold")
- dxDrawText (texts_t.has[language], draw_login.register[1],draw_login.register[2] , 0, 0,colors_t.gold,draw_login.size1 , "default-bold")
- dxDrawText (texts_t.aut[language], draw_login.att[1],draw_login.att[2] , 0, 0,colors_t.red,draw_login.size1 , "default-bold")
- end
- function Login()
- local username = guiGetText ( edit )
- local password = guiGetText ( edit1 )
- if(password ~= "" and username ~= "" ) then
- callServerFunction_s("LoginOnAccount",getLocalPlayer(),username,password)
- end
- end
- function Register()
- local username = guiGetText ( edit )
- local password = guiGetText ( edit1 )
- if type(tonumber(password)) == "number" then
- local txt = {
- [1]="#FF0000** Blad:#0AC419 Haslo musi zawierac chociaz jednen znak inny niz cyfra.",
- [2]="#FF0000** Error:#0AC419 Your login must contain at least one letter besides numbers."}
- outputChatBox ( txt[language], 255, 255, 255, true )
- elseif string.len(username) < 4 then
- local txt = {
- [1]="#FF0000** Blad:#0AC419 Login musi sk³adac sie z minimum 4 znakow.",
- [2]="#FF0000** Error:#0AC419 Username must consist of a minimum of 4 characters."}
- outputChatBox ( txt[language], 255, 255, 255, true )
- elseif string.len(password) < 5 then
- local txt = {
- [1]="#FF0000** Blad:#0AC419 Haslo musi sk³adac sie z minimum 5 znakow.",
- [2]="#FF0000** Error:#0AC419 Password must consist of a minimum of 5 characters."}
- outputChatBox ( txt[language], 255, 255, 255, true )
- elseif type(tonumber(username)) == "number" then
- local txt = {
- [1]="#FF0000** Blad:#0AC419 Login musi zawierac chociaz jednen znak inny niz cyfra.",
- [2]="#FF0000** Error:#0AC419 Your login must contain at least one letter besides numbers."}
- outputChatBox ( txt[language], 255, 255, 255, true )
- elseif string.find(username,"\"") then
- local txt = {
- [1]="#FF0000** Blad:#0AC419 Nie moza uzywac znaku \".",
- [2]="#FF0000** Error:#0AC419 This character is not allowed to use - \"."}
- outputChatBox ( txt[language], 255, 255, 255, true )
- else
- if(password ~= "" and username ~= "" ) then
- callServerFunction_s("CreateNewAccount",getLocalPlayer(),username,password)
- end
- end
- end
- function destroyLogWin()
- addEventHandler("onClientRender", getRootElement(), s_onClientPreRender_Hud)
- removeEventHandler ( "onClientGUIClick", getRootElement(), outputEditBox )
- removeEventHandler("onClientRender", getRootElement(), draw_loginf)
- toggleControl ( "chatbox",true )
- showCursor(false)
- destroyElement(edit )
- destroyElement(edit1 )
- destroyElement(button)
- destroyElement(button2)
- fadeCamera(true)
- --setTimer(triggerEvent,200,1,"introEvent",getLocalPlayer())
- texts_t= nil
- end
- local help_win
- function Help()
- if help_win == nil then
- help_win = guiCreateWindow ( 0.25, 0.2, 0.5, 0.45, "Help", true )
- local l = guiCreateLabel ( 0.15, 0.15, 1, 1, " ** Commands: \n\n/top10 - list of top10 players\n/stats - to check your own statistics \n/stats loginID - to check other players stats\n\n ** Other Commands:\n\n /vote [arena/base] [ID] \nnp: /vote arena 20 \nlub /vote arena 20 26 34 56 ", true, help_win )
- guiSetFont ( l, "default-bold-small" )
- local Button = guiCreateButton ( 0.05, 0.9, 0.9, 0.05, "ok", true, help_win )
- addEventHandler ( "onClientGUIClick", Button, OkButton2 )
- showCursor(true)
- end
- end
- addCommandHandler("help",Help)
- function OkButton2 ()
- removeEventHandler ( "onClientGUIClick", source, OkButton2 )
- destroyElement(help_win)
- help_win = nil
- showCursor(false)
- end
- local top_win
- function DrawTop15(t)
- if top_win == nil then
- local c = {
- [1]={109,109,109},
- [2]={69,69,69 },
- c = 1}
- top_win = guiCreateStaticImage ((screenWidth-400)/2, (screenHeight-500)/2,400, 500, "top10.png", false)
- r = guiCreateLabel ( 0.10, 0.110, 1, 1,"Pos", true, top_win )
- guiSetFont ( r, "default-bold-small" )
- guiLabelSetColor ( r,c[c.c][1],c[c.c][2],c[c.c][3] )
- r = guiCreateLabel ( 0.23, 0.110, 1, 1,"Name", true, top_win )
- guiSetFont ( r, "default-bold-small" )
- guiLabelSetColor ( r,c[c.c][1],c[c.c][2],c[c.c][3] )
- r = guiCreateLabel ( 0.45, 0.110, 1, 1,"Kills", true, top_win )
- guiSetFont ( r, "default-bold-small" )
- guiLabelSetColor ( r,c[c.c][1],c[c.c][2],c[c.c][3] )
- r = guiCreateLabel ( 0.6, 0.110, 1, 1,"Deaths", true, top_win )
- guiSetFont ( r, "default-bold-small" )
- guiLabelSetColor ( r,c[c.c][1],c[c.c][2],c[c.c][3] )
- r = guiCreateLabel ( 0.775, 0.110, 1, 1,"Ratio", true, top_win )
- guiSetFont ( r, "default-bold-small" )
- guiLabelSetColor ( r,c[c.c][1],c[c.c][2],c[c.c][3] )
- local yP = 0.18
- for k,v in ipairs(t) do
- c.c = c.c + 1
- if c.c > 2 then
- c.c = 1
- end
- r = guiCreateLabel ( 0.1, yP, 1, 1,tostring(k)..".", true, top_win )
- guiSetFont ( r, "default-bold-small" )
- guiLabelSetColor ( r,c[c.c][1],c[c.c][2],c[c.c][3] )
- r = guiCreateLabel ( 0.23, yP, 1, 1,tostring(t[k].acc), true, top_win )
- guiSetFont ( r, "default-bold-small" )
- guiLabelSetColor ( r,c[c.c][1],c[c.c][2],c[c.c][3] )
- r = guiCreateLabel ( 0.45, yP, 1, 1,tostring(t[k].kills), true, top_win )
- guiSetFont ( r, "default-bold-small" )
- guiLabelSetColor ( r,c[c.c][1],c[c.c][2],c[c.c][3] )
- r = guiCreateLabel ( 0.6, yP, 1, 1,tostring(t[k].deaths), true, top_win )
- guiSetFont ( r, "default-bold-small" )
- guiLabelSetColor ( r,c[c.c][1],c[c.c][2],c[c.c][3] )
- r = guiCreateLabel ( 0.775, yP, 1, 1,tostring(math.round(t[k].ratio ,2)), true, top_win )
- guiSetFont ( r, "default-bold-small" )
- guiLabelSetColor ( r,c[c.c][1],c[c.c][2],c[c.c][3] )
- yP = yP + 0.07
- end
- local Button = guiCreateButton ( 0.05, 0.9, 0.9, 0.05, "", true, top_win )
- r = guiCreateLabel ( 0.45, 0.25, 1, 1,"CLOSE!", true, Button )
- guiSetFont ( r, "default-bold-small" )
- guiSetAlpha(Button,0.5)
- guiLabelSetColor (r,255,255,255)
- addEventHandler ( "onClientGUIClick", Button, OkButton )
- showCursor(true)
- end
- end
- function OkButton ()
- removeEventHandler ( "onClientGUIClick", source, OkButton )
- destroyElement(top_win)
- top_win = nil
- showCursor(false)
- end
- local She_L = {
- box={getScreenPositionByRelative(0.78,0.185)},
- boxsize={getScreenPositionByRelative(0.17,0.135)},
- boxcolor=tocolor(0,0,0,130),
- info={getScreenPositionByRelative(0.8,0.195)},
- kills={getScreenPositionByRelative(0.795,0.235)},
- kills2={getScreenPositionByRelative(0.83,0.235)},
- deaths={getScreenPositionByRelative(0.865,0.235)},
- deaths2={getScreenPositionByRelative(0.915,0.235)},
- ratio={getScreenPositionByRelative(0.795,0.27)},
- ratio2={getScreenPositionByRelative(0.835,0.27)},
- pos={getScreenPositionByRelative(0.875,0.27)},
- pos2={getScreenPositionByRelative(0.915,0.27)},
- size1=yhy2(768,1.2),
- size2=yhy2(768,0.8),
- }
- function s_onClientPreRender_Hud()
- dxDrawImage ( She_L.box[1],She_L.box[2],She_L.boxsize[1],She_L.boxsize[2], "s.png" ,0, 0, 0, She_L.boxcolor )
- dxDrawText ("Statistics:", She_L.info[1],She_L.info[2] , 0, 0,colors_t.green,She_L.size2 , "bankgothic")
- dxDrawText ("Kills: ", She_L.kills[1],She_L.kills[2] , 0, 0,colors_t.gold,She_L.size1 , "default-bold")
- dxDrawText (Hud_Data.kills, She_L.kills2[1],She_L.kills2[2] , 0, 0,colors_t.gray,She_L.size1 , "default-bold")
- dxDrawText ("Deaths: ", She_L.deaths[1],She_L.deaths[2] , 0, 0,colors_t.gold,She_L.size1 , "default-bold")
- dxDrawText (Hud_Data.deaths, She_L.deaths2[1],She_L.deaths2[2] , 0, 0,colors_t.gray,She_L.size1 , "default-bold")
- dxDrawText ("Ratio: ", She_L.ratio[1],She_L.ratio[2] , 0, 0,colors_t.gold,She_L.size1 , "default-bold")
- dxDrawText (Hud_Data.ratio, She_L.ratio2[1],She_L.ratio2[2] , 0, 0,colors_t.gray,She_L.size1 , "default-bold")
- dxDrawText ("Rank: ", She_L.pos[1],She_L.pos[2] , 0, 0,colors_t.gold,She_L.size1 , "default-bold")
- dxDrawText (Hud_Data.pos, She_L.pos2[1],She_L.pos2[2] , 0, 0,colors_t.gray,She_L.size1 , "default-bold")
- end
- local lang = {
- info={getScreenPositionByRelative(0.3,0.3)},
- plf={getScreenPositionByRelative(0.22,0.61)},
- engf={getScreenPositionByRelative(0.635,0.61)},
- size1=yhy2(768,1.2),
- }
- function chooseLang()
- lang.pl = guiCreateStaticImage ( 0.11, 0.43, 0.25, 0.16, "pl.png", true )
- lang.eng = guiCreateStaticImage ( 0.41, 0.43, 0.25, 0.16, "eng.png", true )
- lang.ar = guiCreateStaticImage ( 0.61, 0.43, 0.25, 0.16, "ar.png", true )
- addEventHandler("onClientRender", getRootElement(), bm_onClientPreRender_Login1)
- addEventHandler ( "onClientGUIClick", lang.pl, onClickFlag, false )
- addEventHandler ( "onClientGUIClick", lang.eng, onClickFlag, false )
- addEventHandler ( "onClientGUIClick", lang.ar, onClickFlag, false )
- showCursor(true)
- end
- function bm_onClientPreRender_Login1()
- dxDrawText ("Select Your Language: \n (click on flag)", lang.info[1],lang.info[2] , 0, 0,colors_t.gold,lang.size1 , "bankgothic")
- dxDrawText ("Polish", lang.plf[1],lang.plf[2] , 0, 0,colors_t.red,lang.size1 , "bankgothic")
- dxDrawText ("English", lang.engf[1],lang.engf[2] , 0, 0,colors_t.blue,lang.size1 , "bankgothic")
- dxDrawText ("Arabic", lang.arf[1],lang.arf[2] , 0, 0,colors_t.blue,lang.size1 , "bankgothic")
- end
- function onClickFlag()
- if source == lang.pl then
- removeEventHandler("onClientRender", getRootElement(), bm_onClientPreRender_Login1)
- removeEventHandler ( "onClientGUIClick", lang.pl, onClickFlag, false )
- removeEventHandler ( "onClientGUIClick", lang.eng, onClickFlag, false )
- removeEventHandler ( "onClientGUIClick", lang.ar, onClickFlag, false )
- destroyElement(lang.pl)
- destroyElement(lang.eng)
- destroyElement(lang.ar)
- lang = {}
- language = 1
- callServerFunction_s("lang_upd",getLocalPlayer(),language)
- LoginMenu_hs()
- else
- removeEventHandler("onClientRender", getRootElement(), bm_onClientPreRender_Login1)
- removeEventHandler ( "onClientGUIClick", lang.pl, onClickFlag, false )
- removeEventHandler ( "onClientGUIClick", lang.eng, onClickFlag, false )
- removeEventHandler ( "onClientGUIClick", lang.ar, onClickFlag, false )
- destroyElement(lang.pl)
- destroyElement(lang.eng)
- destroyElement(lang.ar)
- lang = {}
- language = 2
- callServerFunction_s("lang_upd",getLocalPlayer(),language)
- LoginMenu_hs()
- else
- removeEventHandler("onClientRender", getRootElement(), bm_onClientPreRender_Login1)
- removeEventHandler ( "onClientGUIClick", lang.pl, onClickFlag, false )
- removeEventHandler ( "onClientGUIClick", lang.eng, onClickFlag, false )
- removeEventHandler ( "onClientGUIClick", lang.ar, onClickFlag, false )
- destroyElement(lang.pl)
- destroyElement(lang.eng)
- destroyElement(lang.ar)
- lang = {}
- language = 3
- callServerFunction_s("lang_upd",getLocalPlayer(),language)
- LoginMenu_hs()
- end
- end
- end
- local konto = {}
- function konto_f(data)
- showCursor(true)
- konto.window = guiCreateWindow(0.35,0.35,0.3,0.3,"Your account Panel.",true)
- local tt = {{"Nazwa","Name","arabic"},{"Zabojstwa","Kills","arabic"},{"Smierci","Deaths","arabic"},{
- "Ratio","Ratio","arabic"},{"Pozycja","Ranking","arabic"},{"Zadane obrazania","Total Damage","arabic"}}
- local yP = 0.1
- for i=1,6 do
- local r = guiCreateLabel ( 0.1, yP, 1, 1,tt[i][language]..":", true, konto.window )
- guiSetFont ( r, "default-bold-small" )
- guiLabelSetColor ( r,125,125,125 )
- r = guiCreateLabel ( 0.4, yP, 1, 1,tostring(data[i]), true, konto.window )
- guiSetFont ( r, "default-bold-small" )
- guiLabelSetColor ( r,225,225,225 )
- yP = yP + 0.07
- end
- local txt = {"Zmien Nick","Change Nick","arabic"}
- konto.nick = guiCreateButton ( 0.05, 0.56, 0.9, 0.07, txt[language], true, konto.window )
- addEventHandler ( "onClientGUIClick", konto.nick, konto_f_onClientGUIClick )
- local txt = {"Zmien Haslo","Change Password","arabic"}
- konto.haslo = guiCreateButton ( 0.05, 0.7, 0.9, 0.07, txt[language], true, konto.window )
- addEventHandler ( "onClientGUIClick", konto.haslo, konto_f_onClientGUIClick )
- local txt = {"Zamknij","Close","arabic"}
- konto.close = guiCreateButton ( 0.05, 0.84, 0.9, 0.07, txt[language], true, konto.window )
- addEventHandler ( "onClientGUIClick", konto.close, konto_f_onClientGUIClick )
- end
- addCommandHandler("account",konto_f)
- function konto_f_onClientGUIClick()
- if source == konto.close then
- removeEventHandler ( "onClientGUIClick", konto.nick, konto_f_onClientGUIClick )
- removeEventHandler ( "onClientGUIClick", konto.haslo, konto_f_onClientGUIClick )
- removeEventHandler ( "onClientGUIClick", konto.close, konto_f_onClientGUIClick )
- destroyElement(konto.window)
- konto = {}
- showCursor(false)
- elseif source == konto.change_button_close then
- removeEventHandler ( "onClientGUIClick", konto.change_button)
- removeEventHandler ( "onClientGUIClick", konto.change_button_close )
- destroyElement(konto.change)
- guiSetVisible(konto.window,true)
- elseif source == konto.change_button then
- if konto.type == "pass" then
- local password = guiGetText ( konto.change_edit )
- if type(tonumber(password)) == "number" then
- local txt = {
- [1]="#FF0000** Blad:#0AC419 Haslo musi zawierac chociaz jednen znak inny niz cyfra.",
- [2]="#FF0000** Error:#0AC419 Your login must contain at least one letter besides numbers."}
- [3]="#FF0000** Error:#0AC419 Your login must contain at least one letter besides numbers."}
- outputChatBox ( txt[language], 255, 255, 255, true )
- elseif string.len(password) < 5 then
- local txt = {
- [1]="#FF0000** Blad:#0AC419 Haslo musi sk³adac sie z minimum 5 znakow.",
- [2]="#FF0000** Error:#0AC419 Password must consist of a minimum of 5 characters."}
- [3]="#FF0000** Error:#0AC419 Password must consist of a minimum of 5 characters."}
- outputChatBox ( txt[language], 255, 255, 255, true )
- else
- callServerFunction_s("doThinkWithAccount",getLocalPlayer(),"pass",password)
- guiSetEnabled(source,false)
- end
- elseif konto.type == "name" then
- local username = guiGetText ( konto.change_edit )
- if string.len(username) < 4 then
- local txt = {
- [1]="#FF0000** Blad:#0AC419 Login musi sk³adac sie z minimum 4 znakow.",
- [2]="#FF0000** Error:#0AC419 Username must consist of a minimum of 4 characters."}
- [3]="#FF0000** Error:#0AC419 Username must consist of a minimum of 4 characters."}
- outputChatBox ( txt[language], 255, 255, 255, true )
- elseif type(tonumber(username)) == "number" then
- local txt = {
- [1]="#FF0000** Blad:#0AC419 Login musi zawierac chociaz jednen znak inny niz cyfra.",
- [2]="#FF0000** Error:#0AC419 Your login must contain at least one letter besides numbers."}
- [3]="#FF0000** Error:#0AC419 Your login must contain at least one letter besides numbers."}
- outputChatBox ( txt[language], 255, 255, 255, true )
- elseif string.find(username,"\"") then
- local txt = {
- [1]="#FF0000** Blad:#0AC419 Nie moza uzywac znaku \".",
- [2]="#FF0000** Error:#0AC419 This character is not allowed to use - \"."}
- [3]="#FF0000** Error:#0AC419 This character is not allowed to use - \"."}
- outputChatBox ( txt[language], 255, 255, 255, true )
- else
- callServerFunction_s("doThinkWithAccount",getLocalPlayer(),"name",username)
- guiSetEnabled(source,false)
- end
- end
- elseif source == konto.haslo then
- createChangeWindow({"Zmien Haslo:","Change your password:","arabic"},"pass")
- elseif source == konto.nick then
- createChangeWindow({"Zmien nikc:","Change your nickname:","arabic"},"name")
- end
- end
- function createChangeWindow(title,type)
- guiSetVisible(konto.window,false)
- konto.type = type
- konto.change = guiCreateWindow(0.35,0.35,0.3,0.15,title[language],true)
- konto.change_edit = guiCreateEdit ( 0.05, 0.25, 0.9, 0.175, "", true,konto.change )
- local txt = {"Zmnien.","Change.","arabic."}
- konto.change_button = guiCreateButton ( 0.05, 0.5, 0.9, 0.15, txt[language], true, konto.change )
- addEventHandler ( "onClientGUIClick", konto.change_button, konto_f_onClientGUIClick )
- local txt = {"Zamknij","Close","arabic"}
- konto.change_button_close = guiCreateButton ( 0.05, 0.75, 0.9, 0.15, txt[language], true, konto.change )
- addEventHandler ( "onClientGUIClick", konto.change_button_close, konto_f_onClientGUIClick )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement