saef Posted December 10, 2015 Share Posted December 10, 2015 طلب ابي تضيفون هنا لي مود الترقيات المخالف و لم يخذ رتبه تنسحب الي قبل م تتتكر كلنت ---------------------- -- Setting ---------------------- local Admin = { {"King.Time","15"}, {"King.Drift","30"}, {"Police","60"}, {"V.I.P","80"}, {"Moderator","100"}, {"SuperModerator","140"}, {"ADMIN","180"}, {"Head.Admin","200"}, {"Professional.Admin","250"}, {"Admin.MFA","300"}, {"Admin.SPORT","350"}, {"Admin.BOOS","400"}, {"Admin.TOP","450"}, {"Big.Admin","500"}, {"Admin.Plus","600"}, {"Admin.FeatUreD","700"}, {"BesT.Admin","800"}, {"Leader.Admin","1000"}, {"Prince.V.I.P","1300"}, {"Prince.Admin","1500"}, {"Prince.Server","1800"}, {"Super.Admin","2000"}, {"KinG.SeRvEr","2500"}, } ---------------------- -- Setting ---------------------- FontGrid = guiCreateFont( "Fonts/Font2.ttf", 11 ) FontLabel = guiCreateFont( "Fonts/Font2.ttf", 13 ) FontButton = guiCreateFont( "Fonts/Font2.ttf", 13 ) GUIEditor = { gridlist = {}, staticimage = {}, button = {}, label = {} } GUIEditor.staticimage[1] = guiCreateStaticImage(257, 104, 291, 363, "images/Back.png", false) guiSetVisible(GUIEditor.staticimage[1], false) guiWindowSetSizable(GUIEditor.staticimage[1], false) guiWindowSetMovable(GUIEditor.staticimage[1], true) GUIEditor.label[1] = guiCreateLabel(2, 2, 284, 48, "=[ منظمة الهجولة يرحب بكم ]=", false, GUIEditor.staticimage[1]) guiLabelSetColor(GUIEditor.label[1], 255, 251, 0) GUIEditor.gridlist[1] = guiCreateGridList(10, 51, 271, 251, false, GUIEditor.staticimage[1]) guiGridListAddColumn(GUIEditor.gridlist[1], "Group", 0.7) guiGridListAddColumn(GUIEditor.gridlist[1], "Hours", 0.3) GUIEditor.button[1] = guiCreateButton(10, 307, 271, 46, "=[ شراء الرتبه ]=", false, GUIEditor.staticimage[1]) guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FF00FFFC") guiSetFont(GUIEditor.gridlist[1], FontGrid ) guiSetFont(GUIEditor.label[1], FontLabel ) guiSetFont(GUIEditor.button[1], FontButton ) for k,v in ipairs ( Admin ) do row = guiGridListAddRow(GUIEditor.gridlist[1]); guiGridListSetItemText(GUIEditor.gridlist[1],row,1,v[1],false,false); guiGridListSetItemText(GUIEditor.gridlist[1],row,2,v[2],false,false); guiGridListSetItemColor(GUIEditor.gridlist[1],row,1,math.random(0,255),math.random(0,255),math.random(0,255)) guiGridListSetItemColor(GUIEditor.gridlist[1],row,2,math.random(0,255),math.random(0,255),math.random(0,255)) end xMainFunctions_ = function ( ) local row, col = guiGridListGetSelectedItem ( GUIEditor.gridlist[1] ) local Group = tostring ( guiGridListGetItemText(GUIEditor.gridlist[1],row,1 )); local Price = tostring ( guiGridListGetItemText(GUIEditor.gridlist[1],row,2 )); if ( row and col and row ~= -1 and col ~= -1 ) then triggerServerEvent("Accept:the:request",localPlayer,Group,Price); else outputChatBox("Please Click On The Rank",math.random(0,255),math.random(0,255),math.random(0,255),true); end end addEventHandler("onClientGUIClick",GUIEditor.button[1],xMainFunctions_,false) local againStartMove = 10 local endMove = 300 addEventHandler("onClientRender",root,function() if ( guiGetVisible(GUIEditor.label[1]) == true ) then local x,y = guiGetPosition(GUIEditor.label[1],false) guiSetPosition(GUIEditor.label[1],x + 1,y,false) if ( x >= endMove ) then guiSetPosition(GUIEditor.label[1],againStartMove,y,false) end end end) addEventHandler ( "onClientResourceStart", root, function ( ) if ( isTimer ( timerColor ) ) then killTimer ( timerColor ) end timerColor = setTimer ( function ( ) guiLabelSetColor ( GUIEditor.label[1], math.random ( 255 ), math.random ( 255 ), math.random ( 255 ) ) end, 100, 0 ) end ) addEventHandler("onClientResourceStart", resourceRoot, function() setTimer(function() for _, random in ipairs(getElementsByType('gui-button',getResourceRootElement(getThisResource())) ) do guiSetProperty(random, 'NormalTextColour', string.format("%.2X%.2X%.2X%.2X", 255, math.random(255), math.random(255), math.random(255))) end end, 100, 0) end) bindKey("F7", "down", function() if guiGetVisible(GUIEditor.staticimage[1]) == true then guiSetVisible(GUIEditor.staticimage[1], false) showCursor(false) guiSetInputEnabled(false) else if guiGetVisible(GUIEditor.staticimage[1]) == false then guiSetVisible(GUIEditor.staticimage[1], true) showCursor(false) guiSetInputEnabled(true) end end end ) سيرفر xAddToGroupFunction_ = function ( Group,Price ) local account = getAccountName(getPlayerAccount(source)); if isGuestAccount(getPlayerAccount(source)) then return outputChatBox("#=[يجب عليك التسجيل اولا]=",source,255,0,0,true); end if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return outputChatBox("#You have this rank, please choose another class",source,0,255,255,true); end local sValue = getElementData( source,'PlayTime' ) if not sValue then sValue = '0:0:0' end local data = split(sValue,':') local hour = tonumber( data[1] ) if hour == nil or not tonumber(hour) then hour = 0 end if ( hour >= tonumber(Price)) then aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); outputChatBox("#=[مبروك حصولك على الرتبه]= "..Name,source,255,0,0,true); else outputChatBox("#=[ انت لا تملك الساعات الكافيه]=",source,0,255,255,true); end end addEvent("Accept:the:request",true) addEventHandler("Accept:the:request",root,xAddToGroupFunction_) Link to comment
Rockyz Posted December 10, 2015 Share Posted December 10, 2015 (edited) xAddToGroupFunction_ = function ( Group,Price ) local account = getAccountName(getPlayerAccount(source)); if isGuestAccount(getPlayerAccount(source)) then return outputChatBox("#=[يجب عليك التسجيل اولا]=",source,255,0,0,true); end if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return outputChatBox("#You have this rank, please choose another class",source,0,255,255,true); end if isObjectInACLGroup("user."..account, aclGetGroup("Ex-Admin")) then return removeObjects(source) end local sValue = getElementData( source,'PlayTime' ) if not sValue then sValue = '0:0:0' end local data = split(sValue,':') local hour = tonumber( data[1] ) if hour == nil or not tonumber(hour) then hour = 0 end if ( hour >= tonumber(Price)) then aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); outputChatBox("#=[مبروك حصولك على الرتبه]= "..Name,source,255,0,0,true); else outputChatBox("#=[ انت لا تملك الساعات الكافيه]=",source,0,255,255,true); end end addEvent("Accept:the:request",true) addEventHandler("Accept:the:request",root,xAddToGroupFunction_) function removeObjects(element) if plr and isElement(plr) and not isGuestAccount (getPlayerAccount(element)) then for k,v in ipairs(aclGroupList()) do aclGroupRemoveObject (v, "user.".. getAccountName(getPlayerAccount(element))); end end end Edited December 10, 2015 by Guest Link to comment
saef Posted December 10, 2015 Author Share Posted December 10, 2015 xAddToGroupFunction_ = function ( Group,Price ) local account = getAccountName(getPlayerAccount(source)); if isGuestAccount(getPlayerAccount(source)) then return outputChatBox("#=[يجب عليك التسجيل اولا]=",source,255,0,0,true); end if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return outputChatBox("#You have this rank, please choose another class",source,0,255,255,true); end if isObjectInACLGroup("user."..account, aclGetGroup("Ex-Admin")) then return removeObjects(source) end local sValue = getElementData( source,'PlayTime' ) if not sValue then sValue = '0:0:0' end local data = split(sValue,':') local hour = tonumber( data[1] ) if hour == nil or not tonumber(hour) then hour = 0 end if ( hour >= tonumber(Price)) then aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); outputChatBox("#=[مبروك حصولك على الرتبه]= "..Name,source,255,0,0,true); else outputChatBox("#=[ انت لا تملك الساعات الكافيه]=",source,0,255,255,true); end end addEvent("Accept:the:request",true) addEventHandler("Accept:the:request",root,xAddToGroupFunction_) function removeObjects(plr) if plr and isElement(plr) and not isGuestAccount (getPlayerAccount(element)) then for k,v in ipairs(aclGroupList()) do aclGroupRemoveObject (v, "user.".. getAccountName(getPlayerAccount(element))); end end end جآري التجربه Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now