Jump to content

dudeks

Members
  • Posts

    45
  • Joined

  • Last visited

Everything posted by dudeks

  1. print("Id: "..id..", type: "..type(id)) Id: 1, type: number
  2. print("teams: "..tostring(teams)) print("teams[1]: "..tostring(teams[1])) teams: table: 02F28668 teams[1]: nil Edit: Co do tej 4 linii, literowka, bo pisalem to z glowy. W kodzie mam bez tego, uruchamia sie.
  3. Dodałem trochę więcej kodu. Przy odczycie: teams[tonumber(car[auto]["owner"])]["name"] też zwraca nil. print(teams[car[a]["owner"]]["name"]) print(teams[tostring(car[a]["owner"])]["name"]) print(teams[tonumber(car[a]["owner"])]["name"]) Przy każdym zwraca nil. O dziwo, teams[1]["name"] też zwraca nil
  4. WItam. Mam denerwujący mnie problem. Nie mogę odczytać nazwy teamu po id. Powinno odczytać nazwe teamu w kodzie z: teams[car[auto]["owner"]]["name"] local veh = createVehicle(v["model"], v["x"], v["y"], v["z"], v["rx"], v["ry"], v["rz"], "RPG"..tostring(v["id"]), true, tonumber(v["var1"]), tonumber(v["var2"])) car[veh] = { } car[veh]["owner"] == tonumber(v["owner"]) owner to id teamu, do ktorego pojazd należy. 'Przypisywanie' id do teamu: local id = tonumber(data["id"]) teams[id] = {} teams[id]["name"] = tostring(data["name"]) teams[id]["team"] = createTeam("[iD: "..teams[id]["id"].."] "..teams[id]["name"], teams[id]["r"], teams[id]["g"], teams[id]["b"]) Za każdym razem zwraca nil.
  5. Witam. Krotko, zwiezle i na temat. Problem polega na zmianie kodowania wynikow pobierania danych. Dane zapisane do bazy z forum i odczytane na forum maja polskie znaki, odczytane na serwerze daja ?????. Dane zapisane do bazy z serwera i odczytane na serwerze maja polskie znaki, odczytane na forum daja krzaki. Pole ma utf8_general_ci, na utf8_polish_ci jest tak samo. Jakies rozwiazania?
  6. Witam. Mam pewien problem z tym, gdyż mam stworzony przycisk w przycisku. Tutaj pojawia się problem, chcę zablokować tylko przycisk 'ojciec', bez 'dziecka', lecz gdy blokuję 'ojca', to 'dzecko' też jest zablokowane. Jest możliwość zablokowania przycisku głównego, nie blokując childa? build_btn[1] = guiCreateButton(0.0452,0.7258,0.9095,0.2016, "Wejdź/Wyjdź .",true,build_wdw[1]) guiSetFont(build_btn[1],"default-bold-small") guiSetProperty(build_btn[1],"NormalTextColour","FFFFFFFF") build_btn[2] = guiCreateButton(0.7017,0,0.2928,1,"Zamknij",true,build_btn[1]) guiSetFont(build_btn[2],"default-bold-small") i guiSetProperty(build_btn[1],"Disabled","true") blokuje build_btn[1] i [2].
  7. dudeks

    isNumeric()

    age = guiGetText(editage) if isNumeric(age) then .... end edit: function isNumeric(text) if type(text)~="string" and type(text)~="number" then return false end return tonumber(text) and true or false end is working. Thanks!
  8. dudeks

    isNumeric()

    This same. main_s.lua:174: attempt to compare number with nil
  9. dudeks

    isNumeric()

    If text is: "18a" > \main_s.lua:174: attempt to compare number with nil It's don't work. I test it some times ago.
  10. dudeks

    isNumeric()

    Hi. I need a function isNumeric() to check an writed to gui text. Anywho have this function? :>
  11. dudeks

    Mybb Login

    Problem solved. local md5hash = md5(string.lower(md5(getMybb(p, 'salt'))..""..md5(pw)))
  12. dudeks

    Mybb Login

    Your answers are stupid and that's it. You write, I used MySQL, somehow these things to the data, such as salt I need to get ... -.- You wrote a feed to make a hash of it. In the first post I wrote that I did it, but different and I do not like to compare them. Hash: string.lower(md5(md5(getMybb(p, 'salt'))..""..md5(pw))) Function getMybb() is not needed here. It's work.
  13. dudeks

    Mybb Login

    If you have stupid answers, don't reply here, I don't need your stupid answers. I have gamemode on mysql, i get a salt from db, pass from gui, hash it. Here is problem, because hash generated by md5 in mta and php are different, then I can't check password correctly.
  14. dudeks

    Mybb Login

    First and second hash are with salt.
  15. dudeks

    Mybb Login

    Hi. I have a one, big problem. I want to make a MyBB accounts login system. Forum Account = Ingame Account. I find on google how to hash a password for mybb. And here is problem. MD5 in mta make other hash, than md5 in php. In php mybb hash is: 6d15580d1ee35e0b93c9c98421c3412d In mta mybb hash is: F0530A463593D55FB9F750B706E4EF5E How to fix it?
  16. You can give me a code joinHandler in client-side?
  17. Yup Bad Arguments in: addEventHandler("SubmitLogin", getRootElement(), joinHandler) addEventHandler("SubmitRegister", getRootElement(), joinHandler)
  18. HI I modified a Login GUI forum development.mtasa.com All work, when i wanna log in or register i can't. My code is: It's a client side rootElement = getRootElement() function drawWindow(res) if res == getThisResource ( ) then showCursor(true) reglog = guiCreateWindow(220,155,386,251,"Rejestracja i Logowanie",false) reglogTab = guiCreateTabPanel(0.0311,0.0916,0.9456,0.8685,true,reglog) LogTab = guiCreateTab("Logowanie",reglogTab) RegTab = guiCreateTab("Rejestracja",reglogTab) Informacje = guiCreateTab("Informacje",reglogTab) Autor = guiCreateTab("Autor",reglogTab) edituser = guiCreateEdit(0.011,0.2431,0.4274,0.134,"User",true,LogTab) editpass = guiCreateEdit(0.011,0.6546,0.4356,0.1289,"Haslo",true,LogTab) redituser = guiCreateMemo(0.011,0.2431,0.4274,0.134,"User",true,RegTab) reditpass = guiCreateEdit(0.011,0.6546,0.4356,0.1289,"Haslo",true,RegTab) logbtn = guiCreateButton(0.5644,0.2523,0.3753,0.5,"Loguj!",true,LogTab) regbtn = guiCreateButton(0.5644,0.2523,0.3753,0.5,"Rejestruj!",true,RegTab) InfoMemo = guiCreateMemo(0.0274,0.1753,0.9507,0.768,"Jest to gamemod RP + DM. Jezeli nie chcesz bana... zachowuj sie",true,Informacje) LogUser = guiCreateLabel(0.0137,0.1239,0.9562,0.0928,"Uzytkownik:",true,LogTab) guiLabelSetVerticalAlign(LogUser,"top") guiLabelSetHorizontalAlign(LogUser,"left",false) LogPass = guiCreateLabel(0.0164,0.5,0.9644,0.1082,"Haslo:",true,LogTab) guiLabelSetVerticalAlign(LogPass,"top") guiLabelSetHorizontalAlign(LogPass,"left",false) RegUser = guiCreateLabel(0.0137,0.1239,0.9562,0.0928,"Uzytkownik:",true,RegTab) guiLabelSetVerticalAlign(RegUser,"top") guiLabelSetHorizontalAlign(RegUser,"left",false) RegPass = guiCreateLabel(0.0164,0.5,0.9644,0.1082,"Haslo:",true,RegTab) guiLabelSetVerticalAlign(RegUser,"top") guiLabelSetHorizontalAlign(RegUser,"left",false) Label6 = guiCreateLabel(0.0493,0.1422,0.9151,0.2577,"Autorem mapy jest: dudeks",true,Autor) guiLabelSetVerticalAlign(Label6,"top") guiLabelSetHorizontalAlign(Label6,"left",false) guiSetFont(Label6,"sa-header") Label7 = guiCreateLabel(0.0411,0.5,0.8849,0.2732,"Kontakt: [email protected]",true,Autor) guiLabelSetVerticalAlign(Label7,"top") guiLabelSetHorizontalAlign(Label7,"left",false) guiSetVisible(reglog, false) showCursor(true) end end addEventHandler("onClientResourceStart", getRootElement(), drawWindow) function clientSubmitLogin(button) if button == "left" then if ( guiGetText( edituser ) ~= "" ) and ( guiGetText( editpass ) ~= "" ) then end triggerServerEvent("clientSubmitLogin", getRootElement(), guiGetText(edituser), guiGetText(editpass)) guiSetInputEnabled(false) guiSetVisible(reglog, false) showCursor(false) end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () drawWindow() addEventHandler("onClientGUIClick", logbtn, clientSubmitLogin, false) addEventHandler("onClientGUIClick", regbtn, clientSubmitRegister, false) outputChatBox("Welcome to My MTA DM Server, please log in. ") if (wdwLogin ~= nil) then guiSetVisible(wdwLogin, true) end showCursor(true) guiSetInputEnabled(true) end ) function clientSubmitRegister(button) if button == "left" then if ( guiGetText( redituser ) ~= "" ) and ( guiGetText( reditpass ) ~= "" ) then end triggerServerEvent("clientSubmitRegister", getRootElement(), guiGetText(redituser), guiGetText(reditpass)) guiSetInputEnabled(false) guiSetVisible(reglog, false) showCursor(false) end end addEvent("SubmitLogin", true) addEvent("SubmitRegister", true) addEventHandler("SubmitLogin", getRootElement(), joinHandler) addEventHandler("SubmitRegister", getRootElement(), joinHandler) Server side: function joinHandler(username, password) local x,y,z x = 1959.55 y = -1714.46 z = 10 if (client) then spawnPlayer(client, x, y, z) fadeCamera(client, true) outputChatBox("Aha", client) end end Please help me
×
×
  • Create New...