
SycroX
Members-
Posts
2,141 -
Joined
-
Last visited
-
Days Won
15
Everything posted by SycroX
-
getCameraMatrix getElementPosition
-
function guiGridListRemoveRowByText(gridlist, text) if gridlist and type(gridlist) == "gui-gridlist" then if text and type(text) == "string" then if guiGridListGetRowCount(gridlist) > 0 and guiGridListGetColumnCount(gridlist) > 0 then for ir = 0, guiGridListGetRowCount(gridlist)-1 do for ic = 1, guiGridListGetColumnCount(gridlist) do if guiGridListGetItemText(gridlist, ir, ic) == text then return guiGridListRemoveRow(gridlist, ir) end end end end end end return false end تصحيح للفانكشن
-
شكرا علي التنبيه fixed - improved function guiGridListRemoveRowByText(gridlist, text) if gridlist and type(gridlist) == "gui-gridlist" then if text and type(text) == "string" then if guiGridListGetRowCount(gridlist) > 0 and guiGridListGetColumnCount(gridlist) > 0 then for ir = 0, guiGridListGetRowCount(gridlist)-1 do for ic = 1, guiGridListGetColumnCount(gridlist) do if guiGridListGetItemText(gridlist, ir, ic) == text then return guiGridListRemoveRow(gridlist, ir) end end end end end end return false end
-
function guiGridListRemoveRowByText(gridlist, column, text) if gridlist and type(gridlist) == "gui-gridlist" then if text and column then if guiGridListGetRowCount(gridlist) > 0 then local rowIndex = nil local gridlistRowsCount = guiGridListGetRowCount(gridlist) - 1 for i = 0, gridlistRowsCount do if guiGridListGetItemText(gridlist, i, column) == text then rowIndex = i end end if rowIndex and rowIndex ~= nil then guiGridListRemoveRow(gridlist, rowIndex) end end end end return false end الكود يشيل رو من الجريد ليست عن طريق التكست بتاعت الرو
-
ما في لازمه لقواعد البيانات يبي يشيل مو يحط function guiGridListRemoveRowByText(gridlist, column, text) if gridlist and type(gridlist) == "gui-gridlist" then if text and column then if guiGridListGetRowCount(gridlist) > 0 then local rowIndex = nil local gridlistRowsCount = guiGridListGetRowCount(gridlist) - 1 for i = 0, gridlistRowsCount do if guiGridListGetItemText(gridlist, i, column) == text then rowIndex = i end end if rowIndex and rowIndex ~= nil then guiGridListRemoveRow(gridlist, rowIndex) end end end end return false end
-
addEventHandler("onPlayerDamage",root, function(attacker, weapon, bodypart) if attacker and attacker ~= source and getElementType(attacker) == "player" then if weapon == 0 then killPed(source, attacker, weapon, bodypart) end end end )
-
local usedWaprs = {} -- جدول فاضي عشان نحط فيه اللاعبين الي دخلو عشان ما يدخلو تاني local playersCount = 0 -- نبداء بعدد اللاعبين الي هو 0 لان المود لسا فاتح local x, y, z = 0, 0, 0 -- [ بدل الـ 0, 0, 0 بالاحداثيات حقك ] -- local command = "warp" -- غيرها للكلمه الي تباها addCommandHandler(command, -- نضيف الأمر function(player) -- وظيفه الأمر if not usedWaprs[player] then -- نتحقق ان اللاعب مو موجود بالجدول ( يعني ما دخل قبل )ي if playersCount < 10 then -- نتحقق ان عدد اللاعبين اقل من 10 if setElementPosition(player, x, y, z) then -- نتحقق ان وظيفه النقل تنفذت لان ممكن ما تتنفذ اذا اللاعب خرج و هو يكتب او حصل شي تاني playersCount = playersCount + 1 -- نزيد عدد اللاعبين الي دخلو usedWaprs[player] = true -- نضيف اللاعب للجدول لانه دخل else -- لو ما تحققت وظيفه النقل outputChatBox("ERROR - "..getPlayerName(player).." couldn't get warped", root, 255, 0, 0, true) -- يكتب له كذا end -- اغلاق تحقق وظيفه النقل else -- لو ما كان عدد اللاعبين اقل من 10 outputChatBox("ERROR - there's already 10 players used the command before you !", player, 255, 0, 0, true) -- يطلع للاعب كدا end -- اغلاق تحقق عدد اللاعبين else -- لو اللاعب دخل من قبل outputChatBox("ERROR - you can't use this command twice !!", player, 255, 0, 0, true) -- يطلع له كدا end -- اغلاق تحقق الدخول من قبل end -- اغلاق الفانكشن ) -- قوس لاغلاق الأمر ------------- ذا نفس الطريقه بس شلت المتغير و حطيت بدالو يجيب حجم الجدول local usedWaprs = {} local x, y, z = 0, 0, 0 -- [ بدل الـ 0, 0, 0 بالاحداثيات حقك ] local command = "warp" -- غيرها للكلمه الي تباها addCommandHandler(command, function(player) if not usedWaprs[player] then if #usedWaprs < 10 then if setElementPosition(player, x, y, z) then usedWaprs[player] = true else outputChatBox("ERROR - "..getPlayerName(player).." couldn't get warped", root, 255, 0, 0, true) end else outputChatBox("ERROR - there's already 10 players used the command before you !", player, 255, 0, 0, true) end else outputChatBox("ERROR - you can't use this command twice !!", player, 255, 0, 0, true) end end )
-
addEventHandler("onMarkerHit", root, function(element) if element and getElementType(element) == "player" and source == yourMarker then executeCommandHandler("الأمر الي تباه ينفزه", element) end end ) --#ClientSide -- اذا تباه في addEventHandler("onClientMarkerHit", root, function(element) if element and getElementType(element) == "player" and source == yourMarker and element == localPlayer then executeCommandHandler("الأمر الي تباه ينفزه", element) end end ) --اذا تباه بطريقه دستروير local command = "مخالفات" local 2034.89233, 1548.40295, 10.82031 = 0,0,0 -- غير الاحداثيات لأحداثيات الماركر حقك x,y,z local marker = createMarker(x,y,z, "cylinder", 1.2, 255, 255, 255, 255) addCommandHandler(command, function(player) if isElementWithinMarker(player, marker) then -- حط اكوادك هنا end end ) @#DesTroeyR تحققك كان خطاء كان ناقص ارجمنت بتاع الألمنت كان كذا if isElementWithinMarker(marker) then المفروض يصير كدا if isElementWithinMarker(player, marker) then
-
:- مو مهم خلاص ما بدي اخرج عن الموضوع كتير + من فاضي يرجع لاشياء قبل2 سنه ولا اكتر ؟
-
التقليد ما به شي لاكن سرقه الاكواد و تحطها باسمك ذا الي فيه شي مثل ما اشوف في الموضوع الاكواد الي طارحها محمود انك تقول ان الاكواد حقك و المود حقك صح ذا كود من الاكواد الي طارحها محمود xMainFunctions_ = function ( ) local row, col = guiGridListGetSelectedItem ( GiveAdmin ) local Group = tostring ( guiGridListGetItemText(GiveAdmin,row,2 )); local Price = tostring ( guiGridListGetItemText(GiveAdmin,row,3 )); local Name = tostring ( guiGridListGetItemText(GiveAdmin,row,1 )); if ( row and col and row ~= -1 and col ~= -1 ) then triggerServerEvent("Accept:the:request",localPlayer,Group,Price,Name); else outputChatBox("* الرجاء اختيار رتبةة !",255,0,0,true); end end addEventHandler("onClientGUIClick",GUIEditor.button[1],xMainFunctions_,false) و ذا كود من اكواد المود الأصلي لبسرتيج : xMainFunctions_ = function ( ) local row, col = guiGridListGetSelectedItem ( GiveAdmin.gridlist[1] ) local Group = tostring ( guiGridListGetItemText(GiveAdmin.gridlist[1],row,3 )); local Price = tostring ( guiGridListGetItemText(GiveAdmin.gridlist[1],row,4 )); local Name = tostring ( guiGridListGetItemText(GiveAdmin.gridlist[1],row,2 )); if ( row and col and row ~= -1 and col ~= -1 ) then triggerServerEvent("Accept:the:request",localPlayer,Group,Price,Name); else outputChatBox("* الرجاء اختيار رتبةة !",255,0,0,true); end end addEventHandler("onClientGUIClick",GiveAdmin.button[1],xMainFunctions_,false); بوش تفسر دي؟ تفسيرها = انك سارق اكواد من كودو يعني ما في تفسير غيره + لصاحب الموضوع الجدول حطه في ملف لوحده + شيل من الجدول local و لا تشفر الملف ده خلصت هيك بالسهوله دي ما بها لف او دوران
-
ما حدد هوا او قال انو يبي هيك + لاكن لو يبي تفضل local usedWaprs = {} local playersCount = 0 local x, y, z = 0, 0, 0 -- [ بدل الـ 0, 0, 0 بالاحداثيات حقك ] local command = "warp" -- غيرها للكلمه الي تباها addCommandHandler(command, function(player) if not usedWaprs[player] then if playersCount < 10 then if setElementPosition(player, x, y, z) then playersCount = playersCount + 1 usedWaprs[player] = true else outputChatBox("ERROR - "..getPlayerName(player).." couldn't get warped", root, 255, 0, 0, true) end else outputChatBox("ERROR - there's already 10 players used the command before you !", player, 255, 0, 0, true) end else outputChatBox("ERROR - you can't use this command twice !!", player, 255, 0, 0, true) end end )
-
كودك بينقلهم برضو حتي لو بعد الـ10 لاعبين local playersCount = 0 local x, y, z = 0, 0, 0 -- [ بدل الـ 0, 0, 0 بالاحداثيات حقك ] local command = "warp" -- غيرها للكلمه الي تباها addCommandHandler(command, function(player) if playersCount < 10 then if setElementPosition(player, x, y, z) then playersCount = playersCount + 1 else outputChatBox("ERROR - "..getPlayerName(player).." couldn't get warped", root, 255, 0, 0, true) end else outputChatBox("ERROR - there's already 10 players used the command before you !", player, 255, 0, 0, true) end end )
-
عندي استفسار ليه ما تستخدم الجدول بدل الداتا ؟ As element data is synced to all clients, it can generate a lot of network traffic and consume server CPU. Events are much more efficient for sending data from a client to the server only, or from the server to a specific client.
-
السلام عليكم و رحمه الله و بركاته مطلوب اداري لسيرفر حرب العصابات يكون يمتلك المواصفات التاليه : 1 - يكون عمره فوق الـ17 سنه 2 - له خبره بسيرفرات حرب العصابات 3 - يكون فاضي و تواجدو يكون عالي 4 - تكون مهاراته الأداريه كويسه -------------------------------------------- الي شايف نفسه معه الامكانيات دي يكلمني خاص و السلام عليكم و رحمه الله و بركاته
-
لول ولله كنت مفكرو واحد مقلدك هههه منور السيرفر يراجل + عشان لا اخرج من الموضوع ان شاء الله تنجح شركتكم و تصير عالميه عندي استفسار هو شركتكم تدعم خوادم تيم سبيك ؟
-
@#StrOnG_,) عندي سوال معلش هو انت [ARMY]#StrOnG_)[COL] الي بسيرفر الاتحاد العربي ؟
-
من رأي يسوي مود متحكم للمهمات MissionManager انا مسويه - نظام جداول تحط المهمات بالترتيب الي تباه بالجدول و و روح للمهمات و سوي بها وظيفه اسمها startMission بعدين بقا لما يجي المود يفتح ( المتحكم ) يسوي اتصال بالمهمه الأولي بالجدول بعدين سوي لما المهمه تخلص يسوي اتصال بالمتحكم يخله يبداء المهمه الي بعدها - ذي افضل طريقه من الطرق الي جربتها مثال بسيط : --#Ex local currentMission = 1 local MyMissions = { --#Mission name, resource name [1] = {"CVR", "CVRMission"}, [2] = {"TEST", "TESTMission"} } addEventHandler("onResourceStart", resourceRoot, function() local res = getResourceFromName(MyMissions[currentMission][2]) if res and getResourceState(res) == "running" then exports[MyMissions[currentMission][2]]:startMission() else nextMission() end end ) function nextMission() currentMission = currentMission + 1 if currentMission > #MyMissions then currentMission = 1 end local res = getResourceFromName(MyMissions[currentMission][2]) if res and getResourceState(res) == "running" then exports[MyMissions[currentMission][2]]:startMission() else nextMission() end end
-
for _,functions in ipairs(getEventHandlers("onPlayerChat", root)) do for i,value in ipairs(functions) do removeEventHandler("onPlayerChat", root, value) end end local Tags = { --Group, tag, rankColor {"Console", "#FF0000[Console]", "#00ff00"}, {"Admin", "#FF0000[Admin]", "#ffff00"} } addEventHandler("onPlayerChat", root, function(message) local playerTag = nil local tagColor = nil local account = getPlayerAccount(source) if account and not isGuestAccount(account) then for _,value in ipairs(Tags) do if aclGetGroup(value[1]) then if isObjectInACLGroup("user."..getAccountName(account), aclGetGroup(value[1])) then playerTag, tagColor = value[2], value[3] break end end end end if playerTag then outputChatBox(playerTag.." "..getPlayerName(source).." : "..tagColor..""..string.gsub(message, "#%x%x%x%x%x%x", ""), root, 255, 0, 0, true) else outputChatBox(getPlayerName(source).." : #ffffff"..string.gsub(message, "#%x%x%x%x%x%x", ""), root, 255, 0, 0, true) end end ) لقيت نفسي فاضي شوي
-
مشكور + انا سويتها لريان الي كان طالب مساعده و قلت اطرحها هنا ممكن احد اخر يستفيد لاكن طلعت موجوده من قبل
-
معرف صراحه اذا بتفيد احد او لا لاكن بطرحها و خلاص ممكن يكون فيها افاده لاحد الوظيفه = aclGroupGetPlayers وظيفتها : تجيب اللاعبين الأونلاين في الجروب الي تحدده من الأسل args. : groupName = الجروب الي تبي تجيب اللاعبين الي فيه source code : function aclGroupGetPlayers(groupName) local players = {} if groupName and aclGetGroup(groupName) then local group = aclGetGroup(groupName) local objects = aclGroupListObjects(group) or {} for _,object in ipairs(objects) do local isAccount = gettok(object, 1, string.byte(".")) if isAccount and isAccount == "user" then local account = gettok(object, 2, string.byte(".")) if account and getAccount(account) then local player = getAccountPlayer(getAccount(account)) if player and isElement(player) then table.insert(players, player) end end end end end return players end
-
function aclGroupGetPlayers(groupName) local players = {} if groupName and aclGetGroup(groupName) then local group = aclGetGroup(groupName) local objects = aclGroupListObjects(group) or {} for _,object in ipairs(objects) do local isAccount = gettok(object, 1, string.byte(".")) if isAccount and isAccount == "user" then local account = gettok(object, 2, string.byte(".")) if account and getAccount(account) then local player = getAccountPlayer(getAccount(account)) if player and isElement(player) then table.insert(players, player) end end end end end return players end --By ME :D
-
local _dxDrawRectangle = dxDrawRectangle local _dxDrawText = dxDrawText local _dxDrawLine = dxDrawLine local _dxDrawImage = dxDrawImage local sWidth, sHeight = guiGetScreenSize() local resolutionX, resolutionY = 1280, 800 function dxDrawText(text,posX,posY,right,bottom,color,scale,mixed_font,alignX,alignY,clip,wordBreak,postGUI,kk,gg) return _dxDrawText(tostring( text ), ( posX/resolutionX )*sWidth, ( posY/resolutionY )*sHeight, ( right/resolutionX )*sWidth, ( bottom/resolutionY)*sHeight, color, ( scale/resolutionX )*sWidth, mixed_font, alignX, alignY, clip, wordBreak, postGUI, kk, gg) end function dxDrawRectangle(posX, posY, width, height,color,postGUI) return _dxDrawRectangle(( posX/resolutionX )*sWidth, ( posY/resolutionY )*sHeight, ( width/resolutionX )*sWidth, ( height/resolutionY )*sHeight, color, postGUI) end function dxDrawImage(posX, posY, width, height, filename, rotation, r2, r3, color,postGUI,) return _dxDrawImage(( posX/resolutionX )*sWidth,( posY/resolutionY )*sHeight,( width/resolutionX )*sWidth,( height/resolutionY )*sHeight, filename, rotation, r2, r3, color, postGUI) end function dxDrawLine(posX, posY, width, height,color, size, postGUI) return _dxDrawLine(( posX/resolutionX )*sWidth, ( posY/resolutionY )*sHeight, ( width/resolutionX )*sWidth, ( height/resolutionY )*sHeight, color, size, postGUI) end بدل local resolutionX, resolutionY = 1280, 800 1280, 800 بمقاس الشاشه حقك
-
اعتقد ان جيم مود التكتيك يكون به شات خاص به لهيك استعمل getEventHandlers removeEventHandler