Jump to content

N3xT

Retired Staff
  • Posts

    2,490
  • Joined

  • Days Won

    18

Everything posted by N3xT

  1. Looks like your query of getPlayerData is returning nil, so check if your query method is right & the data is already saved on the database
  2. Actually it does, you can use the second argument to detect if he's still pressing "holding" or not, so if he released the key this means he's not holding it anymore.
  3. It's not stealing, shared resources are considered as an open-source, so everyone can learn from them. At least that's my opinion
  4. As far as I know, the only way to solve this is to use event handlers so I'd recommend you to use onResourceStart or onClientResourceStart and re-define the reference.
  5. You only pasted a snippet of your code and It's missing a few lines, so I really can't tell where is the problem
  6. الكود يبغاله تحققات واضافات، لكن عموماً هذا توضيح للفكرة لا اكثر ولا اقل metatables والـ OOP او اذا عندك الخبرة الكافية استخدم الـ local dxlib = {} function dxCreateWindow() local window = createElement("dxWindow") dxlib[window] = { x = 0, y = 0, sx = 0, sy = 0 } return window end function dxCreateButton(parent) local button = createElement("dxButton") dxlib[button] = { x = 0, y = 0, sx = 0, sy = 0 } setElementParent(button, parent) end function toggleWindow(window) dxlib[window].show = false for _, children in ipairs(getElementChildren(window)) do if isElement(children) and dxlib[children] then dxlib[children].show = false end end end
  7. وش تقصد ببيد لتيم
  8. Check this out: https://www.youtube.com/watch?v=nHZJolSKygk https://www.youtube.com/watch?v=Kn1pBKYZFAM
  9. executeSQLQuery("CREATE TABLE IF NOT EXISTS `player_stats` (`username` TEXT, `Thirst` INT, `Hunger` INT)") addEventHandler("onPlayerQuit", root, function () local account = getPlayerAccount(source) if ( isGuestAccount ( account ) ) then return end local atsh = getElementData(source, "Thirst") local hungry = getElementData(source, "Hunger") local username = getAccountName(account) local result = executeSQLQuery("SELECT * FROM player_stats WHERE `username` = ?", username) if (result and #result > 0) then executeSQLQuery("UPDATE `player_stats` SET `Hunger` = ?, `Thirst` = ? WHERE `username` = ?", hungry, atsh, username) else executeSQLQuery("INSERT INTO health (username, Thirst, Hunger) VALUES (?, ?, ?)", username, atsh, hungry) end end ) addEventHandler("onPlayerLogin", root, function (_, account) local accountName = getAccountName(account) local result = executeSQLQuery("SELECT * FROM player_stats WHERE username = ?", accountName) if (result and #result > 0) then setElementData(source, "Thirst", result[1].Thirst) setElementData(source, "Hunger", result[1].Hunger) end end )
  10. local counter = executeSQLQuery("SELECT count FROM playerCounter") X local counter = executeSQLQuery("SELECT count FROM serial") executeSQLQuery("INSERT INTO savedSerials(serial) VALUES(?)",serial) X executeSQLQuery("INSERT INTO serial(savedSerials) VALUES(?)",serial) local q = executeSQLQuery("SELECT username FROM serialUsername WHERE serial=?",serial) X local q = executeSQLQuery("SELECT serialUsername FROM serial WHERE savedSerials=?",serial) وكل الباقية خطأ
  11. يا صاحبي استخدامك للقواعد كله خطأ, راجع الويكي وحاول تعدل اكوادك https://wiki.multitheftauto.com/wiki/ExecuteSQLQuery
  12. outputChatBox ( "From Admin :" .. ... )
  13. https://wiki.multitheftauto.com/wiki/CEF_Tutorial
  14. local functions = { outputText = function ( ... ) outputChatBox ( ... ) end, } functions.outputText ( "Hello", root, 255, 255, 255, true )
  15. الكلينت مافيه ارقمنت للاعب, تكتب رسالتك على طول outputChatBox("test")
  16. Use addCommandHandler to create a command, also the source of onPlayerCommand is the player. so you don't need to add player as a parameter.
  17. المنتدى ممكن يكون قل تفاعله بالقسم العربي, لكن القسم الأجنبي كمثال لا زال متفاعل وبقوة اللعبة يومياً تحقق ارقام قياسية جديدة, تأكد من معلوماتك
  18. السعر حرية شخصية يضعها صاحب السكربت حسب المجهود الذي بذله، اذا ما عجبك السعر ماهو مطلوب منك تنتقد وتطقطق
  19. toJSON does convert a given table into a string, fromJSON is the vice versa.
  20. كلاينت local screenWidth, screenHeight = guiGetScreenSize () function hud () local team = getPlayerTeam ( localPlayer ) if ( team ) then local teamID = getElementData ( team, "id" ) if ( teamID and tonumber ( teamID ) == 1 ) then dxDrawText ( "Police", screenWidth*0.910, screenHeight*0.196, screenWidth*0.986, screenHeight*0.227, tocolor ( 255, 255, 255, 255 ), 2.00, "default-bold", "center", "center", false, false, false, false, false ) end end end addEventHandler ( "onClientRender", root, hud )
×
×
  • Create New...