Jump to content

2013martin1212

Members
  • Posts

    130
  • Joined

  • Last visited

Everything posted by 2013martin1212

  1. This is my 22. line local login = dbQuery(handler,"SELECT * FROM accounts WHERE AccountName = '"..mysql_escape_string( handler, user ).."' AND Password = '"..mysql_escape_string( handler, md5(pass) ).."';")
  2. i dont want to use the module i try to make the new version like dbConnect and dbQuery
  3. Banger no thats why i try to edit to the new version which doesnt use the modules
  4. 22 es sor debug :attempt to call a local 'user' (a string value)
  5. Hello i find my old scriprs and i cant use it anymore because outdated and i thinking to remake it but i stock on some parts please help , about how to replace to the new mysql part i try it on some one but still not works ;( -- Default host = "127.0.0.1" -- Database Host username = "root" -- Database Username password = "" -- Database Password db = "accounts" -- Database ( Where you got your tables ) handler = dbConnect("mysql", host, username, password, db ) if handler then outputChatBox("sikeres csatlakozas") else outputChatBox("nem sikerult csatlakozni a mysql hez!") end addEventHandler("onPlayerJoin", getRootElement(), function() triggerClientEvent(source, "onJoin", getRootElement()) end ) function onLogin ( player, user, pass ) handler = dbConnect("mysql", host, username, password, db ) local login = dbQuery(handler,"SELECT * FROM accounts WHERE AccountName = '"..mysql_escape_string( handler, user ).."' AND Password = '"..mysql_escape_string( handler, md5(pass) ).."';") if login then local rows = mysql_num_rows(login) if rows == 1 then triggerClientEvent( player, "closeWindow", getRootElement() ) outputChatBox("* You successfully logged in your account!", player, 255, 255, 255) spawnPlayer( player, 0,0,3 ) fadeCamera( player, true ) setCameraTarget( player, player ) else outputChatBox("* Login failed!", player, 255, 255, 255) end mysql_free_result(login) end end addEvent( "onLogin", true ) addEventHandler( "onLogin", getRootElement(), onLogin )
  6. I think to create a brand new gamemode because the DayZ and RPG is boring i think and i pick a Start Wars I looking for a maper and modeller for the server if any one was interesting to create something new contact me at : http://www.facebook.com/CoreGameSystem
  7. 2013martin1212

    Help

    Hi all i try to create a login command with mysql , but when i try to log in then debugscript was give me this problems and this is my script local mysql = exports.cG_MySQL function loginPlayer (thePlayer, command, username, password ) if thePlayer and username and password then if getElementType(thePlayer) == "player" then local account = mysql:dbQuery("SELECT * FROM users WHERE username='" .. username .. "'") for i, sor in ipairs(account) do if sor["password"] == password then local lastLogin = getRealTime() if tostring(lastLogin.month+1):len() < 2 then lastLogin.month = "0" .. tostring(lastLogin.month)+1 end if tostring(lastLogin.monthday):len() < 2 then lastLogin.monthday = "0" .. tostring(lastLogin.monthday) end local lastLoginText = tostring(lastLogin.year+1900 .. "-" .. lastLogin.month .. "-" ..lastLogin.monthday) mysql:db_Exec("UPDATE users SET pLastLogin='" .. lastLoginText .. "' WHERE username='" .. username .. "'" ) mysql:db_Exec("UPDATE users SET pIP='" .. getPlayerIP(thePlayer) .. "' WHERE username='" .. username .. "'") mysql:db_Exec("UPDATE users SET pSerial='" ..getPlayerSerial(thePlayer) .. "' WHERE username='" .. username .. "'") local character = mysql:db_Query("SELECT * FROM characters WHERE accountname='" ..username .. "'") setElementData(thePlayer, "acc:adminLevel", sor["adminLevel"]) if character then outputChatBox("The character was ready to play!") for i, sor in ipairs(character) do setElementData(thePlayer, "acc:username", username) setPlayerMoney(thePlayer, sor["money"]) spawnPlayer(thePlayer, sor["pX"], sor["pY"], sor["pZ"], sor["pRot"], sor["pSkin"], sor["pInt"], sor["pDim"]) setElementData(thePlayer, "acc:legalChange", true) setPlayerName(thePlayer, sor["characterName"] ) setCameraTarget(thePlayer, thePlayer) end end else outputChatBox("Character nincs letrehozva!") end end end end end addCommandHandler("log-in", loginPlayer ) --Make it trigger for /log-in, NOTE:/login is hardcored and cannot be used.
  8. And can you explain how ?
  9. 2013martin1212

    Help

    I have one important question i can be make more textures in one weapon like in the cs:go ?
  10. 2013martin1212

    Help

    Hello someone can help me about the dayz backbacks i want to use it like a weapon system parts use/remove and stay on the inventory And the second problem is i have one item and if i suicide at the server then the item was in the dead karakter inventory which is normal, but i want to create that way when i was die at the server then the item was stay my inventory is this posible to create ?
  11. I try to create a basic login panel, but when i was start the script it says: "triggered serverside event checkAccount, but not added server side" and there is my server.lua file addEvent("checkAccount", true) addEventHandler("checkAccount", root, function() local account = getAccount(getPlayerName(client)) if account then triggerClientEvent(client, "showLogin", client) else triggerClientEvent(client, "showRegister", client) end end ) addEvent("submitRegister", true) addEventHandler("submitRegister", root, function ( password ) local account = getAccount(getPlayerName(client), password) if account == false then local accountAdded = addAccount(getPlayerName(client), password) if accountAdded then outputChatBox("Thank you for registering", client) triggerClientEvent(client, "showLogin", client) else outputChatBox("Something was bad! Contact the administrator!!", client) end end ) addEvent("submitLogin", true) addEventHandler("submitLogin", root, function (password) local account = getAccount(getPlayerName(client), password) if account then if logIn(client, account, password ) == false then outputChatBox("You are already logged in!", client) end else kickPlayer(client,"Wrong Password!!") end end ) And there is my Client.lua please help to fix it thanks addEventHandler("onClientResourceStart", getResourceRootElement(), function () triggerServerEvent("checkAccount", getResourceRootElement()) end ) addEvent("showRegister", true) addEventHandler("showRegister", getRootElement(), function() createRegisterWindow() if (wdwRegister ~= nil ) then guiSetVisible(wdwRegister, true) else outputChatBox("An unexpected error has occured and the log in GUI has not been created.") end showCursor(true) guiSetVisible(true) end ) function clientSubmitRegister(button, state) if button == "left" and state == "up" then local password = guiGetText(edtPass) if password then triggerServerEvent("submitRegister", getRootElement(), password ) guiSetInputEnabled(false) guiSetVisible(wdwRegister, false ) showCursor( false ) else outputChatBox("Please enter the password.") end end end addEvent("showLogin", true) addEventHandler("showLogin", getRootElement(), function () createLoginWindow() if (wdwLogin ~= nil ) then guiSetVisible(wdwLogin, true) else outputChatBox("An unexpected error has occured and the log in GUI has not been created.") end showCursor(true) guiSetInputEnabled(true) end ) function clientSubmitLogin(button, state) if button == "left" and state == "up" then local password = guiGetText(edtPass) if password then triggerServerEvent("submitLogin", getRootElement(), password) guiSetInputEnabled(false) guiSetVisible(false) showCursor(false) else outputChatBox("Please enter the password.") end end end function createRegisterWindow() local X = 0.375 local Y = 0.375 local Width = 0.20 local Height = 0.15 wdwRegister = guiCreateWindow(X, Y, Width, Height, "Registration", true) X = 0.0825 Y = 0.2 Width = 0.25 Height = 0.25 guiCreateLabel(X, Y, Width, Height, "Password", true, wdwRegister) X = 0.425 Y = 0.2 Width = 0.5 Height = 0.15 edtPass = guiCreateEdit (X, Y, Width, Height, "", true, wdwRegister) guiEditSetMaxLenght(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.25 Height = 0.2 btnRegister = guiCreateButton(X, Y, Width, Height, "Register", true, wdwRegister) guiSetVisible(wdwRegister, false) addEventHandler("onClientGUIClick", btnRegister, clientSubmitRegister, false) end function createLoginWindow() local X = 0.375 local Y = 0.375 local Width = 0.20 local Height = 0.15 wdwLogin = guiCreateWindow(X, Y, Width, Height, "Login", true) X = 0.0825 Y = 0.2 Width = 0.25 Height = 0.25 guiCreateLabel(X, Y, Width, Height, "Password", true, wdwLogin) X = 0.415 Y = 0.2 Width = 0.5 Height = 0.15 edtPass = guiCreateEdit(X, Y, Width, Height, "", true, wdwLogin) guiEditSetMaxLenght(edtPass, 50) X = 0.415 Y = 0.7 Width = 0.25 Height= 0.20 btnLogin = guiCreateButton(X, Y, Width, Height, "Login", true, wdwLogin) guiSetVisible(wdwLogin, false) addEventHandler("onClientGUIClick", btnLogin, clientSubmitLogin, false) end
  12. How i can be save a player data into sql ? I saw the sql tutorial, but i am not that good at english local connection = dbConnect("sqlite" , "database.db" ) addEventHandler ( "onResourceStart", getResourceRootElement ( getThisResource() ), function () local queryHandle = dbQuery ( connection, "CREATE TABLE IF NOT EXISTS players (id INT, name TEXT, money INT)") end ) addEventHandler ( "onPlayerQuit", root, function () executeSQLQuery("SELECT money FROM players WHERE name=?", source) local money = getPlayerMoney(thePlayer) executeSQLQuery("UPDATE players SET 'money' =? WHERE 'name'=?", money, source) end ) addEventHandler("onPlayerLogin", root, function() end ) but i am stock at now please help with the explain thanks
  13. I have a dayZ szerver and i make a script for it which is works, but when i get the script its automatically place back the stnadard szerver skin There is my script function vipskin (playerSource) setPlayerSkin(playerSource, 0) end addCommandHandler("vipskin", vipskin)
  14. Please someone help me to set the saving system to mysql i no its need to do the dbQury or something like that ,but i cant edit this scripts local spawnPositions = { {2285.6999511719,-1535.4000244141,625.40002441406}, {2283.3000488281,-1564.1999511719,630.59997558594}, {2286.1999511719,-1522.5,623}, } local playerDataTable = { {"alivetime"}, {"skin"}, {"MAX_Slots"}, {"bandit"}, {"blood"}, {"food"}, {"thirst"}, { "temperature" }, { "currentweapon_1" }, { "currentweapon_2" }, { "currentweapon_3" }, {"bleeding"}, {"brokenbone"}, {"pain"}, {"cold"}, {"infection"}, {"humanity"}, {"points"}, { "zombieskilled" }, {"headshots"}, {"murders"}, { "banditskilled" }, {"Wood Pile"}, {"Bandage"}, { "Water Bottle" }, {"Pasta Can"}, {"Beans Can"}, {"Burger"}, { "Box of Matches" }, {"G17 Mag"}, {"Makarov SD Mag"}, { ".45 ACP" }, {"G17"}, {"Makarov SD"}, { "Winchester 1866" }, {"PDW"}, { "Hunting Knife" }, {"Hatchet"}, {"Pizza"}, {"Morphine"}, { "Soda Bottle" }, { "Empty Gas Canister" }, { "Full Gas Canister" }, {"Roadflare"}, {"Milk"}, {"PDW Mag"}, {"MP5A5 Mag"}, {"30Rnd. AKS"}, {"STANAG Mag"}, {"Tear Gas"}, {"M67 Frag Grenade"}, { "Revolver" }, { "Sawn-Off Shotgun" }, { "SPAZ-12 Combat Shotgun" }, {"MP5A5"}, {"Watch"}, {"Medic Kit"}, {"Heat Pack"}, { "Lee Enfield" }, {"PDW"}, {"AKS-74 Kobra"}, {"Blood Bag"}, {"GPS"}, {"Map"}, {"Toolbox"}, {"Wire Fence"}, {"Tire"}, {"Engine"}, {"Tank Parts"}, {"DMR Mag"}, {"TEC-9 Mag"}, {"Lee Enfield Mag"}, {"M4A1 CCO"}, {"DMR"}, {"TEC-9"}, {"Satchel"}, {"Infrared Goggles"}, {"Night Vision Goggles"}, {"Tent"}, {"Raw Meat"}, {"Cooked Meat"}, {"Camouflage Clothing"}, {"Ghillie Suit"}, {"Ghillie Suit [F]"}, {"Civilian Clothing"}, {"Camouflage [F] Clothing"}, {"Survivor Clothing"}, {"Civil Clothing"}, {"Painkiller"}, {"Binoculars"}, {"Empty Water Bottle"}, { "Empty Soda Cans" }, { "Scruffy Burgers" }, {"1866 Slug"}, {"2Rnd. Slug"}, { "SPAZ-12 Pellet" }, { "Radio Device" }, { "Machete" }, {"Crowbar"}, {"Golf Club"}, { "Radio Device" }, {"Parachute"} } function playerLogin(username, pass, player) local playerID = getAccountData(getPlayerAccount(player), "playerID") account = getPlayerAccount(player) local x, y, z = getAccountData(account, "last_x"), getAccountData(account, "last_y"), getAccountData(account, "last_z") local skin = getAccountData(account, "skin") createZombieTable(player) if getAccountData(account, "isDead") then spawnDayZPlayer(player) return end spawnPlayer(player, x, y, z, math.random(0, 360), skin, 0, 0) fadeCamera(player, true) setCameraTarget(player, player) playerCol = createColSphere(x, y, z, 1.5) setElementData(player, "playerCol", playerCol) attachElements(playerCol, player, 0, 0, 0) setElementData(playerCol, "parent", player) setElementData(playerCol, "player", true) for i, data in ipairs(playerDataTable) do local elementData = getAccountData(account, data[1]) if not elementData and data[1] ~= "brokenbone" and data[1] ~= "pain" and data[1] ~= "cold" and data[1] ~= "infection" and data[1] ~= "currentweapon_1" and data[1] ~= "currentweapon_2" and data[1] ~= "currentweapon_3" then if data[1] == "bandit" then else elementData = 0 end end setElementData(player, data[1], elementData) end setElementData(player, "logedin", true) local weapon = getElementData(player, "currentweapon_1") if weapon then local ammoData, weapID = getWeaponAmmoType(weapon) giveWeapon(player, weapID, getElementData(player, ammoData), true) end local weapon = getElementData(player, "currentweapon_2") if weapon then local ammoData, weapID = getWeaponAmmoType(weapon) giveWeapon(player, weapID, getElementData(player, ammoData), false) end local weapon = getElementData(player, "currentweapon_3") if weapon then local ammoData, weapID = getWeaponAmmoType(weapon) giveWeapon(player, weapID, getElementData(player, ammoData), false) end setElementModel(player, getElementData(player, "skin")) setElementData(player, "admin", getAccountData(account, "admin") or false) setElementData(player, "supporter", getAccountData(account, "supporter") or false) triggerClientEvent(player, "onClientPlayerDayZLogin", player) end addEvent("onPlayerDayZLogin", true) addEventHandler("onPlayerDayZLogin", getRootElement(), playerLogin) Skins = {} function playerRegister(username, pass, player) triggerClientEvent(player, "sex", player) local number = math.random(table.size(spawnPositions)) local x, y, z = spawnPositions[number][1], spawnPositions[number][2], spawnPositions[number][3] spawnPlayer(player, x, y, z, math.random(0, 360), 73, 0, 0) fadeCamera(player, true) setCameraTarget(player, player) playerCol = createColSphere(x, y, z, 1.5) attachElements(playerCol, player, 0, 0, 0) setElementData(playerCol, "parent", player) setElementData(playerCol, "player", true) for i, data in ipairs(playerDataTable) do if data[1] == "Bandage" then setElementData(player, data[1], 2) elseif data[1] == "Painkiller" then setElementData(player, data[1], 1) elseif data[1] == "Parachute" then setElementData(player, data[1], 1) elseif data[1] == "MAX_Slots" then setElementData(player, data[1], -- s8) --> elseif data[1] == "skin" then setElementData(player, data[1], 73) elseif data[1] == "blood" then setElementData(player, data[1], 12000) elseif data[1] == "temperature" then setElementData(player, data[1], 37) elseif data[1] == "brokenbone" then setElementData(player, data[1], false) elseif data[1] == "pain" then setElementData(player, data[1], false) elseif data[1] == "cold" then setElementData(player, data[1], false) elseif data[1] == "infection" then setElementData(player, data[1], false) elseif data[1] == "food" then setElementData(player, data[1], 100) elseif data[1] == "thirst" then setElementData(player, data[1], 100) elseif data[1] == "currentweapon_1" then setElementData(player, data[1], false) elseif data[1] == "currentweapon_2" then
  15. now i get another problem A képet a Képfeltöltés.hu tárolja. http://www.kepfeltoltes.hu
  16. Now i get this debug problem A képet a Képfeltöltés.hu tárolja. http://www.kepfeltoltes.hu
  17. Now its give me an error at server.lua line 6 attemp to call global 'getElementType' (a nil value )
  18. Bad argument guiGetText at 47 and 48 lines
  19. Its give me this when i press the button A képet a Képfeltöltés.hu tárolja. http://www.kepfeltoltes.hu
  20. I try to create a mysql login panel the connection was work now , but dont let me to log in please help to figure out the problem my clien side is : -----* Created by Core -----* cG_AccountSystem client.lua file. local X = 0.375 local Y = 0.375 local Width = 0.25 local Height = 0.25 local alap = guiCreateWindow(X, Y, Width, Height, "Please Log In", true) local userNameClick = guiCreateEdit(60, 60, 250, 30, "Username", false, alap) guiSetAlpha(userNameClick,1) local passWordClick = guiCreateEdit(60, 120, 250, 30, "Password", false, alap) local loginClick = guiCreateButton(80, 160, 200, 50, "Log In", false, alap) -- x, y, z, meret local timeElapsed = 0 guiSetInputMode("no_binds") fadeCamera(true, 0.5) showCursor(true) local userNameTable = {} local passWordTable = {} function cC() for i = 0, 25 do outputChatBox(" ") end outputChatBox("#FFFFFFÜdvözöllek a #217AA2Core Game System #FFFFFFszerveren " .. getPlayerName(localPlayer) .. ".", 0, 0, 0, true) end function windowHandler( ) local playername = getPlayerName(localPlayer) guiSetText(userNameClick, "") guiSetText(userNameClick, "") guiSetText(userNameClick, playername) guiSetText(userNameClick, playername) guiSetVisible ( alap, true ) guiSetInputEnabled(true) showCursor ( true ) end function onClickBtn ( button, state ) if (source == loginClick) then triggerServerEvent ( "logIn", getRootElement(), localPlayer, guiGetText(LoginUsername), guiGetText(LoginPassword) ) end end function hideLGP() guiSetInputEnabled(false) guiSetVisible ( GUIEditor_Window[1], false ) showCursor ( false ) end addEvent( "hideLGP", true ) addEventHandler( "hideLGP", getRootElement(), hideLGP ) addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), windowHandler ) addEventHandler ( "onClientGUIClick", loginClick, onClickBtn, false ) My Server side local mysql = exports.cG_MySQL function logThePlayer(thePlayer, username, password) if thePlayer and username and password then if getElementTpe(thePlayer) == "player" then local account = mysql:dbQuery("SELECT * FROM accounts WHERE username='" .. username .. "'") for i, sor in ipairs(account) do if sor["password"] == password then local lastLogin = getRealTime() if tostring(lastLogin.month+1):len() < 2 then lastLogin.month = "0" ..tostring(lastLogin.month)+1 end if tostring(lastLogin.monthday):len() < 2 then lastLogin.monthday = "0" ..tostring(lastLogin.monthday) end local lastLoginText = tostring(lastLogin.year+1900 .. "-" .. lastLogin.month .. "-" .. lastLogin.monthday) mysql:dbQuery("UPDATE accounts SET LastLogin='" .. lastLoginText .. "' WHERE username='" .. username .. "'" ) --egyenlore csak a utolso belepest elenorzi local character = mysql:dbQuery("SELECT * FROM characters WHERE accountname='" .. username .. "'") if character then outputChatBox("van karaktered") else outputChatBox("meg nincs karaktered") end else triggerClientEvent(thePlayer, "hideLGP", getRootElement()) end end end end end addEvent("logIn", true) addEventHandler("logIn", getRootElement(), logThePlayer)
  21. I try but i dont find any sql login panel only just the accoundata version
  22. I try to create a sql login panel, but i dont no how to get the data from the sql like the player username and password and after he was try to login how to import the user and password was = then the player vas login some help me pls
  23. Nice script its help me a lots , but can you added to save the player data ass wel
  24. 2013martin1212

    Help

    Hello please help i start to learnt the mysql and i try to make a log in panel but the system doesnt want to work there is my script Server side host = "localhost"; name = "thesee"; user = "root"; password = ""; addEventHandler("onPlayerJoin", getRootElement(), function() triggerClientEvent(source, "onJoin", getRootElement()) end ) function onLogin ( player, user, pass ) connect = dbConnect( "mysql", "dbname=" .. name .. ";host=" .. host, user, password ) local login = dbQuery(connect,"SELECT * FROM accounts WHERE username = '"..user( connect, user ).."' AND password = '"..pass( connect, md5(pass) ).."';") if login then local rows = mysql_num_rows(login) if rows == 1 then triggerClientEvent( player, "closeWindow", getRootElement() ) outputChatBox("* You successfully logged in your account!", player, 255, 255, 255) spawnPlayer( player, 0,0,3 ) fadeCamera( player, true ) setCameraTarget( player, player ) else outputChatBox("* Login failed!", player, 255, 255, 255) end mysql_free_result(login) end end addEvent( "onLogin", true ) addEventHandler( "onLogin", getRootElement(), onLogin ) And the client side login_register_window = guiCreateWindow(448,192,419,227,"MySQL Login System",false) guiWindowSetMovable(login_register_window,false) guiWindowSetSizable(login_register_window,false) tab_panel = guiCreateTabPanel(0.0859,0.1982,0.8282,0.7225,true,login_register_window) login_tab = guiCreateTab("Login",tab_panel) user_edit_l = guiCreateEdit(0.2507,0.15,0.6311,0.2,"",true,login_tab) pw_edit_l = guiCreateEdit(0.2507,0.4143,0.634,0.1929,"",true,login_tab) login_btn_l = guiCreateButton(0.2536,0.6643,0.634,0.2071,"Login",true,login_tab) guiSetFont(login_btn_l,"default-bold-small") username_label_l = guiCreateLabel(0.0317,0.1571,0.219,0.1929,"Username: ",true,login_tab) guiLabelSetVerticalAlign(username_label_l,"center") guiLabelSetHorizontalAlign(username_label_l,"right",false) guiSetFont(username_label_l,"default-bold-small") pw_label_l = guiCreateLabel(0.0692,0.4286,0.17,0.1714," Password: ",true,login_tab) guiLabelSetVerticalAlign(pw_label_l,"center") guiLabelSetHorizontalAlign(pw_label_l,"center",false) guiSetFont(pw_label_l,"default-bold-small") guiEditSetMasked( pw_edit_l, true ) guiSetVisible( login_register_window, false ) function playerJoin() guiSetVisible( login_register_window, true ) showCursor( true ) guiSetInputEnabled( true ) setCameraMatrix( -1799.6999511719, 1856.5999755859, 30.39999961853, -1763.9000244141, 1852.5999755859, 19.799999237061 ) fadeCamera (true) end addEvent("onJoin", true) addEventHandler("onJoin", getRootElement(), playerJoin) function closeWindow() guiSetVisible( login_register_window, false ) showCursor( false ) guiSetInputEnabled( false ) end addEvent("closeWindow", true) addEventHandler("closeWindow", getRootElement(), closeWindow) function login_player ( source ) triggerServerEvent ( "onLogin", getRootElement(), getLocalPlayer(), guiGetText(user_edit_l), guiGetText(pw_edit_l) ) end addEventHandler("onClientGUIClick", login_btn_l, login_player,false)
×
×
  • Create New...