Jump to content

مساعده بلوحة الترقيات


Recommended Posts

Just now, #Dr.BnG said:

ممكن تكتبلي الكود كامل

اداك الطريقه نصور ماقصر

سويها حاول فكر 

ادخل الوظيفه شوف كيف السايتناكس

و الامثله الي تحت في الوظيفه وراح تتعلم 

ادخل قسم الشروحات شوف الدروس 

Link to comment

لول نصور ما اعتقد انك صح لانو بيقولك هي بالساعات و هوا يباها بالوينز

يعني يغير اسم الداتا فقط :-

+ اطرحح اكوادك لان الساعات هتستخدم 

split

لهيك لازم تشلها

Link to comment

xAddToGroupFunction_ = function ( Group,Price,Name )
	local account = getAccountName(getPlayerAccount(source));
    if isGuestAccount(getPlayerAccount(source)) then return outputChatBox(" * يجب عليك التسجيل اولاَ",source,255,0,255,true); end
	if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return outputChatBox("** لديك هذهـ الرتبة فعـلا  ! ",source,255,0,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,0,255,255,true);
	else
		outputChatBox("**ليس لديك ساعات كافية",source,255,0,0,true);
    end
end
addEvent("Accept:the:request",true)
addEventHandler("Accept:the:request",root,xAddToGroupFunction_)

Server

----------------------
-- Setting
----------------------

local Key = "F7"

local Admin = {
{ "V.I.P", 10 },
{ "Vote Police", 20 },
{ "Police", 30 },
{ "Msuol Police", 50 },
{ "Vote Moderator", 80 },
{ "Moderator1", 100 },
{ "Moderator2", 150 },
{ "SuperModerator1", 200 },
{ "Admin1", 500 },
{ "Admin Prinse", 550 },
{ "V.I.P Admin", 600 },
{ "Specail Admin", 800 },
{ "Admin Mo7TaReF", 1000 },
{ "Admin Mngem", 1500 },
{ "senior Admin", 2000 },
{ "SPECIAL PRINSE", 2500 },
}
----------------------
-- Setting
----------------------

GiveAdmin = {
    Window = {},
    gridlist = {},
    button = {},
    label = {},
}

function centerWindow(center_window)
    local screenW,screenH=guiGetScreenSize()
    local windowW,windowH=guiGetSize(center_window,false);
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2
    guiSetPosition(center_window,x,y,false);
end

GiveAdmin.Window[1] = guiCreateWindow(445, 132, 390, 339, "=[نــظًًـأم الرتبـً بأًلسـًًـاعأت ]=", false);
centerWindow(GiveAdmin.Window[1]);
guiSetVisible(GiveAdmin.Window[1],false);
guiWindowSetSizable(GiveAdmin.Window[1], false);
guiSetAlpha(GiveAdmin.Window[1], 1.00);
guiSetProperty(GiveAdmin.Window[1], "CaptionColour", "FFF70000");

guiSetFont(GiveAdmin.label[1], "default-bold-small")
guiLabelSetColor(GiveAdmin.label[1], 255, 0, 0)
GiveAdmin.gridlist[1] = guiCreateGridList(9, 51, 267, 397, false, GiveAdmin.Window[1]);
guiGridListAddColumn(GiveAdmin.gridlist[1], "#", 0.2)
guiGridListAddColumn(GiveAdmin.gridlist[1], "الرتبة #", 0.4);
guiGridListAddColumn(GiveAdmin.gridlist[1], "الساعات #", 0.5);
guiSetFont(GiveAdmin.label[2], "default-bold-small");
guiLabelSetColor(GiveAdmin.label[2], 41, 255, 0);
GiveAdmin.button[1] = guiCreateButton(281, 268, 105, 26, ":;|اترقـًـية ", false, GiveAdmin.Window[1]);
guiSetFont(GiveAdmin.button[1], "default-bold-small");
guiSetProperty(GiveAdmin.button[1], "NormalTextColour", "FFF70000");


for k,v in ipairs ( Admin ) do
row = guiGridListAddRow(GiveAdmin.gridlist[1]);
guiGridListSetItemText(GiveAdmin.gridlist[1],row,1,''..k..'-',false,false);
guiGridListSetItemText(GiveAdmin.gridlist[1],row,2,v[1],false,false);
guiGridListSetItemText(GiveAdmin.gridlist[1],row,3,v[2],false,false);
guiGridListSetItemText(GiveAdmin.gridlist[1],row,4,v[3],false,false);
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,2,0,255,0);
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,1,255,0,0)
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,1,255,0,0);
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,1,255,0,0);
end

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);

xBindFunction_ = function ()
	guiSetVisible(GiveAdmin.Window[1],not guiGetVisible(GiveAdmin.Window[1]));
	showCursor(guiGetVisible(GiveAdmin.Window[1]));
end
bindKey(Key,"down",xBindFunction_);

Client

Link to comment

جرب بدل السيرفر بهاذا 

xAddToGroupFunction_ = function ( Group,Price,Name )
	local account = getAccountName(getPlayerAccount(source));
    if isGuestAccount(getPlayerAccount(source)) then return outputChatBox(" * يجب عليك التسجيل اولاَ",source,255,0,255,true); end
	if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return outputChatBox("** لديك هذهـ الرتبة فعـلا  ! ",source,255,0,255,true); end
	local Wins = ( getElementData ( source , "Wins" ) or 0 )
	if ( Wins >= tonumber(Price))  then
		aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account);
		outputChatBox("** تم اضافة الرتبة بنجاح | "..Name,source,0,255,255,true);
	else
		outputChatBox("**ليس لديك ونز كافي",source,255,0,0,true);
    end
end
addEvent("Accept:the:request",true)
addEventHandler("Accept:the:request",root,xAddToGroupFunction_)

 

Edited by Default
Link to comment
16 minutes ago, Default said:

جرب بدل السيرفر بهاذا 


xAddToGroupFunction_ = function ( Group,Price,Name )
	local account = getAccountName(getPlayerAccount(source));
    if isGuestAccount(getPlayerAccount(source)) then return outputChatBox(" * يجب عليك التسجيل اولاَ",source,255,0,255,true); end
	if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return outputChatBox("** لديك هذهـ الرتبة فعـلا  ! ",source,255,0,255,true); end
	local Wins ( getElementData ( source , "Wins" ) or 0 )
	if ( Wins >= tonumber(Price))  then
		aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account);
		outputChatBox("** تم اضافة الرتبة بنجاح | "..Name,source,0,255,255,true);
	else
		outputChatBox("**ليس لديك ونز كافي",source,255,0,0,true);
    end
end
addEvent("Accept:the:request",true)
addEventHandler("Accept:the:request",root,xAddToGroupFunction_)

 

local Wins = ( getElementData ( source , "Wins" ) or 0 )

 

  • Like 1
Link to comment
xAddToGroupFunction_ = function ( Group,Price,Name )	local account = getAccountName(getPlayerAccount(source));
    if isGuestAccount(getPlayerAccount(source)) then return outputChatBox(" * يجب عليك التسجيل اولاَ",source,255,0,255,true); end
	if isObjectInACLGroup("user."..account, aclGetGroup(tostring(Group))) then return outputChatBox("** لديك هذهـ الرتبة فعـلا  ! ",source,255,0,255,true); end
	local Wins = ( getElementData ( source , "Wins" ) or 0 )
	if ( Wins >= tonumber(Price))  then
		aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account);
		outputChatBox("** تم اضافة الرتبة بنجاح | "..Name,source,0,255,255,true);
	else
		outputChatBox("**ليس لديك ونز كافي",source,255,0,0,true);
    end
end
addEvent("Accept:the:request",true)
addEventHandler("Accept:the:request",root,xAddToGroupFunction_)

احط السيرفر كذا؟

 

Link to comment
  • 2 weeks later...
Just now, twitter said:

ترا اعتقد انكم معقدين الموضوع شوي :)

كل الي تحتاجه تبدل السورس بالسطر السادس

 

  1.    local sValue = getElementData( source,'PlayTime' )
    
       local sValue = getElementData( source,'PlayTime' )
    لو م عرفت اطرح اكواد كوينز وبنساعدك

 لا مو السورس

اسم الداتا يمكن معه غير  

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...