Jump to content

2013martin1212

Members
  • Posts

    130
  • Joined

  • Last visited

Everything posted by 2013martin1212

  1. Rataj i get that gui part but i dont want to a simple spawn system in here only shows and spawn those cars which was buyed from the player
  2. Hello all and happy xmas . Someone can explain me how i can make a car spawner in panel with mysql database like example if the player buy a car in the carshop the car was show in the panel and he can spawn and despawn i dont want to anyone to make me the script all i need is the examples or which programmer words need it of it and i try to create thanks all to help
  3. I want to create a mysql based fun szerver with lots of job system and event and etc if anyone thinks can help me Contact me at : https://www.facebook.com/Core3SystemYoutube/
  4. Hello all i have an opensource mta dayz script and try to edit to if the player was click on the car then open the car inventory and not if the player move closer to the car someone can help me where i can find this and how can be edit or just what i need to looking for and which functions i need to use
  5. local handler = dbConnect( "mysql", "dbname=mtalogin;host=localhost", "root", "", "share=1" ) if handler then outputChatBox("sikeres csatlakozas") end function loginReguest( thePlayer, username, password ) if thePlayer and username and password then if getElementType(thePlayer) == "player" then -- account data -- local account = dbQuery(handler, "SELECT * FROM users WHERE username='" .. username .. "'") if account then local data = dbPoll( account, -1 ) for i, sor in ipairs(data) do if sor["password"] == password then outputChatBox("a") -- character data -- local character = dbQuery(handler, "SELECT * FROM characters WHERE accountname = ?", username "'") setElementData(thePlayer, "acc:adminLevel", sor["adminLevel"]) if character then local adatok = dbPoll(character, -1) for i, sor in ipairs(adatok) do setElementData(thePlayer, "acc:username", username) --spawnPlayer(source, sor["posX"], sor["poY"], sor["poZ"]) spawnPlayer (thePlayer, 0, 0, 5, 0, math.random (0,288), 0, 0) -- spawns player with random skin end end end end end end end end addEvent("logIn", true) addEventHandler("logIn", getRootElement(), loginReguest) 3rd day i try to figure out how i can make a login with mysql perfect but alway got an error please someone push me true this process
  6. i am new in this part i just try to get the player login data from mysql and let them login but i am lost without no tutorial to how :*(
  7. 2013martin1212

    help

    function loginReguest(player,username,password) local account exports.mysql:_Query("SELECT 'users' WHERE username = " .. username) if (account) then local account = accounts[1] -- local password == accounts["password"] then outputChatBox("Succesfully logged In!") spawnPlayer(player,accounts["posX"],accounts["posY"],accounts["posZ"],accounts["pRot"],accounts["pSkin"],accounts["pInt"],accounts["pDim"]) else outputChatBox("Username or Password is wrong!") end end end triggerClientEvent(player,"showHide", getRootElement() ) end addEvent("logIn",false) addEventHandler("logIn",getRootElement(), loginReguest) I try to figure out the mysql but i dont now i am on the right track ??
  8. nice script but i get confused my script is diffrent and i am new scripter but i really want to learn and learn to be a pro programer can you help me ?? dont say it mta wiki because i try it but i dont no which goes which :*( I need a teacher
  9. i try to update and set player data from the database but i get confused function loginReguest(player,username,password) local check = exports.mysql:_QuerySingle("SELECT * FROM users WHERE username = ? " ,username) if check then local checkPass = check.password if (checkPass == password) then logIn(player,getAccount(username),getAccount(password)) triggerClientEvent(player,"showHide", getRootElement()) outputDebugString("User Logged In") end end end addEvent("logIn",true) addEventHandler("logIn",getRootElement(), loginReguest) i dont no how i can be get the data from mysql and spawnPlayer please someone give me some information
  10. 2013martin1212

    Help

    Hello i just have a question how i can be get the data from mysql like posX posY etc unction loginReguest(player,username,password) local check = exports.mysql:_QuerySingle("SELECT * FROM users WHERE username = ? " ,username) if check then local checkPass = check.password if (checkPass == password) then logIn(player,getAccount(username),getAccount(password)) triggerClientEvent(player,"showHide", getRootElement()) outputDebugString("User Logged In") end end end addEvent("logIn",true) addEventHandler("logIn",getRootElement(), loginReguest) but my character data is in the different table i want to get the player namemoney and the position but i cant figure out how i cant find any mysql tutorials for this. pls help
  11. triggered serverside event logIn but event not added to server side
  12. i change all my login data but the debug says i dont add ther serverside event to server side cant trigger there is my img : my server side : local mysql = exports.mysql addEvent("logIn", true) function logThePlayer(thePlayer,username,password) if thePlayer and username and password then if getElementType(thePlayer) == "player" then local account = mysql:db_Query("SELECT FROM users WHERE username'" .. username .."'") for i, sor in ipairs(account) do is sor["password"] == password then mysql:db_Exec("UPDATE users SET serial='" .. getPlayerSerial(thePlayer) .. "' WHERE username='" .. username .. "'") mysql:db_Exec("UPDATE users SET ip='" .. getPlayerIP(thePlayer) .. "' WHERE username='" .. username .. "'") local character = mysql:db_Query("SELECT * FROM characters WHERE accountname ='" .. username .. "'") if character then outputDebugString("Sikeressen talaltam charactert") for i, sor in ipairs(character) do setElementData(thePlayer, "acc:username", username) setPlayerMoney(thePlayer, sor["money"]) spawnPlayer(thePlayer,sor["posX"], sor["posY"],sor["posZ"], sor["pRot"], sor["pSkin"], sor["pInt"], sor["pDim"])) setPlayerName(thePlayer, sor["charactername"]) setCameraTarget(thePlayer, thePlayer) triggerClientEvent(thePlayer, "showHide", getRootElement()) outputChatBox("elvileg jo :D") end end else -- triggerClientEvent(thePlayer, "charactervalaszto", getRootElement()) triggerClientEvent(thePlayer, "showHide", getRootElement()) end end end end end end addEventHandler("logIn", getRootElement(), logThePlayer) my client side: fadeCamera(true) setCameraMatrix( 1468.8785400391, -919.25317382813, 100.153465271, 1468.388671875, -918.42474365234, 99.881813049316) GUIEditor = { tab = {}, tabpanel = {}, edit = {}, button = {}, window = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(411, 200, 438, 337, "Login Panel by Martin", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.tabpanel[1] = guiCreateTabPanel(14, 62, 404, 258, false, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("Login", GUIEditor.tabpanel[1]) GUIEditor.edit[1] = guiCreateEdit(122, 49, 194, 40, "", false, GUIEditor.tab[1]) GUIEditor.edit[2] = guiCreateEdit(122, 123, 194, 40, "", false, GUIEditor.tab[1]) GUIEditor.button[1] = guiCreateButton(122, 170, 194, 40, "Login", false,GUIEditor.tab[1]) GUIEditor.tab[2] = guiCreateTab("Register", GUIEditor.tabpanel[1]) GUIEditor.edit[3] = guiCreateEdit(122, 49, 194, 40, "x", false, GUIEditor.tab[2]) GUIEditor.edit[4] = guiCreateEdit(122, 123, 194, 40, "y", false, GUIEditor.tab[2]) GUIEditor.button[2] = guiCreateButton(122, 170, 194, 40, "Register", false, GUIEditor.tab[2] ) end ) addEvent("showHide",true) function showHide() if guiGetVisible(GUIEditor.window[1]) == true then guiSetVisible(GUIEditor.window[1],false) showCursor(false) elseif guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1],true) showCursor(true) end end addEventHandler("showHide", getLocalPlayer(),showHide) showHide() function buttonClick() if source == GUIEditor.button[2] then local username = guiGetText(GUIEditor.edit[3]) local password = guiGetText(GUIEditor.edit[4]) triggerServerEvent("registerRequest",getLocalPlayer(),getLocalPlayer(),username,password) elseif source == GUIEditor.button[1] then local username = guiGetText(GUIEditor.edit[1]) local password = guiGetText(GUIEditor.edit[2]) triggerServerEvent("logIn",getLocalPlayer(),getLocalPlayer(),username,password) end end addEventHandler("onClientGUIClick",root,buttonClick)
  13. i no not the best scripter i am but if works then works
  14. now its says that the dbPool is faild at line 18 function _Query( ... ) if connection then local query = dbQuery(connection, ... ) local result = dbPoll(query, -1) --this line is doent like some reason :( return result else return false end end
  15. i make it finaly with some help the register version but now i get a new problem i cant log in here is my login server side script: addEvent("loginReguest",true) function loginReguest(player,username,password) local check = exports.mysql:_QuerySingle("SELECT * FROM users WHERE username = ? " ,username) if check then local checkPass = check.password if (checkPass == password) then logIn(player,getAccount(username),tostring(password)) triggerClientEvent(player,"showHide", getRootElement()) outputDebugString("User Logged In") end end end addEventHandler("loginReguest",getRootElement(), loginReguest) there is my mysql script : local connection = nil addEventHandler("onResourceStart", resourceRoot, function(resource) connection = dbConnect( "mysql", "dbname=mtalogin;host=localhost", "root", "", "share=1" ) if connection then outputDebugString(getResourceName(resource) .. "Sqlite connection establised!" ) else outputDebugString(getResourceName(resource) .. "Sqlite connection ERROR!") return false end end ) function _Query( ... ) if connection then local query = dbQuery(connection, ... ) local result = dbPoll(query, -1) return result else return false end end function _QuerySingle(str,...) if connection then local result = Query(str,...) if type(result) == 'table' then return result[1] end else return false end end function _Exec(str,...) if connection then local query = dbExec(connection,str,...) return query else return false end end and ther is my debug image
  16. function play() sound = playSound("resources/christmasde.mp3",true) setSoundVolume(sound,0.5) end addEventHandler("onPlayerJoin",playSound) try this way
  17. now i dont have a coursor :*( btw the register is good
  18. i try to create a mysql login panel but the debug is says this : there is my client file: GUIEditor = { tab = {}, tabpanel = {}, edit = {}, button = {}, window = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(411, 200, 438, 337, "Login Panel by Martin", false) guiWindowSetSizable(GUIEditor.window[1], false) GUIEditor.tabpanel[1] = guiCreateTabPanel(14, 62, 404, 258, false, GUIEditor.window[1]) GUIEditor.tab[1] = guiCreateTab("Login", GUIEditor.tabpanel[1]) GUIEditor.edit[1] = guiCreateEdit(122, 49, 194, 40, "", false, GUIEditor.tab[1]) GUIEditor.edit[2] = guiCreateEdit(122, 123, 194, 40, "", false, GUIEditor.tab[1]) GUIEditor.button[1] = guiCreateButton(122, 170, 194, 40, "Login", false,GUIEditor.tab[1]) GUIEditor.tab[2] = guiCreateTab("Register", GUIEditor.tabpanel[1]) GUIEditor.edit[3] = guiCreateEdit(122, 49, 194, 40, "x", false, GUIEditor.tab[2]) GUIEditor.edit[4] = guiCreateEdit(122, 123, 194, 40, "y", false, GUIEditor.tab[2]) GUIEditor.button[2] = guiCreateButton(122, 170, 194, 40, "Register", false, GUIEditor.tab[2] ) end ) addEvent("showHide",true) function showHide() if guiGetVisible(GUIEditor.window[1]) == true then guiSetVisible(GUIEditor.window[1],false) showCursor(false) elseif guiGetVisible(GUIEditor.window[1]) == false then guiSetVisible(GUIEditor.window[1],true) showCursor(true) end end addEventHandler("showHide", getLocalPlayer(),showHide) showHide() function buttonClick() if source == GUIEditor.button[2] then local username = guiGetText(GUIEditor.edit[3]) local password = guiGetText(GUIEditor.edit[4]) triggerServerEvent("registerRequest",getLocalPlayer(),getLocalPlayer(),username,password) elseif source == GUIEditor.button[1] then local username = guiGetText(GUIEditor.edit[1]) local password = guiGetText(GUIEditor.edit[2]) triggerServerEvent("loginReguest",getLocalPlayer(),getLocalPlayer(),username,password) end end addEventHandler("onClientGUIClick",GUIEditor.window[1],buttonClick) and this is my server file : addEvent("registerRequest",true) function registerRequest (player,username,password,email) local account = getAccount(username) if account == false then local ip = getPlayerIP(player) local serial = getPlayerSerial(player) exports.mysql:_Exec("insert into users(username,password,email,ip,serial) values (?,?,?,?,?)",username,password,email,ip,serial) local addAccount = addAccount(tostring(username),tostring(password)) if addAccount then outputDebugString("User register with username ".. username) else outputDebugString("ERROR Occur while register.") end end end addEventHandler("registerRequest",getRootElement(), registerRequest) addEvent("loginReguest",true) function loginReguest(player,username,password) local check = exports.mysql:_QuerySingle("SELECT * FROM users WHERE username = ? " ,username) if check then local checkPass = check.password if (checkPass == password) then logIn(player,tostring(username),tostring(password)) triggerClientEvent(player,"showHide", getRootElement()) outputDebugString("User Logged In") end end end addEventHandler("loginReguest",getRootElement(), loginReguest)
  19. Hello i try to create a script which is let me to move a boat to A to B position which is working fine , but i want that when the object was get that position then turn back and come back to the starting position but i dont have an idea how local x, y, z = 405.10000610352, -2130.3000488281, 17.200000762939, 0, 0, 180 local hajo = createObject( 8493, x, y, z, 0, 0, 180) --ID,X,Y,Z --tavolodo --local hajo2 = createObject( 8493, 405.10000610352, -2260.3000488281, 17.200000762939,0, 0, 180) --ID,X,Y,Z --tavolodo function indulas() moveObject(hajo, 15000, 405.10000610352, -2230.3000488281, 17.200000762939) -- when reach this position then make a 180 turn and come back to the starting position. end setTimer(indulas, 1000, 1, "") addCommandHandler("1", indulas)
×
×
  • Create New...