-
Posts
2,490 -
Joined
-
Days Won
18
Posts posted by N3xT
-
-
9 hours ago, IIYAMA said:
Doesn't the event onClientKey detects hold? hmmm
Well if it doesn't:
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.
- 1
-
It's not stealing, shared resources are considered as an open-source, so everyone can learn from them. At least that's my opinion
- 1
-
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.
- 1
-
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
-
الكود يبغاله تحققات واضافات، لكن عموماً هذا توضيح للفكرة لا اكثر ولا اقل
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
-
وش تقصد ببيد لتيم
-
-
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 )
-
4 hours ago, Snakegold said:
ما أشوف اخطاء؟
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)
وكل الباقية خطأ
-
يا صاحبي استخدامك للقواعد كله خطأ, راجع الويكي وحاول تعدل اكوادك
-
2 minutes ago, iwalidza said:
يعني اقدر اسوي اكثر من شيء داخل الفنكشن و اطلعه وقت ما ابي صحيح؟
local functions = { outputText = function ( ... ) outputChatBox ( ... ) end, outputTextAdmin = function( ... ) outputChatBox ("From Admin :" ... ) end, } functions.outputTextAdmin ( "We need learn :)", root, 255, 255, 255, true )
outputChatBox ( "From Admin :" .. ... )
- 1
-
-
local functions = { outputText = function ( ... ) outputChatBox ( ... ) end, } functions.outputText ( "Hello", root, 255, 255, 255, true )
- 2
-
3 hours ago, Ahmed Ly said:
اول شي كود سيرفر او كلنت
ثاني شي انت وش تبغي تسوي
واخر شي حط كودك الميتا
وكودك مفروض كذا
لو كلنت
outputChatBox("hello world",localPlayer,255,0,0)
الكلينت مافيه ارقمنت للاعب, تكتب رسالتك على طول
outputChatBox("test")
- 1
-
On 26/03/2020 at 19:36, Santi said:
function hex2rgb (hex) local hex = hex:gsub("#","") if hex:len() == 3 then return (tonumber("0x"..hex:sub(1,1))*17)/255, (tonumber("0x"..hex:sub(2,2))*17)/255, (tonumber("0x"..hex:sub(3,3))*17)/255 else return tonumber("0x"..hex:sub(1,2))/255, tonumber("0x"..hex:sub(3,4))/255, tonumber("0x"..hex:sub(5,6))/255 end end -- exemple usage: (NOT TESTED the command) but the function works fine addEventHandler("onPlayerCommand",root, function(command, player) if (command == "convert") then outputConsole("Result: " .. hex2rgb("#ffffff"),player) end end)
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.
-
1 hour ago, unsiXioN said:
ي هلا وغلا يالله حيه
الحمد لله بخير ، التفاعل في المنتدى اشوفه ميت عالآخر وأيضاً نفس الشيء في اللعبة !
المنتدى ممكن يكون قل تفاعله بالقسم العربي, لكن القسم الأجنبي كمثال لا زال متفاعل وبقوة
اللعبة يومياً تحقق ارقام قياسية جديدة, تأكد من معلوماتك
- 1
-
السعر حرية شخصية يضعها صاحب السكربت حسب المجهود الذي بذله، اذا ما عجبك السعر ماهو مطلوب منك تنتقد وتطقطق
- 1
- 1
-
1 hour ago, ايهاب said:
فديو سيرفر روكت ليج خاص بى
- 1
-
You can also use:
split gettok
-
اطرح محاولتك
-
toJSON does convert a given table into a string, fromJSON is the vice versa.
-
كلاينت
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 )
-
-
play
not play
Lua/MySQL: boolean issue
in Scripting
Posted
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