SycroX
-
Posts
2,141 -
Joined
-
Last visited
-
Days Won
15
Posts posted by SycroX
-
-
1 hour ago, slapz0r said:
No, you did not understand. Everything is in order here, I just need another player to be able to see this text
Now it works only for the user who sends the message
send the message to server side by using triggerServerEvent
and then send it back to the client side
--client if ( source == Button[44] ) then local message = guiGetText ( editAdmin ) if message == "" then playSoundFrontEnd(2) return end triggerServerEvent ( "SendMessage" , localPlayer , message ) end addEvent ( "ReciveMessage" , true ) addEventHandler ( "ReciveMessage" , root , function ( message ) local name = getPlayerName ( localPlayer ) local servertime = getRealTime ( ) local hours , minutes , second = servertime.hour , string.format ( "%02d" , servertime.minute ) , string.format ( "%02d" , servertime.second ) guiSetText ( memo_admin , guiGetText ( memo_admin ) .. "[" .. hours .. ":" .. minutes .. ":" .. second .. "] " .. getPlayerName ( localPlayer ) .. ": " .. message .. "\n" ) guiSetText ( editAdmin , "" ) end end ) -- # Server side addEvent ( "SendMessage" , true ) addEventHandler ( "SendMessage" , root , function ( Message ) for _ , Player in pairs ( getElementsByType ( "player" ) ) do triggerClientEvent ( Player , "ReciveMessage" , Player , Message ) end end )
- 1
-
add \n to line 13
guiSetText(memo_admin, guiGetText(memo_admin).."["..hours..":"..minutes..":"..second.."] "..getPlayerName ( localPlayer )..": "..message.."\n" )
-
2 hours ago, #\_oskar_/# said:
السلام عليكم
اول مره اطرح وظيفه ☺
الوظيفه هي اغلاق اللوحه مثل اللي بالجيو اديتور
function CreateButtonClose( GuiElement , text,d) if getElementType(GuiElement) == 'gui-window' then local Text = '|'..text..' |' local Font = 'default-bold-small' local width = dxGetTextWidth(Text, 1, Font) local x = d == 'left' and guiGetSize(GuiElement, false)-50 or d == 'right' and 5 local ln = guiCreateLabel(x,2,width+5,15,Text, false,GuiElement) guiSetProperty(ln ,'ClippedByParent', 'False') guiSetProperty(ln ,'AlwaysOnTop', 'True') guiSetFont(ln , Font) guiLabelSetColor(ln ,150,150,150) guiLabelSetHorizontalAlign(ln , 'center', false) --- Events addEventHandler('onClientGUIClick',ln, function() guiSetVisible(GuiElement, false ) end,false) addEventHandler('onClientMouseEnter',ln, function() guiLabelSetColor(source ,255, 69, 59) end,false) addEventHandler('onClientMouseLeave',ln, function() guiLabelSetColor(source ,150,150,150) end,false) else print('This function is a static function the Window') end end --- Test Code window1 = guiCreateWindow(0.01, 0.04, 0.70, 0.70, "Window1", true) window2 = guiCreateWindow(0.43, 0.04, 0.38, 0.29, "Window2", true) for k,element in ipairs(getElementsByType('gui-window',getResourceGUIElement(getThisResource()))) do CreateButtonClose ( element,'Close','right' ) --CreateButtonClose ( element,'Close','left' ) end
معلش مابعرف اشرح بس تقدرو تجربو الوظيفه واتمني ان تنال اعجابكم
وظيفه مفيده و كويسه بالتوفيق اوسكر مبدع كالعاده
عندي اقتراح صغير ليك
انك تضيف ايفنت مع الوظيفه عشان لو في حالات خاصه مع قفل اللوحه
- 1
-
الحد في اسم السيرفر 74 حرف
و الحرف العربي يتحسب بـ2 حرف
و المسافه = 1 حرف
- 2
-
29 minutes ago, HustraDev said:
cashu paypal او اي عملة معدنية مو مشكلة
في تحويل بنكي ؟ اذا هيك اقدر ابرمج لك الي تباه
-
39 minutes ago, HustraDev said:
السلام عليكم ورحمة الله وباركته
مبرمج Lua محترف خبرة 3 سنوات مستعد لبرمجة اي جيم مود او سكربتات بمقابل مادي
الديسكورد حقي
||M.O.M||'Dev#4281وش طرق الدفع ؟
-
shader / txd
-
استخدم حدث
onClientKey
or
bindKey
-
local SpamTime = 5000 local SpamTimer = { } local Commands = { [ "kill" ] = true, } addEventHandler ( "onPlayerCommand" , root , function ( Command ) if Commands [ Command ] then if not SpamTimer [ source ] then SpamTimer [ source ] = { } end if SpamTimer [ source ] [ Command ] and isTimer ( SpamTimer [ source ] [ Command ] ) then outputChatBox ( " Please stop spaming " , source , 255 , 0 , 0 , true ) cancelEvent ( ) return end SpamTimer [ source ] [ Command ] = setTimer ( function ( source ) SpamTimer [ source ] [ Command ] = false end , SpamTime , 1 , source ) end end )
not tested
-
:: Achievemnts | By Master :: ???
المود حقي و مسروق من مودات Gta-Ws و Gta-GCG
و الدليل في يالباك اب المسروق
الرجاء ازاله المود او وضع حقوقي عليه
-
1 hour ago, ' A F . said:
شوك قوزال كارديش , ماهو غريب عليك هالابداع , أبدعت
sagol kardisim : ) guzel olan sey sen
- 1
-
4 hours ago, #A[L]I said:
بالتوفيق + ترا احنا 2019 وداخلين 2020 ماراح تلاقي احد يشتري مود اغلى من 5 دولار
الـ5 دولار ما تجيب لك الجريدلست حق المود حتي
-
1 hour ago, DABL said:
جميل ي عومري.
صممته بالدي إكس؟
يب دي اكس + واخد بالي من مسببات اللاق
طريقه برمجه المود ما تسبب اي لاق او اي شي
-
On 25/05/2019 at 19:48, salh said:
قاضي ولا محامي؟
محامي و لا مهاجم
-
#CANCELED
- 1
- 1
-
1 hour ago, DmAr511 said:
كود في خطا
متغير زياده عدد مرات تغير الأسم بيزيد كل مره اي لاعب يغير اسمه
-
6 hours ago, #x1AhMeD-09 said:
ما تقدر بسبب طريقه برمجه المود , لازم تعيد البرمجه
او تضيف فانكشنات خاصه للاكسبورت
مثال
function dxCreateGridList ( ... ) gridlist = dxGrid:Create ( ... ) return gridlist end
- 1
-
ما تقدر بسبب طريقه برمجه المود , لازم تعيد البرمجه
- 1
-
19 minutes ago, NX_CI said:
طبيعي جداً يا غالي , انت حاط 2 قريد ليست في كود مبرمج على دي اكس واحده
يعني طبيعة الكود كذا هو مصمم على هذا الشيء , كله متغيرات والمتغير ياخذ آخر قيمه
في ذا الكود هي القريد لست الأخيره اللي انت مسويها dxGrid وآخر قيمه لمتغيرات
جرب تغير اسم القريد لست
Lua سوي سكربت جديد , بعدين حط الكود ذا بملف
بعدين جرب تسوي
GridList1 = { items = {} };function GridList1:Create(......
...يعني عدل ع الفنكشنز اللي تسوي القريد لست واللي تجيب الاختيار من القريد لست واللي تحط عمود ووو الخ
عدل إسم الفنكشنز مثل فوق
في كل الملف بإسم المتغير اللي تبغاه للقريد لست الثانيه dxGrid أو انسخ الكود حق الدي اكس و انقله بملف ثاني و عن طريق النوت باد استبدل كلمة
بالتوفيق
Or
لاحظت بالكود ان متغير اختيار الجدول محطوط في اللوب يعني دايما يكنسل الاختيار و يخليه لواحد فقط
فممكن مع شويه تحققات و استعمل للجداول نظبط وضعنا
dxGrid = { items = {} }; CursorOn = { } local NATIVE_RESOLUTION = { nil } -- put your screen resolution here to fit the gridlists to all resolutions (ex: { 1366, 768 } ) if ( table.maxn ( NATIVE_RESOLUTION ) == 2 ) then FIT_MODE = true RES = { guiGetScreenSize() }; X,Y = RES[1] / NATIVE_RESOLUTION[1], RES[2] / NATIVE_RESOLUTION[2]; SCALE = ( 1 / NATIVE_RESOLUTION[1] ) * RES[1]; end --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Core - functions function dxGrid:Create ( x, y, width, height, postGUI ) -- table dxGrid:Create ( int x, int y, int width, int height[, bool postGUI ] ) if __checkParams ( "Create", "nnnn", x, y, width, height ) then local data = { x = FIT_MODE and ( x * X ) or x; -- X position y = FIT_MODE and ( y * Y ) or y; -- Y position w = FIT_MODE and ( width * X ) or width; -- Width h = FIT_MODE and ( height * Y ) or height; -- Height pg = postGUI or false; -- PostGUI i = {}; -- Items mi = __calcMaxItems ( FIT_MODE and ( height * Y ) or height ); -- Max items s = 1; -- Scroll Level r = -1; -- Row count se = -1; -- Selected item mo = nil; -- Mouse-on item vis = true -- Visible }; setmetatable ( data, { __index = dxGrid } ); table.insert ( dxGrid.items, data ); return data; end end function dxGrid:Destroy () -- bool dxGrid:Destroy () for k, v in pairs ( dxGrid.items ) do if v == self then dxGrid.items[k] = nil; return true; end end return false; end function dxGrid:SetVisible ( visible ) -- bool Gridlist:SetVisible ( bool state ) if __checkParams ( "SetVisible", "b", visible ) then self.vis = visible return true else return false end end function dxGrid:IsVisible ( ) -- bool Gridlist:IsVisible() return self.vis end function dxGrid:AddColumn ( title, width ) -- int Gridlist:AddColumn ( string title, int width ) if __checkParams ( "AddColumn", "sn", title, width ) then local data = { info = { title = title, width = FIT_MODE and ( width * X ) or width } }; table.insert ( self.i, data ); return #self.i; end end function dxGrid:RemoveColumn ( columnIndex ) -- bool Gridlist:RemoveColumn ( int columnIndex ) if __checkParams ( "RemoveColumn", "n", columnIndex ) then self.i[columnIndex] = nil; -- Recalculate the highest item count local highest = -1; for _, v in ipairs ( self.i ) do if #v > highest then highest = ( #v - 1 ); end end self.r = highest; -- Recalculate the scroll level (if necessary) if ( ( ( self.s + self.mi ) - 2 ) == self.r ) then self.s = ( self.r - self.mi ) + 1; end return true end return false end function dxGrid:GetColumnCount () -- int Gridlist:GetColumnCount() return #self.i end function dxGrid:AddItem ( columnIndex, text, data, r, g, b ) -- int Gridlist:AddItem ( int columnIndex, string title[, mixed data, int r, int g, int b ] ) if __checkParams ( "AddItem", "ns", columnIndex, text ) then if self.i[columnIndex] then local tColor = __checkRGB ( r, g, b ) and { r, g, b } or { 255, 255, 255 }; table.insert ( self.i[columnIndex], { id = #self.i[columnIndex] + 1, text = tostring( text ), data = data, color = tColor } ); if #self.i[columnIndex] > self.r then self.r = #self.i[columnIndex]; end return #self.i[columnIndex]; end return false; end end function dxGrid:RemoveItem ( column, itemID ) -- bool Gridlist:RemoveItem ( int columnIndex, int itemIndex ) if __checkParams ( "RemoveItem", "nn", column, itemID ) then if self.i[column] and self.i[column][itemID] then -- Recalculate the highest item count if self.r == #self.i[column] then local highest = -1; for _, v in ipairs ( self.i ) do if #v > highest then highest = ( #v - 1 ); end end self.r = highest; end -- Recalculate the scroll level (if necessary) if ( ( ( self.s + self.mi ) - 2 ) == self.r ) then self.s = ( self.r - self.mi ) + 1; end -- Reset the selected item if necessary² if itemID == self.se then local newItem = self.se - 1 if newItem <= self.r then self.se = math.max ( 0, newItem ); else self.se = -1 end end table.remove ( self.i[column], itemID ); return true; end return false end end function dxGrid:GetItemCount ( columnID ) -- int Gridlist:GetItemCount ( int columnIndex ) if __checkParams ( "GetItemCount", "n", columnID ) then if self.i[columnID] then return #self.i[columnID] end return false end end function dxGrid:Clear () -- bool Gridlist:Clear() for k, v in ipairs ( self.i ) do self.i[k] = { info = v.info } end self.r = -1 self.se = nil -- Recalculate the scroll level self.s = 1; return true end function dxGrid:GetSelectedItem ( ) -- int Gridlist:GetSelectedItem () return self.se; end function dxGrid:SetSelectedItem ( itemID ) -- bool Gridlist:SetSelectedItem ( int itemIndex ) if __checkParams ( "SetSelectedItem", "n", itemID ) then if itemID <= self.r then self.se = itemID; return self.se == itemID; end return false; end end function dxGrid:GetItemDetails ( column, itemID ) -- string, mixed Gridlist:GetItemDetails ( int columnIndex, int itemIndex ) if __checkParams ( "GetItemDetails", "nn", columnID, itemID ) then if self.i[column] then if self.i[column][itemID] then return self.i[column][itemID].text, self.i[column][itemID].data end end return false end end --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Core - render/move addEventHandler ( "onClientRender", root, function ( ) -- Is there any gridlist to render? if #dxGrid.items > 0 then -- Loop through all grid lists for index, data in ipairs ( dxGrid.items ) do -- Is the gridlist visible? if data.vis then -- Draw the 'gridlist' itself dxDrawRectangle ( data.x, data.y, data.w, data.h, tocolor ( 0, 0, 0, 200 ), data.pg ); -- Draw the column bar dxDrawRectangle ( data.x, data.y, data.w, 30 % data.h, tocolor ( 0, 0, 0, 220 ), data.pg ); -- Set cursorOn variable to the current gridlist, if it's selected if __isMouseInPosition ( data.x, data.y, data.w, data.h ) then CursorOn = { true , index } else if CursorOn[1] and CursorOn[2] == gridlist then CursorOn = {} end end -- Check if there's any selected item local seeFrom = data.s; local seeTo = ( data.s + data.mi ) - 1; if data.se and data.se <= data.r and data.se >= seeFrom and data.se <= seeTo then local index = data.se - ( data.s - 1 ); local y2 = data.y + ( ( index - 1 ) * 25 ); -- Draw a rectangle to make it looks like selected dxDrawRectangle ( data.x, ( 30 % data.h ) + y2, data.w, 20, tocolor ( 100, 100, 100, 100 ), data.pg ); end -- Is there any column? if #data.i > 0 then local cWidth = 0 -- Loop through all columns for cIndex, cData in ipairs ( data.i ) do -- we'll go beyond the gridlist width with this column ? if ( ( cWidth + cData.info.width ) <= data.w ) then local x = data.x + cWidth; -- Draw the column title dxDrawText ( cData.info.title, x, data.y, cData.info.width + x, ( 30 % data.h ) + data.y, tocolor ( 255, 255, 255 ), FIT_MODE and ( 1 * SCALE ) or 1, "default-bold", "center", "center", true, true, data.pg, false, true ); -- Reset the selected item cData.info.selected = -1; -- Is there any item ? if #cData > 0 then local seeFrom = data.s; local seeTo = ( data.s + data.mi ) - 1; -- Loop the items for iIndex = seeFrom, seeTo do -- There's a row with this index in the current column? if cData[iIndex] then local index = iIndex - ( data.s - 1 ); local y = data.y + ( index * 25 ); local y2 = data.y + ( ( index - 1 ) * 25 ); -- Check if cursor is on item position if __isMouseInPosition ( data.x, ( 30 % data.h ) + y2, data.w, 20 ) then -- Define the mouse-on variable data.mo = iIndex; end -- Draw the item text dxDrawText ( cData[iIndex]["text"], x, y, cData.info.width + x, ( 30 % data.h ) + y, tocolor ( unpack ( cData[iIndex]["color"] ) ), FIT_MODE and ( 1 * SCALE ) or 1, "default-bold", "center", "center", true, true, data.pg, false, true ); end end end -- Increase cWidth variable (to draw the columns correctly) cWidth = cWidth + cData.info.width; end end end end end end end , true, "low-5") -- addEventHandler ( "onClientKey", root, function ( button, press ) -- Is cursor showing? if isCursorShowing () then -- Is there any gridlist? if #dxGrid.items > 0 then -- Is there any selected gridlist? if CursorOn and CursorOn [ 1 ] then -- We pressed the scroll? local cursorOn = CursorOn [ 2 ] if press and #button > 6 then -- Does the gridlist requires scroll? if dxGrid.items[cursorOn].r > dxGrid.items[cursorOn].mi then -- Define some variables local index = cursorOn; local currentValue = dxGrid.items[index].s; local newValue = math.max ( 1, button == "mouse_wheel_down" and currentValue + 2 or currentValue -1 ); -- Check if we have spent the row's limit with the new value if ( ( newValue + dxGrid.items[index].mi ) > dxGrid.items[index].r ) then newValue = ( dxGrid.items[index].r - dxGrid.items[index].mi ) + 1; end -- Set the new scroll level dxGrid.items[index].s = newValue; end elseif press and button == "mouse1" and dxGrid.items[cursorOn].mo then dxGrid.items[cursorOn].se = dxGrid.items[cursorOn].mo; end end end end end ) --=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Useful function __calcMaxItems ( height ) for i = 0, 9999 do if ( ( ( i + 1 ) * 25 ) >= math.floor ( height ) ) then return ( ( ( i + 1 ) * 25 ) > math.floor ( height ) and ( i - 1 ) or i ); end end return false; end function __checkParams ( methodName, pattern, ... ) local cTable = { ["string"] = "s"; ["number"] = "n"; ["boolean"] = "b"; ["s"] = "string"; ["n"] = "number"; ["b"] = "boolean" }; if #pattern > table.maxn ( { ... } ) then local index = table.maxn ( { ... } ) == 0 and 1 or table.maxn ( { ... } ) + 1 return false, error ( "Bad Argument @ '"..methodName.."' [Expected "..cTable[ pattern:sub ( index, index ) ].." at argument "..index..", got none]" ) end for k, v in pairs ( { ... } ) do if cTable[ type ( v ) ] ~= pattern:sub ( k, k ) then return false, error ( "Bad Argument @ '"..methodName.."' [Expected "..cTable[ pattern:sub ( k, k ) ].." at argument "..k..", got "..( type ( v ) or "none" ).."]" ) end end return true; end function __checkRGB ( r, g, b ) -- Check if all parameters were passed if ( not r ) or ( not g ) or ( not b ) then return false; end for _, v in ipairs ( { r, g, b } ) do if ( type ( v ) ~= "number" ) or ( v < 0 ) or ( v > 255 ) then return false; end end return true; end function __isMouseInPosition ( x, y, w, h ) if not isCursorShowing() then return false end local res = { guiGetScreenSize() }; local cpos = { getCursorPosition() }; local fpos = { res[1] * cpos[1], res[2] * cpos[2] }; return ( fpos[1] >= x and fpos[1] <= x + w ) and ( fpos[2] >= y and fpos[2] <= y + h ) end
جرب و قلي
- 1
-
OR
local AllowedRanks = { "Console" , "??" } addCommandHandler ( "ACL" , function ( Player , _ , Type , AccountName , GroupName ) if Type and AccountName and GroupName then local Account = getPlayerAccount ( Player) if Account and not isGuestAccount ( Account ) then for _ , Rank in pairs ( AllowedRanks ) do local AG = aclGetGroup ( Rank ) if AG then if isObjectInACLGroup ( "user." .. getAccountName ( Account ) , AG ) then if not getAccount ( AccountName ) then outputChatBox ( "ACL / ERROR : Account isn't exists" , Player , 255 , 0 , 0 ) return end local Group = aclGetGroup ( GroupName ) if not Group then outputChatBox ( "ACL / ERROR : There's no acl group with this name" , Player , 255 , 0 , 0 ) return end local Type = Type:lower ( ) local Types = { ["add"] = true , ["remove"] = true } if not Types [ Type ] then outputChatBox ( "ACL / ERROR : Action must be ( add or remove )" , Player , 255 , 0 , 0 ) return end local Function = Type == "add" and aclGroupAddObject or aclGroupRemoveObject if Function ( Group , "user." .. AccountName ) then outputChatBox ( "ACL / Succsess : " .. AccountName .. " Added to " .. GroupName .. " Succsessfully" , Player , 0 , 255 , 0 ) else outputChatBox ( "ACL / ERROR : Unknown error" , Player , 255 , 0 , 0 ) end break end end end end end end )
تقدر تحط الكود ذا في لوحه الادمن
و تكتب باف 8
ACL add Account_Name Group_Name -- لاعطاء الرتب
ACL remove Account_Name Group_Name -- لسحب الرتب
-
في تايمر يلغي الوظاف الي فوق , استعمل
addDebugHook
عشان تشوف في اي مود
-
-
3 minutes ago, HassoN said:
حسب الي شايفه ، اعتقد الكود مافيه مشكلة ، اذا جيت تسجل يكتب لك تم التسجيل بنجاح؟ ولا مايكتب شي؟
اذا يكتب ، المشكلة اكيد من البرمشنز ، تاكد انه بقروب ادمن وتاكد ان قروب ادمن ذا معه صلاحية يسوي حساب (ممكن انت شايل الخاصية ذي من قروب ادمن)ء
واذا مايكتب لك تم التسجيل بنجاح يعني فيه مشكلة بالكود ولازم يكتب لك شي بالدي بقSupporter of the week
لصاحب الموضوع لو معدل في الأسل او مغير فيه رتب او شلت رتب
ضيف الفانكشنات ذول لاي جروب في الاسل
و ضيف الجيم مود للجروب ذا
function.addAccount
function.removeAccount
-
3 minutes ago, Me[Z]oO said:
مبدع كعادتك
اوو اذيك يسطا ايه الاخبار , فينك ياعم
- 1
Chat in memo
in Scripting
Posted