Jump to content

TAPL

Retired Staff
  • Posts

    7,337
  • Joined

  • Days Won

    11

Everything posted by TAPL

  1. You should use dbExec for INSERT as you aren't selecting anything, therefore there will not be any return and you will not have to use dbFree nor dbPoll. If you used dbQuery for INSERT, you will also need to use dbFree as this showed in wiki example. I don't know what will happen if you didn't used dbFree, but i think the database could be locked or something.
  2. This is just to make you able to put the string after the comma. So this: dbExec( connection, "UPDATE `??` SET `??`=?", tableName, columnName, columnValue ) Is the same as this: dbExec( connection, "UPDATE `tableName` SET `columnName`=columnValue" )
  3. هههههههههههههههههه البندر لو تجلس معه من اليوم لين 20 سنة قدام ما راح يقتنع نفس سالفه النجوم و اتوقع للحين ما اقتنع
  4. شوف هو يقول لازم يعني يقصد اجباري عشان يطلق سي بق لازم يسوي الأعدادات بينما في الحقيقة الأعدادات مالها علاقة، ذي يستخدمونها النوبات الي ما يعرفون يسون سي بق
  5. http://lua-users.org/wiki/StringLibraryTutorial
  6. -- Server Side -- bTimes = {} addEventHandler("onBan", root, function() if getElementType(source) == "player" then bTimes[source] = bTimes[source] and ((bTimes[source] or 0) + 1) or bTimes[source] = 1 if bTimes[source] >= 3 then banPlayer(source, false, false, true, root, "سبب الباند") end end end) addEventHandler("onPlayerQuit", root, function() if bTimes[source] then bTimes[source] = nil end end)
  7. وش دخل الأعدادات!!!
  8. وش دخل قاعدة البيانات بالموضوع قاعدة البيانات تستخدم للحفظ الدائم و قاعدة البيانات ما تحفظ المنت
  9. مكرر؟ https://forum.multitheftauto.com/viewtopic.php?f=160&t=68971
  10. لا اول شي تصوب بعدين تفك التصويب بعدين تطلق بعدين تفك زر الطلق بعدين تضغط سي بعدين تفك السي و بعدين تصوب و هكذا كل ذا تسويه بسرعة و تكرر ولا تنسى تمسك زر الأسهم عشان ما يجلس اللاعب
  11. TAPL

    MySQL

    exports.scoreboard:addScoreboardColumn("Money") function setMoney() local Serial = getPlayerSerial(source) local data = dbPoll(dbQuery(server, "SELECT money FROM accounts WHERE serial = ?", Serial), -1) if data and type(data) == "table" and #data > 0 then setPlayerMoney(source, data[1]["money"]) setElementData(source, "Money", data[1]["money"]) else dbExec(server, "INSERT INTO accounts VALUES (?, ?)", Serial, "0") setElementData(source, "Money", 0) end end addEventHandler("onPlayerJoin", root, setMoney) Use UPDATE if you want change existing value. http://www.w3schools.com/sql/sql_update.asp
  12. TAPL

    MySQL

    No, When you select the row there might be more than one row so we select the first row in the table which [1].
  13. TAPL

    MySQL

    exports.scoreboard:addScoreboardColumn("Money") function setMoney() local Serial = getPlayerSerial(source) local data = dbPoll(dbQuery(server, "SELECT money FROM accounts WHERE serial = ?", Serial), -1) if data and type(data) == "table" then setPlayerMoney(source, data[1]["money"]) setElementData(source, "Money", data[1]["money"]) end end addEventHandler("onPlayerJoin", root, setMoney)
  14. TAPL

    MySQL

    local data = dbPoll(dbQuery(server, "SELECT 'money' FROM 'accounts' WHERE serial = '"..serial.."' "), -1) setPlayerMoney(player, data[1]["money"])
  15. TAPL

    MySQL

    So how would i setPlayerMoney when retrieving this information? local playermoney = dbQuery ( server, "SELECT 'money' FROM 'accounts' WHERE serial = '"..serial.."' " )
  16. TAPL

    MySQL

    You can use WHERE clause to select specific row. http://www.w3schools.com/sql/sql_where.asp
  17. TAPL

    MySQL

    I don't understand, can you post your code?
  18. TAPL

    MySQL

    Have you already got the MySQL connected? dbConnect If you want to get certain value you need to use SELECT. http://www.w3schools.com/sql/sql_select.asp
  19. aim + fire + c + aim + fire + c + aim + fire + c + و كذا
  20. The table will not be updated, you should move the table inside the function.
  21. addEventHandler ( "onClientRender", root, function ( ) if ( guiGetVisible ( GUIEditor.window[1] ) ) then local TotalPlayer = #getElementsWithinColShape(getElementColShape(marker), "player") guiSetText ( GUIEditor.label[1], "player: "..TotalPlayer) end end )
  22. طيب وين كودك عشان نشوف المشكلة؟
  23. This MTA bug.
  24. اسهل من هذا؟
  25. The right event would be onClientResourceStart.
×
×
  • Create New...