-
Posts
2,013 -
Joined
-
Last visited
Everything posted by iMr.SFA7
-
"onPlayerJoin" getPlayerName
-
أنت حآول ونسآعدكـ بإذن الله ذذ
-
image أول شيء أنت ما حطيت متغير للصورة عشآن تحط وبدل هاذي ture > true
-
دآم الساعات حقت اللاعبين موجودة في التاب صحيح؟ يعني موجودة في الداتا!؟ أستخدم هـ الوظائف وسوي قريد ليست وكولمن ورو وجيب الداتا حقت الساعات من كل اللاعبين وسوي ترتيب لها بالأكبر للأصغر وحطها بالقريد ليست ذذذ guiCreateGridList getElementsByType getElementData table.sort guiGridListClear guiGridListAddRow guiGridListSetItemText
-
ما تلاحظون التواريخ
-
"onClientMarkerHit" -- حدث عند لمس الماركر getElementType -- نتحقق أن الي لمس الماركر لاعب guiSetVisible -- نظهر اللوحة له showCursor -- نظهر الماوس هذا بالنسبة لأظهار اللوحة يوم يلمس الماركر ^ guiCreateGridList -- أنشاء قريد ليست guiGridListAddColumn -- أضافة كولمن guiGridListAddRow -- أضافة رو table -- سوي جدول لكل أيديات السيارات الي تبيها getVehicleNameFromModel -- نجيب أسماء السيارات من الأيدي الي بالجدول guiGridListSetItemText -- نحط أسماء السيارات هذا بالنسبة لأنشاء القريد ليست وأضافة الأسماء للقريد ليست ^ "onClientGUIClick" -- حدث عند الضغط على الزر guiGridListGetSelectedItem -- نسوي تحقق أنه أختار شيء triggerServerEvent -- نسوي ترايقر للسيرفر ونرسل معه اسم السيارة ذذ هذا بالنسبة لحدث عند الضغط على الزر والترايقر ^ addEvent -- نستقبل الترايقر addEventHandler -- نستقبل الترايقر getVehicleModelFromName -- نجيب أيدي السيارة من أسمها الي ارسلناه بالترايقر ذذذ getElementPosition -- نجيب أحداثيات اللاعب createVehicle -- نسوي سيارة في أحداثيات الاعب warpPedIntoVehicle -- نركب اللاعب في السيارة
-
clear أو arial ما أعتقد بين هـالخطين فيه تغيير ملحوظ فـ حطه خط ثاني على سبيل المثال
-
killmessages / utils / textlib.lua line 16 . strFont = "default",
-
addEventHandler( "onPlayerJoin", root, function() exports.killmessages:outputMessage("# !#58ACFA*" .. getPlayerName ( source ) .. "#58ACFA Has been joined", root, 0, 255, 0 ) end) addEventHandler( "onPlayerChangeNick", root, function( oldNick, newNick ) exports.killmessages:outputMessage("#00FF00 !#886A08 " .. oldNick .. "'#886A08 Has been changed his nick to ##886A08'" .. newNick .. "",root, 0, 255, 0) end) addEventHandler( "onPlayerQuit", root, function(reason) exports.killmessages:outputMessage("#! #FF6464*" .. getPlayerName( source ) .. "' Has been left the server' [ " .. reason .. " ]", root, 255, 255, 255) end) addEventHandler( "onPlayerLogin", root, function() exports.killmessages:outputMessage("#!#00FF00*#0000FF" .. getPlayerName ( source ) .. "#00FF00 has been succesfuly logined in", root, 0, 255, 0 ) end) addEventHandler("onPlayerLogout", root, function () exports.killmessages:outputMessage("#!#FFC900*" .. getPlayerName ( source ) .. "#FFC900 has been succesfuly Logged out", root, 0, 255, 0 ) exports.killmessages:outputMessage("!#FFC900*" .. getPlayerName ( source ) .. "#FFC900 You have been succesfuly Logged out",source, 0, 255, 0 ) end)
-
هو ما قالكـ لوحة تفتح من اف8 ذذذ بالنسبة لصاحب الموضوع عدل ع الكوماند وسوي تحقق قبل الوظيفة من رتبة اللاعب getPlayerAccount isObjectInACLGroup getAccountName aclGetGroup
-
حيآكـ بالخدمة | Any Time ..
-
؟Window طيب وين اللوحة الي آسمها
-
لا ما راح يصير شيء cache بالنسبة للحدث فـ هو مهم يوم تبي تحذف الملف بأستعمال خاصية اذا ما حطيت الحدث هذا فـ من الممكن أن تصير مشآكل باللوحة اللبل والأحداثيات تخرب ذذذ
-
مجرد مثآل تطبق عليه أنا نا مسويه لكل اللاعبين أنت سويه لتيم معين
-
مثآل لـجميع اللاعبين .. .. addCommandHandler ("setHealth", function (thePlayer,cmd,Health) if ( Health ) then for key,player in ipairs (getElementsByType ("player")) do setElementHealth (player,Health) end end end )
-
تحط الصورة ظاهرة = ))
-
addCommandHandler -- أضافة أمر جديد getPlayersInTeam -- أحضار اللاعبين الي بالتيم getTeamFromName -- أحضاء التيم من أسمه setElementHealth -- أعطاء دم
-
طيب حاول تسويه ذذ guiCreateStaticImage guiSetVisible setTimer (( ==
-
dxText = {} dxText_mt = { __index = dxText } local idAssign,idPrefix = 0,"c" local g_screenX,g_screenY = guiGetScreenSize() local visibleText = {} ------ local defaults = { fX = 0.5, fY = 0.5, bRelativePosition = true, strText = "", bVerticalAlign = "center", bHorizontalAlign = "center", tColor = {255,255,255,255}, fScale = 1, strFont = "default", strType = "normal", tAttributes = {}, bPostGUI = false, bClip = false, bHexColor = true, bWordWrap = true, bVisible = true, tBoundingBox = false, --If a bounding box is not set, it will not be used. bRelativeBoundingBox = true, } local validFonts = { default = true, ["default-bold-small"] = true, clear = true, arial = true, pricedown = true, bankgothic = true, diploma = true, beckett = true, } local validTypes = { normal = true, shadow = true, border = true, stroke = true, --Clone of border } local validAlignTypes = { center = true, left = true, right = true, } function dxText:create( text, x, y, relative ) assert(not self.fX, "attempt to call method 'create' (a nil value)") if ( type(text) ~= "string" ) or ( not tonumber(x) ) or ( not tonumber(y) ) then outputDebugString ( "dxText:create - Bad argument", 0, 112, 112, 112 ) return false end local new = {} setmetatable( new, dxText_mt ) --Add default settings for i,v in pairs(defaults) do new[i] = v end idAssign = idAssign + 1 new.id = idPrefix..idAssign new.strText = text or new.strText new.fX = x or new.fX new.fY = y or new.fY if type(relative) == "boolean" then new.bRelativePosition = relative end visibleText[new] = true return new end function dxText:text(text) if type(text) ~= "string" then return self.strText end self.strText = text return true end function dxText:position(x,y,relative) if not tonumber(x) then return self.fX, self.fY end self.fX = x self.fY = y if type(relative) == "boolean" then self.bRelativePosition = relative else self.bRelativePosition = true end return true end function dxText:color(r,g,b,a) if not tonumber(r) then return unpack(self.tColor) end g = g or self.tColor[2] b = b or self.tColor[3] a = a or self.tColor[4] self.tColor = { r,g,b,a } return true end function dxText:scale(scale) if not tonumber(scale) then return self.fScale end self.fScale = scale return true end function dxText:visible(bool) if type(bool) ~= "boolean" then return self.bVisible end self.bVisible = bool if bool then visibleText[self] = true else visibleText[self] = nil end return true end function dxText:destroy() self.bDestroyed = true setmetatable( self, self ) return true end function dxText:extent() local extent = dxGetTextWidth ( string.gsub(self.strText, "#%x%x%x%x%x%x", ""), self.fScale, self.strFont ) if self.strType == "stroke" or self.strType == "border" then extent = extent + self.tAttributes[1] end return extent end function dxText:height() local height = dxGetFontHeight ( self,fScale, self.strFont ) if self.strType == "stroke" or self.strType == "border" then height = height + self.tAttributes[1] end return height end function dxText:font(font) if not validFonts[font] then return self.strFont end self.strFont = font return true end function dxText:postGUI(bool) if type(bool) ~= "boolean" then return self.bPostGUI end self.bPostGUI = bool return true end function dxText:clip(bool) if type(bool) ~= "boolean" then return self.bClip end self.bClip = bool return true end function dxText:wordWrap(bool) if type(bool) ~= "boolean" then return self.bWordWrap end self.bWordWrap = bool return true end function dxText:type(type,...) if not validTypes[type] then return self.strType, unpack(self.tAttributes) end self.strType = type self.tAttributes = {...} return true end function dxText:align(horzA, vertA) if not validAlignTypes[horzA] then return self.bHorizontalAlign, self.bVerticalAlign end vertA = vertA or self.bVerticalAlign self.bHorizontalAlign, self.bVerticalAlign = horzA, vertA return true end function dxText:boundingBox(left,top,right,bottom,relative) if left == nil then if self.tBoundingBox then return unpack(boundingBox) else return false end elseif tonumber(left) and tonumber(right) and tonumber(top) and tonumber(bottom) then self.tBoundingBox = {left,top,right,bottom} if type(relative) == "boolean" then self.bRelativeBoundingBox = relative else self.bRelativeBoundingBox = true end else self.tBoundingBox = false end return true end addEventHandler ( "onClientRender", getRootElement(), function() for self,_ in pairs(visibleText) do while true do if self.bDestroyed then visibleText[self] = nil break end local l,t,r,b --If we arent using a bounding box if not self.tBoundingBox then --Decide if we use relative or absolute local p_screenX,p_screenY = 1,1 if self.bRelativePosition then p_screenX,p_screenY = g_screenX,g_screenY end local fX,fY = (self.fX)*p_screenX,(self.fY)*p_screenY if self.bHorizontalAlign == "left" then l = fX r = fX + g_screenX elseif self.bHorizontalAlign == "right" then l = fX - g_screenX r = fX else l = fX - g_screenX r = fX + g_screenX end if self.bVerticalAlign == "top" then t = fY b = fY + g_screenY elseif self.bVerticalAlign == "bottom" then t = fY - g_screenY b = fY else t = fY - g_screenY b = fY + g_screenY end elseif type(self.tBoundingBox) == "table" then local b_screenX,b_screenY = 1,1 if self.bRelativeBoundingBox then b_screenX,b_screenY = g_screenX,g_screenY end l,t,r,b = self.tBoundingBox[1],self.tBoundingBox[2],self.tBoundingBox[3],self.tBoundingBox[4] l = l*b_screenX t = t*b_screenY r = r*b_screenX b = b*b_screenY end local type,att1,att2,att3,att4,att5 = self:type() if type == "border" or type == "stroke" then att2 = att2 or 0 att3 = att3 or 0 att4 = att4
-
-- # Client Side : GUIEditor = { button = {}, window = {}, label = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(369, 181, 507, 463, "x[لـــوحـــة تـــآجــآت خـــآصــه]x", false) GUIEditor.edit[1] = guiCreateEdit(110, 63, 319, 31, "", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(110, 116, 319, 31, "", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(44, 67, 95, 33, "PlayerTag", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[1], 35, 243, 7) GUIEditor.label[2] = guiCreateLabel(48, 116, 95, 33, "PlayerSerial", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[2], 250, 0, 0) GUIEditor.button[1] = guiCreateButton(293, 218, 157, 47, "STOP-Tag", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFC8F108") GUIEditor.button[2] = guiCreateButton(110, 218, 157, 47, "Start-Tag", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFF65E22") guiSetVisible (GUIEditor.window[1] , false) end ) addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) local Serial = guiGetText ( GUIEditor.edit[2] ) local Tag = guiGetText ( GUIEditor.edit[1] ) if ( source == GUIEditor.button[2] ) then if ( string.len ( Serial ) == 32 ) then setSerialData ( Serial, "TagState", "Enable" ) setSerialData ( Serial, "playerTag",Tag ) end else if ( source == GUIEditor.button[1] ) then setSerialData ( Serial, "TagState", "Disable" ) end end end ) function setSerialData(serial,key,value) if( value and type(serial) == "string") then setElementData(root,serial.."&"..key,value) end end -- # Server Side : timer = {} addEventHandler ( "onPlayerChat", root, function ( msg ) if ( getSerialData ( getPlayerSerial ( source ), "TagState" ) == "Enable" ) then local name = getPlayerName( source ) cancelEvent ( ) local Tag = getSerialData ( getPlayerSerial ( source ), "playerTag" ) outputChatBox (" "..Tag.." "..getPlayerName ( source )..": #FFFFFF"..msg, root, 255, 255, 255, true ) end end ) addCommandHandler("77", function (player) if hasObjectPermissionTo(player,"command.kick",true) then if isTimer(timer[player]) then outputChatBox("[ Chat ] : الرجاء عدم تكرر مسح الشات *",player,255,0,0) return end for i=1,15 do outputChatBox(" ") end outputChatBox("#FF9868# #FFFFFF' #c1c1c1[ #FF9868G.N Chat #c1c1c1] #FFFFFF' #c1c1c1[ #FF9868" .. getPlayerName(player) .. "#c1c1c1 ] #FF9868Cleared The Chat .",root,255,0,0,true) timer[player] = setTimer(function () end,5000,1) else outputChatBox("[ Chat ] : انت لست ادمن *",player,255,0,0) end end ) function chatbox(text, msgtype) if ( getSerialData ( getPlayerSerial ( source ), "TagState" ) == "Enable" ) then return end local account = getAccountName(getPlayerAccount(source)) local name = getPlayerName(source) cancelEvent ( ) if isObjectInACLGroup("user." .. account, aclGetGroup("NO")) then outputChatBox("NO" .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Console")) then cancelEvent() outputChatBox("*#FF0000 [ Console #FFFFFF] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("ManagerS")) then cancelEvent() outputChatBox("#665566[ManagerS] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Criminal")) then cancelEvent() outputChatBox("#66FF55[Criminal] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Dieputy.Admin")) then cancelEvent() outputChatBox("#66FYBC[Dieputy.Admin] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Dieputy.SeRvEr")) then cancelEvent() outputChatBox("#FFFFFF[#66FFYYDieputy.SeRvEr#FFFFFF] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Manager")) then cancelEvent() outputChatBox("#FFFFFF[#66FFDCManager#FFFFFF] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Manager-Acl")) then cancelEvent() outputChatBox("#FFFFFF[#66FFFFManager-Acl#FFFFFF] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Leader.Admin")) then cancelEvent() outputChatBox("#66FFCC[Leader.Admin] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("V.I.P-Admin")) then cancelEvent() outputChatBox("#990099[V.I.P-Admin] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("BesT.Admin")) then cancelEvent() outputChatBox("#CC3399[besT.Admin] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Super.Admin")) then cancelEvent() outputChatBox("#CCFF33[super.Admin] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("KinG.SeRvEr")) then cancelEvent() outputChatBox("* [#FF5566KinG.SeRvEr #FFFFFF] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Prote.Admin")) then cancelEvent() outputChatBox("* [ #ff0000Prince.admin#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin.FeatUreD")) then cancelEvent() outputChatBox("* [ #CC0099Admin.FeatUreD#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Big.Admin")) then cancelEvent() outputChatBox("* [ #990066Big.Admin#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin.Plus")) then cancelEvent() outputChatBox("* [ #CC9933Admin.Plus#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Prince.V.I.P")) then cancelEvent() outputChatBox("* [ #FFFF00Prince.V.I.P#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Prince.admin")) then cancelEvent() outputChatBox("* [ #ff0000Prince.admin#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Prince.Server")) then cancelEvent() outputChatBox("* [ #00ff00Prince.Server#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("KinG.Admin")) then cancelEvent() outputChatBox("* [ #990000KinG.Admin#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin.TOP")) then cancelEvent() outputChatBox("* [#660000Admin.TOP#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin.Black")) then cancelEvent() outputChatBox("* [#99CC00 Admin.Black#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin.SPORT")) then cancelEvent() outputChatBox("* [#FFFF00 Admin.SPORT #FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin.BOOS")) then cancelEvent() outputChatBox("#0099ff* [ Admin.BOOS ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin.MFA")) then cancelEvent() outputChatBox("* [ #669999Admin.MFA#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Admin.General")) then cancelEvent() outputChatBox("* [ #00FFCCAdmin.General#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Professional.Admin")) then cancelEvent() outputChatBox("* [ #000066Professional.Admin#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Head.Admin")) then cancelEvent() outputChatBox("* [ #000066Head.Admin#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("ADMIN")) then cancelEvent() outputChatBox("* [ #000066ADMIN#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("SuperModerator")) then cancelEvent() outputChatBox("* [ #00FF00 SuperModerator#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Moderator")) then cancelEvent() outputChatBox("* [ #FF0000 Moderator#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Police")) then cancelEvent() outputChatBox("* [#00FF00Police#FFFFFF] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("V.I.P")) then cancelEvent() outputChatBox("* [#FF0000 V.I.P#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("King.Drift")) then cancelEvent() outputChatBox("* [ #CC0000king Dirft#FFFFFF ] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) elseif isObjectInACLGroup("user." .. account, aclGetGroup("Everyone")) then cancelEvent() outputChatBox("#669966[ play #FFFFFF] x" .. name .. " :#FFFFFF " .. text, root, 255, 255, 255, true) end end addEventHandler("onPlayerChat", root, chatbox) function getSerialData(serial,key) if ( key and type(serial) == "string") then value = getElementData(root,serial.."&"..key) end return value end
-
بالنسبة للتاج الأدمن يعني أنت تبي لما يتكلم واحد يجي تاج الأدمن والسيريال معه؟ كذا بيكرر!؟ بالنسبة للوحة التاج الخاص أنت موب مسوي لها زر فتح خليتها لكـ تفتح من اف5 GUIEditor = { button = {}, window = {}, label = {}, edit = {} } addEventHandler("onClientResourceStart", resourceRoot, function() GUIEditor.window[1] = guiCreateWindow(369, 181, 507, 463, "x[لـــوحـــة تـــآجــآت خـــآصــه]x", false) GUIEditor.edit[1] = guiCreateEdit(110, 63, 319, 31, "", false, GUIEditor.window[1]) GUIEditor.edit[2] = guiCreateEdit(110, 116, 319, 31, "", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(44, 67, 95, 33, "PlayerTag", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[1], 35, 243, 7) GUIEditor.label[2] = guiCreateLabel(48, 116, 95, 33, "PlayerSerial", false, GUIEditor.window[1]) guiLabelSetColor(GUIEditor.label[2], 250, 0, 0) GUIEditor.button[1] = guiCreateButton(293, 218, 157, 47, "STOP-Tag", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[1], "default-bold-small") guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFC8F108") GUIEditor.button[2] = guiCreateButton(110, 218, 157, 47, "Start-Tag", false, GUIEditor.window[1]) guiSetFont(GUIEditor.button[2], "default-bold-small") guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFF65E22") guiSetVisible (GUIEditor.window[1] , false) end ) bindKey ("F5","down", function ( ) if ( guiGetVisible (GUIEditor.window[1]) == true ) then guiSetVisible (GUIEditor.window[1],false) showCursor ( false ) else guiSetVisible (GUIEditor.window[1],true) showCursor ( true ) end end ) addEventHandler ( "onClientGUIClick", resourceRoot, function ( ) local Serial = guiGetText ( GUIEditor.edit[2] ) local Tag = guiGetText ( GUIEditor.edit[1] ) if ( source == GUIEditor.button[2] ) then if ( string.len ( Serial ) == 32 ) then setSerialData ( Serial, "TagState", "Enable" ) setSerialData ( Serial, "playerTag",Tag ) end else if ( source == GUIEditor.button[1] ) then setSerialData ( Serial, "TagState", "Disable" ) end end end ) function setSerialData(serial,key,value) if( value and type(serial) == "string") then setElementData(root,serial.."&"..key,value) end end
-
-- # Client Side : GUIEditor = { checkbox = {}, staticimage = {}, edit = {}, button = {}, window = {}, label = {}, gridlist = {} } function cr() GUIEditor.window[1] = guiCreateWindow(384, 91, 524, 553, "Mr.M[O]Dy", false) guiWindowSetSizable(GUIEditor.window[1], false) guiSetVisible(GUIEditor.window[1],false) GUIEditor.gridlist[1] = guiCreateGridList(10, 56, 206, 327, false, GUIEditor.window[1]) local PlayerName = guiGridListAddColumn(GUIEditor.gridlist[1], " | إسم الآعب", 0.4) local PlayerTime = guiGridListAddColumn(GUIEditor.gridlist[1], " | ساعات", 0.4) GUIEditor.edit[1] = guiCreateEdit(247, 86, 246, 32, "", false, GUIEditor.window[1]) GUIEditor.label[1] = guiCreateLabel(443, 57, 209, 19, " | عدد الساعات :", false, GUIEditor.window[1]) GUIEditor.checkbox[1] = guiCreateCheckBox(243, 149, 151, 18, " | تحديد الجميع", false, false, GUIEditor.window[1]) GUIEditor.button[1] = guiCreateButton(240, 322, 107, 45, " | إعطاء ساعات", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF00FF00") GUIEditor.button[2] = guiCreateButton(394, 322, 107, 45, " | سحب الساعات", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFFF0000") GUIEditor.edit[2] = guiCreateEdit(12, 29, 204, 21, " | Search | البحث", false, GUIEditor.window[1]) GUIEditor.label[2] = guiCreateLabel(1, 390, 566, 15, "_______________________________________________________________________________________________________________________", false, GUIEditor.window[1]) guiSetFont(GUIEditor.label[2], "default-bold-small") guiLabelSetColor(GUIEditor.label[2], 255, 0, 0) GUIEditor.label[3] = guiCreateLabel(421, 427, 90, 15, " | كلمة التوزيع", false, GUIEditor.window[1]) GUIEditor.edit[3] = guiCreateEdit(385, 452, 129, 18, "", false, GUIEditor.window[1]) GUIEditor.label[4] = guiCreateLabel(62, 427, 90, 15, " | الساعات :", false, GUIEditor.window[1]) GUIEditor.edit[4] = guiCreateEdit(47, 452, 129, 18, "", false, GUIEditor.window[1]) GUIEditor.button[3] = guiCreateButton(216, 500, 133, 37, " | Close", false, GUIEditor.window[1]) guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FF00FF00") GUIEditor.edit[5] = guiCreateEdit(216, 452, 129, 18, "", false, GUIEditor.window[1]) GUIEditor.label[5] = guiCreateLabel(245, 427, 90, 15, " | كلمة التوزيع !", false, GUIEditor.window[1]) GUIEditor.staticimage[1] = guiCreateStaticImage(321, 187, 117, 96, "logo.png", false, GUIEditor.window[1]) end addEventHandler("onClientResourceStart", resourceRoot,cr) addEventHandler("onClientGUIClick",root, function () if source == GUIEditor.checkbox[1] then if guiCheckBoxGetSelected(source) then guiGridListSetSelectedItem(GUIEditor.gridlist[1],-1,-1) end elseif source == GUIEditor.gridlist[1] then if guiCheckBoxGetSelected(GUIEditor.checkbox[1]) then guiCheckBoxSetSelected(GUIEditor.checkbox[1],false) end elseif source == GUIEditor.edit[2] then if guiGetText(source) == "بــحــث ...." then guiSetText(source,"") end elseif source == GUIEditor.button[1] and guiGetText(GUIEditor.edit[1]) ~= "" and tonumber(guiGetText(GUIEditor.edit[1])) then if guiCheckBoxGetSelected(GUIEditor.checkbox[1]) then triggerServerEvent("addTime",root,"all",tonumber(guiGetText(GUIEditor.edit[1]))) else triggerServerEvent("addTime",root,guiGridListGetItemText(GUIEditor.gridlist[1],guiGridListGetSelectedItem(GUIEditor.gridlist[1]),1),tonumber(guiGetText(GUIEditor.edit[1]))) end elseif source == GUIEditor.button[2] and guiGetText(GUIEditor.edit[1]) ~= "" and tonumber(guiGetText(GUIEditor.edit[1])) then showCursor(not guiGetVisible(GUIEditor.window[1])) guiSetVisible(GUIEditor.window[1],not guiGetVisible(GUIEditor.window[1])) if guiCheckBoxGetSelected(GUIEditor.checkbox[1]) then triggerServerEvent("removeTime",root,"all",tonumber(guiGetText(GUIEditor.edit[1]))) else triggerServerEvent("removeTime",root,guiGridListGetItemText(GUIEditor.gridlist[1],guiGridListGetSelectedItem(GUIEditor.gridlist[1]),1),tonumber(guiGetText(GUIEditor.edit[1]))) end elseif source == GUIEditor.button[3] and guiGetText(GUIEditor.label[3]) ~= "" and guiGetText(GUIEditor.label[4]) ~= "" and guiGetText(GUIEditor.label[5]) ~= "" then triggerServerEvent("ToServer",root,guiGetText(GUIEditor.edit[3]),guiGetText(GUIEditor.edit[4]),guiGetText(GUIEditor.edit[5])) showCursor(not guiGetVisible(GUIEditor.window[1])) guiSetVisible(GUIEditor.window[1],not guiGetVisible(GUIEditor.window[1])) end end ) addEventHandler("onClientGUIChanged",root, function () if source == GUIEditor.edit[2] then searchgd(GUIEditor.gridlist[1],guiGetText(source)) end end ) function getPlayerTime(plr) return getElementData(plr,"PlayTime") end function SetPlayersInGD( GridList ) if GridList then if getElementType ( GridList ) == "gui-gridlist" then if guiGridListClear ( GridList ) then for i, v in next, getElementsByType ( "player" ) do local Row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, Row, 1, getPlayerName ( v ), false, false ) guiGridListSetItemText ( GridList, Row, 2, getPlayerTime( v ), false, false ) end end end end end function searchgd(GridList,name) if guiGridListClear ( GridList ) then for i, v in next, getElementsByType ( "player" ) do if not string.find(getPlayerName(v),name) then return end local Row = guiGridListAddRow ( GridList ) guiGridListSetItemText ( GridList, Row, 1, getPlayerName ( v ), false, false ) guiGridListSetItemText ( GridList, Row, 2, getPlayerTime( v ), false, false ) end end end SetPlayersInGD(GUIEditor.gridlist[1]) addEvent('openn',true) addEventHandler('openn',root, function () showCursor(not guiGetVisible(GUIEditor.window[1])) guiSetVisible(GUIEditor.window[1],not guiGetVisible(GUIEditor.window[1])) SetPlayersInGD(GUIEditor.gridlist[1]) guiSetText(GUIEditor.edit[1],"") guiSetText(GUIEditor.edit[2],"بــحــث ....") guiSetText(GUIEditor.edit[3],"") guiSetText(GUIEditor.edit[4],"") guiSetText(GUIEditor.edit[5],"") end ) -- # Server Side : exports.scoreboard:addScoreboardColumn('PlayTime') addEvent("addTime",true) addEvent("removeTime",true) addEvent("ToServer",true) addEventHandler("onResourceStart",resourceRoot, function ( ) executeSQLQuery ( "CREATE TABLE IF NOT EXISTS Prestege_Save_Time ( PlayerSerial,Hours,Minuts,Seconds,PlayAllTime )" ) outputDebugString ("Execute SQL Loadded !") end ) local t = { } local w = {} addEventHandler("ToServer",root, function (word,get,time) if word and tonumber(get) and tonumber(time) then table.insert(w,{word,get}) setTimer(function () for _,v in ipairs(w) do if v[1] == word and v[2] == get then table.remove(w,i) end end end,time*60*60*1000,1) end end ) addEventHandler("onConsole",root, function (msg) for _,v in ipairs(w) do if msg == v[1] then local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) and not isGuestAccount ( playeraccount ) then if not getAccountData ( playeraccount, "time-"..msg) then addPlayerTime(source,v[2]) setAccountData( playeraccount, "time-"..msg,true) end end end end end ) addEventHandler("addTime",root, function (to,time) if to == "all" then for _,v in ipairs(getElementsByType("player")) do addPlayerTime(v,time) end else plr = getPlayerFromName(to) if plr then addPlayerTime(plr,time) end end end ) addEventHandler("removeTime",root, function (to,time) if to == "all" then for _,v in ipairs(getElementsByType("player")) do removePlayerTime(v,time) end else plr = getPlayerFromName(to) if plr then removePlayerTime(plr,time) end end end ) function addPlayerTime(plr,time) time = math.floor(time) t[plr]['hour'] = tonumber(t[plr]['hour'] or 0) + time end function removePlayerTime(plr,time) time = math.floor(time) t[plr]['hour'] = tonumber(t[plr]['hour'] or 0) - time end function checkValues( source,arg1,arg2) if (arg2 >= 60) then t[ source ][ 'min' ] = tonumber( t[ source ][ 'min' ] or 0 ) + 1 t[ source ][ 'sec' ] = 0 end if (arg1 >= 60) then t[ source ][ 'min' ] = 0 t[ source ][ 'hour' ] = tonumber( t[ source ][ 'hour' ] or 0 ) + 1 end return arg1, arg2 end setTimer( function( ) for _, v in pairs( getElementsByType( "player" ) ) do if (not t[ v ]) then t[ v ] = { ["hour"] = 0, ["min"] = 0, ["sec"] = 0 } end t[ v ][ 'sec' ] = tonumber( t[ v ][ 'sec' ] or 0 ) + 1 local min,sec = checkValues ( v, t[ v ][ 'min' ] or 0, t[ v ][ 'sec' ] or 0 ) local hour = tonumber( t[ v ][ 'hour' ] or 0 ) setElementData( v, "PlayTime", tostring( hour )..':'..tostring( min )..':'..tostring( sec ) ) end end, 1000, 0 ) addEventHandler("onPlayerQuit",root, function ( ) local sValue = getElementData( source,'PlayTime' ) local hour = tonumber( t[ source ][ 'hour' ] or 0 ) local min = tonumber( t[ source ][ 'min' ] or 0 ) local sec = tonumber( t[ source ][ 'sec' ] or 0 ) local serial = getPlayerSerial ( source ) local Results = executeSQLQuery("SELECT * FROM Prestege_Save_Time WHERE PlayerSerial=?",serial) if ( type ( Results ) == "table" and #Results == 0 or not Results ) then executeSQLQuery ( "INSERT INTO Prestege_Save_Time ( PlayerSerial,Hours,Minuts,Seconds,PlayAllTime ) VALUES(?,?,?,?,?)",serial,hour,min,sec,sValue ) else executeSQLQuery('UPDATE Prestege_Save_Time SET Hours =?, Minuts =?, Seconds =?, PlayAllTime =? WHERE PlayerSerial =?', hour, min, sec, sValue, serial) end t[ source ] = nil end ) addEventHandler("onResourceStop",resourceRoot, function ( ) for k,v in ipairs ( getElementsByType("player") ) do local playeraccount = getPlayerAccount ( v ) local sValue = getElementData( v,'PlayTime' ) if not ( t [ v ] ) then t [ v ] = { } end local hour = tonumber( t[ v ][ 'hour' ] or 0 ) local min = tonumber( t[ v ][ 'min' ] or 0 ) local sec = tonumber( t[ v ][ 'sec' ] or 0 ) local serial = getPlayerSerial ( v ) local Results = executeSQLQuery("SELECT * FROM Prestege_Save_Time WHERE PlayerSerial=?",getPlayerSerial ( v ) ) if ( type ( Results ) == "table" and #Results == 0 or not Results ) then executeSQLQuery ( "INSERT INTO Prestege_Save_Time ( PlayerSerial,Hours,Minuts,Seconds,PlayAllTime ) VALUES(?,?,?,?,?)",serial,hour,min,sec,sValue ) else executeSQLQuery('UPDATE Prestege_Save_Time SET Hours =?, Minuts =?, Seconds =?, PlayAllTime =? WHERE PlayerSerial =?', hour, min, sec, sValue, serial) end end end ) addEventHandler("onResourceStart",resourceRoot, function ( ) for _,v in ipairs ( getElementsByType ( "player" ) ) do local Results = executeSQLQuery("SELECT * FROM Prestege_Save_Time WHERE PlayerSerial=?",getPlayerSerial ( v ) ) if ( type ( Results ) == "table" and #Results == 0 or not Results ) then return end if not t[ v ] then t[ v ] = {} end t[ v ]["hour"] = tonumber(Results[1]["Hours"]) t[ v ]["min"] = tonumber(Results[1]["Minuts"]) t[ v ]["sec"] = tonumber(Results[1]["Seconds"]) end end ) addEventHandler("onPlayerJoin",root, function ( ) local Results = executeSQLQuery("SELECT * FROM Prestege_Save_Time WHERE PlayerSerial=?",getPlayerSerial ( source ) ) if ( type ( Results ) == "table" and #Results == 0 or not Results ) then return end setElementData ( source, "PlayTime", Results[1]["PlayAllTime"] ) if not t[ source ] then t[ source ] = {} end t[ source ]["hour"] = tonumber(Results[1]["Hours"]) t[ source ]["min"] = tonumber(Results[1]["Minuts"]) t[ source ]["sec"] = tonumber(Results[1]["Seconds"]) end ) addCommandHandler('لوحة', function(thePlayer) local account = getPlayerAccount ( thePlayer ) if isObjectInACLGroup ( "user.".. getAccountName ( account ), aclGetGroup ( "Console" ) ) then outputChatBox('* Welcome !',thePlayer,0,155,255,true) triggerClientEvent(thePlayer,'openn',thePlayer) else outputChatBox('* You not have permission to Access',thePlayer,255,0,0,true) end end )
