Jump to content

مساعده في مود الترقيات


mR.Z

Recommended Posts

بسم الله الرحمن الرحيم

معي مود الرتب حق الاخ برتسيج

بس ابي اعدل عليه

مثلا اذا احد معه Admin-ex او مخالف مايقدر يترقى + الي اخذ ترقيه مايقدر يترقى الى بعد 5 ساعات مثلا

وشكرا

Link to comment

قصدك سيرفر ؟

تفضل

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

او على حسب الي فهمته منك !

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("* الرجاء اختيار رتبةة !",math.random(0,255),math.random(0,255),math.random(0,255)) 
  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_); 

شكرا على الرد السريع جنرال :$

Link to comment

استبدل هذا الفنكشن بَـ اللي عندك من اول

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

  
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('newEvent', localPlayer) 
   addEvent('onClick',true) 
   addEventHandler('onClick', root, function ( ) 
   triggerServerEvent("Accept:the:request",localPlayer,Group,Price,Name) 
    end ) ; 
  else 
  outputChatBox("* الرجاء اختيار رتبةة !",math.random(0,255),math.random(0,255),math.random(0,255)) 
  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_); 
  

ضيف هذا لملف السيرفر بدون ماتعدل ملف السيرفر

يعني اضافة بس

addEvent("newEvent",true) 
function checkGroup( ) 
    account = getAccountName(getPlayerAccount(source)) 
      if not ( isObjectInACLGroup("user."..account, aclGetGroup("Admin-ex") ) ) then 
        triggerClientEvent('onClick', source) 
  
      end 
end 
  
addEventHandler("newEvent", root, checkGroup) 

Link to comment

شكرا لك جنرال

بس فيه خطاء

اذا ضغطت ترقيه يطلع لي الكلام مكرر فوق 10 مرات ذذ

+ ابي يطلع له انه مخالف ولا يمكنه الترقيه

  
addEvent("newEvent",true) 
function checkGroup( ) 
    ACCOUNT = getAccountName(getPlayerAccount(source)) 
      if not ( isObjectInACLGroup("user."..ACCOUNT, aclGetGroup("ex") ) ) then 
        triggerClientEvent('onClick', source) 
 outputChatBox("** انت مخالف لايمكنك ان تترقى "..Name,source,math.random(0,255),math.random(0,255),math.random(0,255)) 
      end 
end 
  
addEventHandler("newEvent", root, checkGroup) 

ماضبط ذذ :roll:

Link to comment
شكرا لك جنرال

بس فيه خطاء

اذا ضغطت ترقيه يطلع لي الكلام مكرر فوق 10 مرات ذذ

+ ابي يطلع له انه مخالف ولا يمكنه الترقيه

  
addEvent("newEvent",true) 
function checkGroup( ) 
    ACCOUNT = getAccountName(getPlayerAccount(source)) 
      if not ( isObjectInACLGroup("user."..ACCOUNT, aclGetGroup("ex") ) ) then 
        triggerClientEvent('onClick', source) 
 outputChatBox("** انت مخالف لايمكنك ان تترقى "..Name,source,math.random(0,255),math.random(0,255),math.random(0,255)) 
      end 
end 
  
addEventHandler("newEvent", root, checkGroup) 

ماضبط ذذ :roll:

اممم

عندك ..Name

ماهي معرفه

Name = ???

لازم تعرفه او تستبدلها بـ

..getPlayerName(source)

EDIT# :

جرب كذا

  
addEvent("newEvent",true) 
function checkGroup( ) 
    ACCOUNT = getAccountName(getPlayerAccount(source)) 
    Name = getPlayerName(source) 
      if not ( isObjectInACLGroup("user."..ACCOUNT, aclGetGroup("ex") ) ) then 
        triggerClientEvent('onClick', source) 
      else 
 outputChatBox("** انت مخالف لايمكنك ان تترقى "..Name,source,math.random(0,255),math.random(0,255),math.random(0,255)) 
      end 
end 
  
addEventHandler("newEvent", root, checkGroup) 

Link to comment
حلو اخوي نفذت الي الطلب الاول مشكور والله مشكور بس باقي طلب :(

الي هوا ااذا اخذ رتبه مايقدر يترقى لمده 20 ساعه وبعدين يقدر

حياك الله حبيبي

setTimer( 
            function(  )  
                removeEventHandler('newEvent', root, checkGroup)  
                triggerClientEvent('onClick', source) 
           end, 60000*60*20, 1, true 
) 

ضيفها لملف السيرفر زي ماضفت الطلب الاول يعني اضافه وليس تعديل =)

Edited by Guest
Link to comment

إذا كان التايمر سيرفر

تخلي الفكشن كذا

function ( player )

player = يمديك تغيرها لـ اي متغير

+ لو كان كلنت

تخلي الفكشن فاضي وداخل الفكشنات تحط

localPlayer

لانها تكون معرفه ^

Link to comment
اول شي يقدر يطلع و يدخل و يروح الوقت و انتهيني ثاني شي

triggerClientEvent('onClick', source)

source = غير معرف

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

Link to comment

السورس بإختصار

هو المصدر الي صاير عنده الشيء

مثلا شوف هذا الحدث

onPlayerJoin

كاتب لك السورس هو اللاعب الي خش " بصفحة الويكي " ء

وواضحه اصلا مصدر الحدث هو اللاعب

واي حدث بالسيرفر يكون فيه

vehicle

المصدر هو المركبه الي صار عندها الحدث

Link to comment

الحين فهمني اولا انت مرسل تريقر للكلينت وحاط فيه اكواد سيرفر ,

كيف تجي ؟

انا ما احجر لك انا اوضح له اخطائك عشان تستفيد :)

ياخي امزح معك ,

و بالنسبه لل اول سطر من الي كتبته

انا مرسل ترايقر للكلينت

داخل حدث ترايقر من كلنت لسيرفر

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

function check( ) 
ACCOUNT = getAccountName(getPlayerAccount(source)) 
    if not ( isObjectInACLGroup("user."..ACCOUNT, aclGetGroup("Admin-ex") ) ) then 
       triggerClientEvent("onClick", source) 
     else 
          outputChatBox("انت مخالف ماتقدر ترقي نفسك *", source,255,255,255,true) 
         setTimer( function(  source  ) 
  triggerClientEvent("onClick", source) 
                 removeEventHandler("newEvent", root, check) end, 60000*60*20,1,true) 
                 
   end 
end) 
addEventHandler("newEvent", root, check) 
  
  
addEvent("newEvent",true) 

Edited by Guest
Link to comment
triggerClientEvent("onClick", source)

??

triggerClientEvent(source, "onClick", source)

+

removeEventHandler("newEvent", root, check)

??

وش ذي الرموز؟؟؟

بعدين الترايقر من سيرفر لكلنت

مو لازم اول ارقمنت ارجع للويكي وتأكد

triggerClientEvent ( [table/element sendTo=getRootElement()], string name, element sourceElement, [arguments...] ) 

اتمنى الي يبي يساعد الرجال بدون رموز

يكتب الخطأ ويصححه وبلاش الواحد يسوي نفسه فاهم

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