Jump to content

مشكله


Recommended Posts

السلام عليكم

مشكله معي مود شراء رتب المود في خطأين

الخطأ الاول لما اشتري رتبه يشتري عادي ويعطيني رتبه لكن يسوي ريستارت لكل الاعبين

بدي اياه يسوي ريستارت للشخص نفسه

لانه احيانا ناس يكون معها سيارات ولما يشتري هوه الرتبه تروح سيارات الاعبين

يعني بدي لما يشتري الرتبه يسوي ريستارت له فقط

والخطأ الثاني

مثلن شرا رتبه لفل 1 وبعدين شرا رتبه لفل 2 المفروض يسحب رتبته لفل 1 ويعطيه لفل 2

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

Link to comment

الكلينت

  
  
local Admin = { 
{"Level_1","Level_1","100"}, 
{"Level_2","Level_2","250"}, 
{"Level_3","Level_3","500"}, 
{"Level_4","Level_4","1250"}, 
  
{"Level_5","Level_5","3000"}, 
{"Leader","Leader","5000"}, 
{"HeadLeaDer","HeadLeaDer","8000"}, 
{"ADMIN","ADMIN","15000"}, 
  
{"HEAD-ADMIN","HEAD-ADMIN","10000"}, 
{"SuPeR-ADMIN","SuPeR-ADMIN","20000"}, 
{"BIG-ADMIN","BIG-ADMIN","35000"}, 
{"GA-1","GA-1","42000"}, 
{"GA-2","GA-2","50000"}, 
{"GM-1","GM-1","75000"}, 
{"GM-2","GM-2","105000"}, 
  
{"SUPPORT","SUPPORT","120000"}, 
{"ProAdmin","ProAdmin","130000"}, 
{"cOwner","cOwner","155000"}, 
} 
  
---------------------- 
-- 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, 310, 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", "FF0383FB"); 
  
GiveAdmin.label[1] = guiCreateLabel(8, 19, 411, 33, "مرحبا بك في نظام شراء الرتب الرجاء اختيار الرتبة ادناهـ :", false, GiveAdmin.Window[1]); 
guiSetFont(GiveAdmin.label[1], "default-bold-small") 
guiLabelSetColor(GiveAdmin.label[1], 255, 0, 0) 
GiveAdmin.gridlist[1] = guiCreateGridList(9, 51, 294, 236, false, GiveAdmin.Window[1]); 
guiGridListAddColumn(GiveAdmin.gridlist[1], "#", 0.2) 
guiGridListAddColumn(GiveAdmin.gridlist[1], "الرتبة", 0.2); 
guiGridListAddColumn(GiveAdmin.gridlist[1], "القروب", 0.2); 
guiGridListAddColumn(GiveAdmin.gridlist[1], "السكور", 0.2); 
  
GiveAdmin.button[1] = guiCreateButton(18, 302, 115, 26, "شراء الرتبة", false, GiveAdmin.Window[1]); 
guiSetFont(GiveAdmin.button[1], "default-bold-small"); 
guiSetProperty(GiveAdmin.button[1], "NormalTextColour", "FFF5FF00"); 
  
  
GiveAdmin.button[2] = guiCreateButton(186, 302, 115, 26, "اغلاق", false, GiveAdmin.Window[1]); 
guiSetFont(GiveAdmin.button[2], "default-bold-small"); 
guiSetProperty(GiveAdmin.button[2], "NormalTextColour", "FFF5FF00"); 
  
  
  
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,1,255,255,0); 
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,2,0,255,0) 
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,3,255,255,0); 
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,4,0,255,0); 
guiSetFont(GiveAdmin.gridlist[1],"default-bold-small"); 
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); 
  
xCloseFunctions_ = function ( ) 
    guiSetVisible (GiveAdmin.Window[1], false ) 
    showCursor ( false ) 
end 
addEventHandler("onClientGUIClick",GiveAdmin.button[2],xCloseFunctions_,false); 
  
  
Markers ={ 
{202.15210,  1882.76294 , 17.64806}, 
{356.09140,  -2084.93506,  2.30000} 
} 
for i,v in ipairs (Markers) do 
    marker = createMarker(v[1], v[2], v[3] -1, "cylinder", 2, 255,0,0,255) 
end 
  
  
addEventHandler ( "onClientMarkerHit", resourceRoot, 
function ( player ) 
    if player == localPlayer then 
    guiSetVisible (GiveAdmin.Window[1], true ) 
    showCursor ( true ) 
    end 
end 
) 
  

السيرفر

xAddToGroupFunction_ = function ( Group,Price,Name ) 
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("** لديك هذهـ الرتبة فعـلا  ! ",source,255,0,0,true); end 
if ( getElementData(source, "Zombie kills") >= tonumber(Price))  then 
    aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); 
    outputChatBox("** تم شراء الرتبة بـ نجاحح | "..Name.." | ",source,0,255,0,true); 
local res = getResourceFromName ( "admin" ) 
if getResourceState(res) == "running" then 
    restartResource(res) 
end 
  
 else 
 outputChatBox("لا تملك السكور الكافي",source,255,0,0,true); 
     end 
  end 
addEvent("Accept:the:request",true) 
addEventHandler("Accept:the:request",root,xAddToGroupFunction_) 
  

Link to comment

المود شغال انا الحين جربته

ضيفه لجروب الادمن

عشان تضيه لجروب الادمن افتح لوحه الادمنيه و ادخل التالي

1- Manage acl

2-Click To Admin

3-Add Object

4-resource.ModName اكتب

( ModName = اسم المود )

اتمنى اكون ساعدتك

Link to comment

ليه انا قولت خربان مثلا؟؟

انا قولت لما شخص يشتري رتبه يسوي ريستارت للجميع ابيه لما يشتري الرتبه يسوي ريستارت للشخص نفسه فقط

والمشكله 2 وهي فقط لما يكون معه مثلن لفل 1 ويشتري لفل 2 المفروض يسحب رتبته القديمه من الاسل ويعطيه الرتبه الجديده

Link to comment

اذا قصدك ريستارت للاعب معين ،

  
triggerServerEvent( "event", yourPlayer ) 
restartResource 
  

هذا الي فهمته من كلامك ، و ياريت توضح اذا مو كذا

#Edit

جرب كذا

الكلينت

  
  
local Admin = { 
{"Level_1","Level_1","100"}, 
{"Level_2","Level_2","250"}, 
{"Level_3","Level_3","500"}, 
{"Level_4","Level_4","1250"}, 
  
{"Level_5","Level_5","3000"}, 
{"Leader","Leader","5000"}, 
{"HeadLeaDer","HeadLeaDer","8000"}, 
{"ADMIN","ADMIN","15000"}, 
  
{"HEAD-ADMIN","HEAD-ADMIN","10000"}, 
{"SuPeR-ADMIN","SuPeR-ADMIN","20000"}, 
{"BIG-ADMIN","BIG-ADMIN","35000"}, 
{"GA-1","GA-1","42000"}, 
{"GA-2","GA-2","50000"}, 
{"GM-1","GM-1","75000"}, 
{"GM-2","GM-2","105000"}, 
  
{"SUPPORT","SUPPORT","120000"}, 
{"ProAdmin","ProAdmin","130000"}, 
{"cOwner","cOwner","155000"}, 
} 
  
---------------------- 
-- 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, 310, 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", "FF0383FB"); 
  
GiveAdmin.label[1] = guiCreateLabel(8, 19, 411, 33, "مرحبا بك في نظام شراء الرتب الرجاء اختيار الرتبة ادناهـ :", false, GiveAdmin.Window[1]); 
guiSetFont(GiveAdmin.label[1], "default-bold-small") 
guiLabelSetColor(GiveAdmin.label[1], 255, 0, 0) 
GiveAdmin.gridlist[1] = guiCreateGridList(9, 51, 294, 236, false, GiveAdmin.Window[1]); 
guiGridListAddColumn(GiveAdmin.gridlist[1], "#", 0.2) 
guiGridListAddColumn(GiveAdmin.gridlist[1], "الرتبة", 0.2); 
guiGridListAddColumn(GiveAdmin.gridlist[1], "القروب", 0.2); 
guiGridListAddColumn(GiveAdmin.gridlist[1], "السكور", 0.2); 
  
GiveAdmin.button[1] = guiCreateButton(18, 302, 115, 26, "شراء الرتبة", false, GiveAdmin.Window[1]); 
guiSetFont(GiveAdmin.button[1], "default-bold-small"); 
guiSetProperty(GiveAdmin.button[1], "NormalTextColour", "FFF5FF00"); 
  
  
GiveAdmin.button[2] = guiCreateButton(186, 302, 115, 26, "اغلاق", false, GiveAdmin.Window[1]); 
guiSetFont(GiveAdmin.button[2], "default-bold-small"); 
guiSetProperty(GiveAdmin.button[2], "NormalTextColour", "FFF5FF00"); 
  
  
  
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,1,255,255,0); 
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,2,0,255,0) 
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,3,255,255,0); 
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,4,0,255,0); 
guiSetFont(GiveAdmin.gridlist[1],"default-bold-small"); 
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); 
     triggerServerEvent("restartAdmin", localPlayer) 
  else 
  outputChatBox("* الرجاء اختيار رتبةة !",255,0,0,true); 
  end 
end 
addEventHandler("onClientGUIClick",GiveAdmin.button[1],xMainFunctions_,false); 
  
xCloseFunctions_ = function ( ) 
    guiSetVisible (GiveAdmin.Window[1], false ) 
    showCursor ( false ) 
end 
addEventHandler("onClientGUIClick",GiveAdmin.button[2],xCloseFunctions_,false); 
  
  
Markers ={ 
{202.15210,  1882.76294 , 17.64806}, 
{356.09140,  -2084.93506,  2.30000} 
} 
for i,v in ipairs (Markers) do 
    marker = createMarker(v[1], v[2], v[3] -1, "cylinder", 2, 255,0,0,255) 
end 
  
  
addEventHandler ( "onClientMarkerHit", resourceRoot, 
function ( player ) 
    if player == localPlayer then 
    guiSetVisible (GiveAdmin.Window[1], true ) 
    showCursor ( true ) 
    end 
end 
) 
  

السيرفر

xAddToGroupFunction_ = function ( Group,Price,Name ) 
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("** لديك هذهـ الرتبة فعـلا  ! ",source,255,0,0,true); end 
if ( getElementData(source, "Zombie kills") >= tonumber(Price))  then 
    aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); 
    outputChatBox("** تم شراء الرتبة بـ نجاحح | "..Name.." | ",source,0,255,0,true); 
 addEventHandler("restartAdmin", root, restartAdmin) 
local res = getResourceFromName ( "admin" ) 
if getResourceState(res) == "running" then 
    restartResource(res) 
end 
  
 else 
 outputChatBox("لا تملك السكور الكافي",source,255,0,0,true); 
     end 
  end 
addEvent("Accept:the:request",true) 
addEventHandler("Accept:the:request",root,xAddToGroupFunction_) 
  
addEvent("restartAdmin",true) 
function restartAdmin( ) 
     restartResource( getResourceFromName( script ) )  -- script = اسم المود 
end 
  

Link to comment
اذا قصدك ريستارت للاعب معين ،
  
triggerServerEvent( "event", yourPlayer ) 
restartResource 
  

هذا الي فهمته من كلامك ، و ياريت توضح اذا مو كذا

#Edit

جرب كذا

الكلينت

  
  
local Admin = { 
{"Level_1","Level_1","100"}, 
{"Level_2","Level_2","250"}, 
{"Level_3","Level_3","500"}, 
{"Level_4","Level_4","1250"}, 
  
{"Level_5","Level_5","3000"}, 
{"Leader","Leader","5000"}, 
{"HeadLeaDer","HeadLeaDer","8000"}, 
{"ADMIN","ADMIN","15000"}, 
  
{"HEAD-ADMIN","HEAD-ADMIN","10000"}, 
{"SuPeR-ADMIN","SuPeR-ADMIN","20000"}, 
{"BIG-ADMIN","BIG-ADMIN","35000"}, 
{"GA-1","GA-1","42000"}, 
{"GA-2","GA-2","50000"}, 
{"GM-1","GM-1","75000"}, 
{"GM-2","GM-2","105000"}, 
  
{"SUPPORT","SUPPORT","120000"}, 
{"ProAdmin","ProAdmin","130000"}, 
{"cOwner","cOwner","155000"}, 
} 
  
---------------------- 
-- 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, 310, 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", "FF0383FB"); 
  
GiveAdmin.label[1] = guiCreateLabel(8, 19, 411, 33, "مرحبا بك في نظام شراء الرتب الرجاء اختيار الرتبة ادناهـ :", false, GiveAdmin.Window[1]); 
guiSetFont(GiveAdmin.label[1], "default-bold-small") 
guiLabelSetColor(GiveAdmin.label[1], 255, 0, 0) 
GiveAdmin.gridlist[1] = guiCreateGridList(9, 51, 294, 236, false, GiveAdmin.Window[1]); 
guiGridListAddColumn(GiveAdmin.gridlist[1], "#", 0.2) 
guiGridListAddColumn(GiveAdmin.gridlist[1], "الرتبة", 0.2); 
guiGridListAddColumn(GiveAdmin.gridlist[1], "القروب", 0.2); 
guiGridListAddColumn(GiveAdmin.gridlist[1], "السكور", 0.2); 
  
GiveAdmin.button[1] = guiCreateButton(18, 302, 115, 26, "شراء الرتبة", false, GiveAdmin.Window[1]); 
guiSetFont(GiveAdmin.button[1], "default-bold-small"); 
guiSetProperty(GiveAdmin.button[1], "NormalTextColour", "FFF5FF00"); 
  
  
GiveAdmin.button[2] = guiCreateButton(186, 302, 115, 26, "اغلاق", false, GiveAdmin.Window[1]); 
guiSetFont(GiveAdmin.button[2], "default-bold-small"); 
guiSetProperty(GiveAdmin.button[2], "NormalTextColour", "FFF5FF00"); 
  
  
  
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,1,255,255,0); 
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,2,0,255,0) 
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,3,255,255,0); 
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,4,0,255,0); 
guiSetFont(GiveAdmin.gridlist[1],"default-bold-small"); 
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); 
     triggerServerEvent("restartAdmin", localPlayer) 
  else 
  outputChatBox("* الرجاء اختيار رتبةة !",255,0,0,true); 
  end 
end 
addEventHandler("onClientGUIClick",GiveAdmin.button[1],xMainFunctions_,false); 
  
xCloseFunctions_ = function ( ) 
    guiSetVisible (GiveAdmin.Window[1], false ) 
    showCursor ( false ) 
end 
addEventHandler("onClientGUIClick",GiveAdmin.button[2],xCloseFunctions_,false); 
  
  
Markers ={ 
{202.15210,  1882.76294 , 17.64806}, 
{356.09140,  -2084.93506,  2.30000} 
} 
for i,v in ipairs (Markers) do 
    marker = createMarker(v[1], v[2], v[3] -1, "cylinder", 2, 255,0,0,255) 
end 
  
  
addEventHandler ( "onClientMarkerHit", resourceRoot, 
function ( player ) 
    if player == localPlayer then 
    guiSetVisible (GiveAdmin.Window[1], true ) 
    showCursor ( true ) 
    end 
end 
) 
  

السيرفر

xAddToGroupFunction_ = function ( Group,Price,Name ) 
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("** لديك هذهـ الرتبة فعـلا  ! ",source,255,0,0,true); end 
if ( getElementData(source, "Zombie kills") >= tonumber(Price))  then 
    aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); 
    outputChatBox("** تم شراء الرتبة بـ نجاحح | "..Name.." | ",source,0,255,0,true); 
 addEventHandler("restartAdmin", root, restartAdmin) 
local res = getResourceFromName ( "admin" ) 
if getResourceState(res) == "running" then 
    restartResource(res) 
end 
  
 else 
 outputChatBox("لا تملك السكور الكافي",source,255,0,0,true); 
     end 
  end 
addEvent("Accept:the:request",true) 
addEventHandler("Accept:the:request",root,xAddToGroupFunction_) 
  
addEvent("restartAdmin",true) 
function restartAdmin( ) 
     restartResource( getResourceFromName( script ) )  -- script = اسم المود 
end 
  

مافيه شي اسمه تشغيل مود او اطفائه للاعب معين

المود اذ طفى بيطفي للكل

واذ اشتغل نفس الشي

يمديه يعدل على الادمنية ويسوي كم شي بالسيرفر والكلنت

Link to comment
اذا قصدك ريستارت للاعب معين ،
  
triggerServerEvent( "event", yourPlayer ) 
restartResource 
  

هذا الي فهمته من كلامك ، و ياريت توضح اذا مو كذا

#Edit

جرب كذا

الكلينت

  
  
local Admin = { 
{"Level_1","Level_1","100"}, 
{"Level_2","Level_2","250"}, 
{"Level_3","Level_3","500"}, 
{"Level_4","Level_4","1250"}, 
  
{"Level_5","Level_5","3000"}, 
{"Leader","Leader","5000"}, 
{"HeadLeaDer","HeadLeaDer","8000"}, 
{"ADMIN","ADMIN","15000"}, 
  
{"HEAD-ADMIN","HEAD-ADMIN","10000"}, 
{"SuPeR-ADMIN","SuPeR-ADMIN","20000"}, 
{"BIG-ADMIN","BIG-ADMIN","35000"}, 
{"GA-1","GA-1","42000"}, 
{"GA-2","GA-2","50000"}, 
{"GM-1","GM-1","75000"}, 
{"GM-2","GM-2","105000"}, 
  
{"SUPPORT","SUPPORT","120000"}, 
{"ProAdmin","ProAdmin","130000"}, 
{"cOwner","cOwner","155000"}, 
} 
  
---------------------- 
-- 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, 310, 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", "FF0383FB"); 
  
GiveAdmin.label[1] = guiCreateLabel(8, 19, 411, 33, "مرحبا بك في نظام شراء الرتب الرجاء اختيار الرتبة ادناهـ :", false, GiveAdmin.Window[1]); 
guiSetFont(GiveAdmin.label[1], "default-bold-small") 
guiLabelSetColor(GiveAdmin.label[1], 255, 0, 0) 
GiveAdmin.gridlist[1] = guiCreateGridList(9, 51, 294, 236, false, GiveAdmin.Window[1]); 
guiGridListAddColumn(GiveAdmin.gridlist[1], "#", 0.2) 
guiGridListAddColumn(GiveAdmin.gridlist[1], "الرتبة", 0.2); 
guiGridListAddColumn(GiveAdmin.gridlist[1], "القروب", 0.2); 
guiGridListAddColumn(GiveAdmin.gridlist[1], "السكور", 0.2); 
  
GiveAdmin.button[1] = guiCreateButton(18, 302, 115, 26, "شراء الرتبة", false, GiveAdmin.Window[1]); 
guiSetFont(GiveAdmin.button[1], "default-bold-small"); 
guiSetProperty(GiveAdmin.button[1], "NormalTextColour", "FFF5FF00"); 
  
  
GiveAdmin.button[2] = guiCreateButton(186, 302, 115, 26, "اغلاق", false, GiveAdmin.Window[1]); 
guiSetFont(GiveAdmin.button[2], "default-bold-small"); 
guiSetProperty(GiveAdmin.button[2], "NormalTextColour", "FFF5FF00"); 
  
  
  
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,1,255,255,0); 
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,2,0,255,0) 
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,3,255,255,0); 
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,4,0,255,0); 
guiSetFont(GiveAdmin.gridlist[1],"default-bold-small"); 
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); 
     triggerServerEvent("restartAdmin", localPlayer) 
  else 
  outputChatBox("* الرجاء اختيار رتبةة !",255,0,0,true); 
  end 
end 
addEventHandler("onClientGUIClick",GiveAdmin.button[1],xMainFunctions_,false); 
  
xCloseFunctions_ = function ( ) 
    guiSetVisible (GiveAdmin.Window[1], false ) 
    showCursor ( false ) 
end 
addEventHandler("onClientGUIClick",GiveAdmin.button[2],xCloseFunctions_,false); 
  
  
Markers ={ 
{202.15210,  1882.76294 , 17.64806}, 
{356.09140,  -2084.93506,  2.30000} 
} 
for i,v in ipairs (Markers) do 
    marker = createMarker(v[1], v[2], v[3] -1, "cylinder", 2, 255,0,0,255) 
end 
  
  
addEventHandler ( "onClientMarkerHit", resourceRoot, 
function ( player ) 
    if player == localPlayer then 
    guiSetVisible (GiveAdmin.Window[1], true ) 
    showCursor ( true ) 
    end 
end 
) 
  

السيرفر

xAddToGroupFunction_ = function ( Group,Price,Name ) 
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("** لديك هذهـ الرتبة فعـلا  ! ",source,255,0,0,true); end 
if ( getElementData(source, "Zombie kills") >= tonumber(Price))  then 
    aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); 
    outputChatBox("** تم شراء الرتبة بـ نجاحح | "..Name.." | ",source,0,255,0,true); 
 addEventHandler("restartAdmin", root, restartAdmin) 
local res = getResourceFromName ( "admin" ) 
if getResourceState(res) == "running" then 
    restartResource(res) 
end 
  
 else 
 outputChatBox("لا تملك السكور الكافي",source,255,0,0,true); 
     end 
  end 
addEvent("Accept:the:request",true) 
addEventHandler("Accept:the:request",root,xAddToGroupFunction_) 
  
addEvent("restartAdmin",true) 
function restartAdmin( ) 
     restartResource( getResourceFromName( script ) )  -- script = اسم المود 
end 
  

مافيه شي اسمه تشغيل مود او اطفائه للاعب معين

المود اذ طفى بيطفي للكل

واذ اشتغل نفس الشي

يمديه يعدل على الادمنية ويسوي كم شي بالسيرفر والكلنت

يقدر يسويها ب التريقر

مع حدث كلنت ويسوي ريستارس المود للاعب معين

لانه مع حدث كلنت ^

Link to comment
اذا قصدك ريستارت للاعب معين ،
  
triggerServerEvent( "event", yourPlayer ) 
restartResource 
  

هذا الي فهمته من كلامك ، و ياريت توضح اذا مو كذا

#Edit

جرب كذا

الكلينت

  
  
local Admin = { 
{"Level_1","Level_1","100"}, 
{"Level_2","Level_2","250"}, 
{"Level_3","Level_3","500"}, 
{"Level_4","Level_4","1250"}, 
  
{"Level_5","Level_5","3000"}, 
{"Leader","Leader","5000"}, 
{"HeadLeaDer","HeadLeaDer","8000"}, 
{"ADMIN","ADMIN","15000"}, 
  
{"HEAD-ADMIN","HEAD-ADMIN","10000"}, 
{"SuPeR-ADMIN","SuPeR-ADMIN","20000"}, 
{"BIG-ADMIN","BIG-ADMIN","35000"}, 
{"GA-1","GA-1","42000"}, 
{"GA-2","GA-2","50000"}, 
{"GM-1","GM-1","75000"}, 
{"GM-2","GM-2","105000"}, 
  
{"SUPPORT","SUPPORT","120000"}, 
{"ProAdmin","ProAdmin","130000"}, 
{"cOwner","cOwner","155000"}, 
} 
  
---------------------- 
-- 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, 310, 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", "FF0383FB"); 
  
GiveAdmin.label[1] = guiCreateLabel(8, 19, 411, 33, "مرحبا بك في نظام شراء الرتب الرجاء اختيار الرتبة ادناهـ :", false, GiveAdmin.Window[1]); 
guiSetFont(GiveAdmin.label[1], "default-bold-small") 
guiLabelSetColor(GiveAdmin.label[1], 255, 0, 0) 
GiveAdmin.gridlist[1] = guiCreateGridList(9, 51, 294, 236, false, GiveAdmin.Window[1]); 
guiGridListAddColumn(GiveAdmin.gridlist[1], "#", 0.2) 
guiGridListAddColumn(GiveAdmin.gridlist[1], "الرتبة", 0.2); 
guiGridListAddColumn(GiveAdmin.gridlist[1], "القروب", 0.2); 
guiGridListAddColumn(GiveAdmin.gridlist[1], "السكور", 0.2); 
  
GiveAdmin.button[1] = guiCreateButton(18, 302, 115, 26, "شراء الرتبة", false, GiveAdmin.Window[1]); 
guiSetFont(GiveAdmin.button[1], "default-bold-small"); 
guiSetProperty(GiveAdmin.button[1], "NormalTextColour", "FFF5FF00"); 
  
  
GiveAdmin.button[2] = guiCreateButton(186, 302, 115, 26, "اغلاق", false, GiveAdmin.Window[1]); 
guiSetFont(GiveAdmin.button[2], "default-bold-small"); 
guiSetProperty(GiveAdmin.button[2], "NormalTextColour", "FFF5FF00"); 
  
  
  
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,1,255,255,0); 
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,2,0,255,0) 
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,3,255,255,0); 
guiGridListSetItemColor(GiveAdmin.gridlist[1],row,4,0,255,0); 
guiSetFont(GiveAdmin.gridlist[1],"default-bold-small"); 
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); 
     triggerServerEvent("restartAdmin", localPlayer) 
  else 
  outputChatBox("* الرجاء اختيار رتبةة !",255,0,0,true); 
  end 
end 
addEventHandler("onClientGUIClick",GiveAdmin.button[1],xMainFunctions_,false); 
  
xCloseFunctions_ = function ( ) 
    guiSetVisible (GiveAdmin.Window[1], false ) 
    showCursor ( false ) 
end 
addEventHandler("onClientGUIClick",GiveAdmin.button[2],xCloseFunctions_,false); 
  
  
Markers ={ 
{202.15210,  1882.76294 , 17.64806}, 
{356.09140,  -2084.93506,  2.30000} 
} 
for i,v in ipairs (Markers) do 
    marker = createMarker(v[1], v[2], v[3] -1, "cylinder", 2, 255,0,0,255) 
end 
  
  
addEventHandler ( "onClientMarkerHit", resourceRoot, 
function ( player ) 
    if player == localPlayer then 
    guiSetVisible (GiveAdmin.Window[1], true ) 
    showCursor ( true ) 
    end 
end 
) 
  

السيرفر

xAddToGroupFunction_ = function ( Group,Price,Name ) 
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("** لديك هذهـ الرتبة فعـلا  ! ",source,255,0,0,true); end 
if ( getElementData(source, "Zombie kills") >= tonumber(Price))  then 
    aclGroupAddObject (aclGetGroup( tostring(Group)),"user."..account); 
    outputChatBox("** تم شراء الرتبة بـ نجاحح | "..Name.." | ",source,0,255,0,true); 
 addEventHandler("restartAdmin", root, restartAdmin) 
local res = getResourceFromName ( "admin" ) 
if getResourceState(res) == "running" then 
    restartResource(res) 
end 
  
 else 
 outputChatBox("لا تملك السكور الكافي",source,255,0,0,true); 
     end 
  end 
addEvent("Accept:the:request",true) 
addEventHandler("Accept:the:request",root,xAddToGroupFunction_) 
  
addEvent("restartAdmin",true) 
function restartAdmin( ) 
     restartResource( getResourceFromName( script ) )  -- script = اسم المود 
end 
  

مافيه شي اسمه تشغيل مود او اطفائه للاعب معين

المود اذ طفى بيطفي للكل

واذ اشتغل نفس الشي

يمديه يعدل على الادمنية ويسوي كم شي بالسيرفر والكلنت

يقدر يسويها ب التريقر

مع حدث كلنت ويسوي ريستارس المود للاعب معين

لانه مع حدث كلنت ^

:lol::lol::lol:

لو سويت الف شي راح يحدث المود للكل

مافي طريقة الفنكشن كذا سيرفر

لو فيه للاعب لحالة كان حط ارقمنت للاعب

فهمت علي الحين

طيب روح جرب :shock:

Link to comment
ياخي خلاص ياجماعه ، تنطيل قال مافيه يعني مافيه

لازم تتهاوشون

تنطيل مساعدهم في الويكي وكذا لازم نحترمه : )

أي هواش ذا نقاش

و أي ويكي ذا منتدى

و أي احترام تتحدث عنه

انا بهذا الرد ما أشوف أي احترام منك :)

جرب كذا

كلينت

addEventHandler("onClientPlayerJoin", root, 
function() 
       Elplayer = localPlayer 
       setTimer( hour24, 1000, 0) 
end ) 
  
function hour24 (  ) 
     s = s+1 
     if s == 60 then 
         s=0 
        m= m+ 1 
     end 
     if m == 60 then 
        m = 0 
        h = h + 1 
     end 
    setElementData( Elplayer, "sec", s ) 
    setElementData( Elplayer, "min", m ) 
    setElementData( Elplayer, "hour", h ) 
    if getElementData( Elplayer, "hour" ) == 24 then 
       triggerServerEvent( "onHour24", root, Elplayer ) 
       h = 0  
    return s 
    end 
end 

سيرفر

  
money = 1000 -- تقدر تغير الفلوس من هنا 
  
addEvent("onHour24", true) 
addEventHandler("onHour24", root, 
function ( Elplayer ) 
     givePlayerMoney( Elplayer, money ) 
     outputChatBox(getPlayerName( Elplayer ), root, 255,0,0,true) 
end    ) 
  

( ماني مجرب الاكواد )

كودك ماله معنى

لاتنشب لي بكل موضوع اشارك به

لا اهفك بالجوال بجبهتك

هذا كودي وهذي مشاركتي ، عندك شي حطه ولا اسكت ولا تزعجنا

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...