-
Posts
60 -
Joined
-
Last visited
Everything posted by -ffs-AbodyRulez
-
dxDrawMaterialLine3D هل ممكن يتحول الى شكل دائري؟
-ffs-AbodyRulez replied to -ffs-AbodyRulez's topic in البرمجة
-
dxDrawMaterialLine3D هل ممكن يتحول الى شكل دائري؟
-ffs-AbodyRulez replied to -ffs-AbodyRulez's topic in البرمجة
يعني يكون كأنو فعلا "حبل" وبسماكة معينة, لو تلاحظ في الصورة طالع مسطح -
السلام عليكم, البوست متكرر في القسم الانجليزي بس ماحد رد. هل ممكن تحويل الخط الى مجسم دائري بسمك معين ؟ الكود الحالي local img = dxCreateTexture("test.png") dxSetTextureEdge(img,"mirror") addEventHandler("onClientRender", root, function() x, y, z = getElementPosition(localPlayer) dxDrawMaterialLine3D (x,y,z,0,0,15,img, 0.5) end)
-
Sure, contact me on [email protected]
-
Is it possible to make this line spherical than flat? local img = dxCreateTexture("test.png") dxSetTextureEdge(img,"mirror") addEventHandler("onClientRender", root, function() x, y, z = getElementPosition(localPlayer) dxDrawMaterialLine3D (x,y,z,0,0,15,img, 0.5) end)
-
local ID = dbExec(db, "SELECT LAST_INSERT_ROWID() FROM joinHistory") this returns false for me, even though the database isn't empty. i'm trying to create an auto_increment column, but just found out that sqlite doesn't support auto_increment, it's only supported by MySQL. any help?
-
Sorry for bumping this up, but i've been trying to create an Auto_increment column, tried to follow your method, but i keep getting an error dbExec failed, syntax error, any ideas?
-
tabPanel hides the last tab depending on resolution
-ffs-AbodyRulez replied to -ffs-AbodyRulez's topic in Scripting
You lost me there. Here is the complete code for creating window and tabpanel. local guiWidth, guiHeight, centerX, centerY, tCenterX, tCenterY, tabWidth, tabHeight = 0 local tabPanel, monthsTab, daysTab, hoursTab, minutesTab, permTab = nil local window = nil function GUI() guiWidth, guiHeight = 0.6, 0.6 centerX, centerY = (1 / 2) - (guiWidth / 2), (1 / 2) - (guiHeight / 2) tabWidth, tabHeight = 0.32, 0.25 tCenterX, tCenterY = (1 / 2) - (tabWidth / 2), (1 / 2) - (tabHeight / 2) window = guiCreateWindow( centerX, centerY, guiWidth, guiHeight, "Alias System", true) guiWindowSetSizable (window, false) tabPanel = guiCreateTabPanel(tCenterX, tCenterY+0.355, tabWidth, tabHeight, true, window) monthsTab = guiCreateTab("Months", tabPanel) daysTab = guiCreateTab("Days", tabPanel) hoursTab = guiCreateTab("Hours", tabPanel) minutesTab = guiCreateTab("Minutes", tabPanel) permTab = guiCreateTab("Permanent", tabPanel) guiSetVisible(window, false) end addEventHandler("onClientResourceStart", resourceRoot, GUI) Btw, is adding all variables above as local defining their initial state is healthy for MTA? there is this counter i defined to local counter = 0, it didn't work, after removing the local keyword it worked, even though its not inside a function. -
tabPanel hides the last tab depending on resolution
-ffs-AbodyRulez replied to -ffs-AbodyRulez's topic in Scripting
Edited code, i completely didn't notice, been up for too long! -
Now this is weird, because i'm using relative window, relative tabPanel, relative everything, the size of the GUI window is always the same for all resolutions though, centered, not bigger or smaller than usual. However, only the tab is messed up. Notice the last tab "Permanent" isn't showing for a player with lower resolution. tabWidth, tabHeight = 0.32, 0.25 tCenterX, tCenterY = (1 / 2) - (tabWidth / 2), (1 / 2) - (tabHeight / 2) tabPanel = guiCreateTabPanel(tCenterX, tCenterY+0.355, tabWidth, tabHeight, true, window) monthsTab = guiCreateTab("Months", tabPanel) daysTab = guiCreateTab("Days", tabPanel) hoursTab = guiCreateTab("Hours", tabPanel) minutesTab = guiCreateTab("Minutes", tabPanel) permTab = guiCreateTab("Permanent", tabPanel) Notice i set the sorting to false, its really bugged, after sorting few times, reopening gridlist shows empty cells, but that's another problem, if anyone is aware of it, please leave a comment.
-
executeCommandHandler won't work properly on /mute [args..]
-ffs-AbodyRulez replied to -ffs-AbodyRulez's topic in Scripting
After a lot of hours! i just found out !!! it receives only one string and divides its spaces! function MuteSelectedSerial(serial, seconds, reason) local name = getPlayerName(getPlayerFromSerial(serial)):gsub('#%x%x%x%x%x%x', '') executeCommandHandler("mute",source [b], name.." "..seconds.." "reason[/b]) end addEvent("onSerialMute", true) addEventHandler("onSerialMute", root, MuteSelectedSerial) MTA forum is an inspiration <3 -
On our servers, we have a customized admin resource which has a mute system by entering the following arguments: /mute [playerName] [ Period "1d" "30m" "500"] [Reason] I searched everywhere in admin resource, but there were no straight forward function so i couldn't figure out how to export it. After many attempts, i created this function: function MuteSelectedSerial(serial, seconds, reason) local name = getPlayerName(getPlayerFromSerial(serial)):gsub('#%x%x%x%x%x%x', '') executeCommandHandler("mute",source , name, seconds, reason) end addEvent("onSerialMute", true) addEventHandler("onSerialMute", root, MuteSelectedSerial) but it will only mute the player for no specific amount or reason "its working as i'm doing /mute [playerName] only" However, i made sure that 'seconds' and 'reason' are correctly sent through the executeCommandHandler, tried tostring(seconds) tonumber(seconds) still won't work. Any ideas?
-
My client scripts and GUI are shared among all players!
-ffs-AbodyRulez replied to -ffs-AbodyRulez's topic in Scripting
A big fat thanks -
My client scripts and GUI are shared among all players!
-ffs-AbodyRulez replied to -ffs-AbodyRulez's topic in Scripting
Crap.. you did told me where my problem is, but i can't seem to fix it.. the "attachedElement" part is a damn mystery, that can be found in triggerServerEvent/triggerClientEvent/addEventHandler -
My client scripts and GUI are shared among all players!
-ffs-AbodyRulez replied to -ffs-AbodyRulez's topic in Scripting
MARRY ME . QUICK <3 <3 -
This is driving me nuts! Finished creating an admin panel, and it works perfectly, tried to test it with teammates, and it got all fucked up, results are doubled, whenever someone presses a button, results show for everyone, event though it's a client side script, the server side script includes dbExec stuff, any ideas??
-
My post was a huge misunderstanding actually, just realized that dxGui is a custom made resource. I thought i could only create a normal GUI and turn it into a themed DX..
-
I've created this gui window, buttons, gridlist, and tabpanel. i have a separated dx.lua file which includes dxCreateButtonfunction, dxCreateWindow function, etc.. now, my script works just perfectly without any warning. However, when i tried to exports.resourcename:dxFunction() all the old gui element properties are screwed up, for example : guiSetVisible(window, true) -- The above code used to work with the ordinary guiCreateWindow element -- after changing it to exports.resourcename:dxCreateWindow(...) -- it warns about "Expected GUI element, got DX :/" Hope i made it clear enough.
-
SQL help: Select multiple rows on each db execute
-ffs-AbodyRulez replied to -ffs-AbodyRulez's topic in Scripting
Worked like charm!. However, if i wanted to iterate this, should i just increment both of numbers? Limit i+=5 , j+=5 ? EDIT: Figured it out, thanks, motshakkren ya '3ali -
So i have this huge database, i want a dbExec command to select the first 5 rows on each time its called, 5 different rows of course, I've tried Limit, Count, not sure if MTA SQL has Row_number, but anyway, any ideas? Example: First call : row 1 row 2 row 3 row 4 row 5 Second Call: row 6 row 7 row 8 row 9 row 10 and so on
-
Are those functions updated with the new MTA 1.5? If not, is there anyway to update them? Thanks, EDIT: Just noticed your comment back there, can you share that application?
-
TriggerServerEvent won't send a marker
-ffs-AbodyRulez replied to -ffs-AbodyRulez's topic in Scripting
Thank you for this amazing short answer I'll just send the X,Y,Z positions of marker and then and re-create it server side -
Use toJSON with these positions, better then an array for each
-
I don't know whats wrong with this marker, when validating using isElement(marker) it showed no error, but when i trigger an event and send it, it wont work, tried toJSON and fromJSON, but it showed this error :couldn't convert userdata aergument to JSON, can't convert elements. Any suggestions?
-
https://wiki.multitheftauto.com/wiki/OnElementClicked If we thought about it for a moment, this event must be triggered from client to showCursor(), when triggering a server event from client, its required to put an element. bool triggerServerEvent ( string event, element theElement, [arguments...] ) while onElementClicked's source is the element that got clicked by the player, so we can't just override that. Correct me if i was wrong?