Jump to content

طلب # مهم


Recommended Posts

Posted

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

# عندي كوود اذا اللاعب ضغط على زر يطلع له كلام في الشات اذا كان عنده رتبة معينه

# لاكن مااعرف ليه مب شغال

addEventHandler ( "onClientGUIClick", getRootElement() , 
function () 
if source == button3 then 
    outputChatBox("#",255,255,255,true) 
if ( isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( players ) ), aclGetGroup ( "xS" ) ) ) then 
    outputChatBox("Start",255,255,255,true)  
end   
end 
 end 
)   

##--------- هذا كان الطلب الاول

# الطلب الثاني ________--

سويت لوحة شات لكن لما اكتب في اللوحة مايظهر الكلام للي فاتح اللوحة مثلي

# وش المشكلة ؟؟

Posted (edited)
if ( isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( players ) ), aclGetGroup ( "xS" ) ) ) then 

هذا كله سيرفر وانت حاطه كلنت سوي ترايقر وكمل بالسيرفر

+

اطرح الكود الثاني

Edited by Guest
Posted
if ( isObjectInACLGroup ( "user."..getAccountName ( getPlayerAccount ( players ) ), aclGetGroup ( "xS" ) ) ) then 

هذا كله سيرفر وانت حاطه كلنت سوي ترايقر وكمل بالسيرفر

+

اطرح الكود الثاني

اللوحة

 edit_ = {} 
  
    wnd = guiCreateWindow(30, 50, 695, 429, "Support ", false)  
        guiWindowSetSizable(wnd, false) 
        guiSetAlpha(wnd, 1.00) 
        guiSetProperty(wnd, "CaptionColour", "FF0CFF00") 
        guiSetVisible(wnd, false)    
    edit = guiCreateEdit(1,375,363,33,'', false, wnd) 
    memo = guiCreateMemo(4,25,463,335,'', false, wnd) 
        guiMemoSetReadOnly(memo, true)   
    button1 = guiCreateButton(50,100,90,30, "Send | إرسال", false, wnd) 
        guiSetFont(button1, "default-bold-small") 
        guiSetProperty(button1, "NormalTextColour", "FF5FFE00")  
    button2 = guiCreateButton(658,21,27,25, "X", false, wnd) 
        guiSetFont(button2, "default-bold-small") 
        guiSetProperty(button2, "NormalTextColour", "FFFD0000")  
    img1 = guiCreateStaticImage(10,21,181,190, "img/sup.png", false, wnd) 
    img2 = guiCreateStaticImage(10,218,207,111, "img/Supp.png", false, wnd)  
  
  
showCursor( false ) 

#برمجة الشات لما يكتب

addEventHandler ( "onClientGUIClick", resourceRoot, function (    ) 
   if ( source == button1 ) then 
        if ( getElementData ( localPlayer, "GroupData" ) ) then 
        table.insert(edit_, "[ Support ] : "..guiGetText(edit).."") 
        else 
        table.insert(edit_, getPlayerName ( localPlayer )..": "..guiGetText(edit).."") 
        end 
        if #guiGetText(memo) == 1 then 
            guiSetText(memo,table.concat(edit_,' ')) 
            guiSetText( edit, "" ) 
     else 
            guiSetText(memo,table.concat(edit_,'\n')) 
            guiSetText( edit, "" ) 
       end 
   end 
end ) 

Posted

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

getElementsByType( "player" ) 

وتسوي تحقق للي عندهـ الالمنت يسوي ترايقر للكلنت وتخليه يسوي

guiSetText 

Posted
طيب جرب سوي المنت للي فـتح الوحه يجي عليه واذا سكرها يروح وتسوي ترايقر سيرفر وتسوي لوب تجيب فيه كل الاعبين السيرفر
getElementsByType( "player" ) 

وتسوي تحقق للي عندهـ الالمنت يسوي ترايقر للكلنت وتخليه يسوي

guiSetText 

# اولا مشكوور

الطلب الاول تم حله ##

لاكن مافهمت وش اسوي في الطلب الثاني #

Posted

وش تسوي ما ادري

! انا عطيتكـ الكود بالموضوع ذاكـ .. لين متى تبي تعتمد ع الناس وانت منت عارف فنكشنات سيرفر من كلنت

Posted

الطلب الثاني لازم تسوي ترايقر للسيرفر و ترسل فية الكلام و من ثم تسوي ترايقر للكلن و برضو ترسل فية الكلام

Posted
وش تسوي ما ادري

! انا عطيتكـ الكود بالموضوع ذاكـ .. لين متى تبي تعتمد ع الناس وانت منت عارف فنكشنات سيرفر من كلنت

# والله دايماا انسااا اني اشوف الالوان

Posted

وفالنفترض ما في منتدى ومافي النظام ذا وش بتسوي !

ما يحتاج يعني .. فنكشن معروف انه بجانب سيرفر .

ع العموم بالنسبة لمشكلتكـ يوم يضغط ارسل تريقر وارسل معاهـ المسج ومن ثم ارسل تريقر لكلنت مع المسج وسوي نفس الكود وخلاص .

Posted
وفالنفترض ما في منتدى ومافي النظام ذا وش بتسوي !

ما يحتاج يعني .. فنكشن معروف انه بجانب سيرفر .

ع العموم بالنسبة لمشكلتكـ يوم يضغط ارسل تريقر وارسل معاهـ المسج ومن ثم ارسل تريقر لكلنت مع المسج وسوي نفس الكود وخلاص .

# طيب كذا يرسل التريقر مع المسج الى السيرفر

# واذا كان صحيح كيف ارسله للكلنت

Client Side !!

addEventHandler ( "onClientGUIClick", getRootElement() , 
function () 
if source == button3 then 
    guiGetText(edit2) 
       triggerServerEvent ( "Message", localPlayer) 
end 
 end 
) 

Server Side !!

addEventHandler("onClientGUIClick",root, 
    function() 
    وش احط هنااا ؟؟ 
            triggerClientEvent(client,"Message",client) 
        end 
    end 
) 

Posted

addEventHandler ( "onClientGUIClick", resourceRoot, function (    ) 
   if ( source == button1 ) then 
    if ( guiGetText( edit ) == "" ) then return end 
       triggerServerEvent ( "msgToRoot", localPlayer, guiGetText( edit ) ) 
   end 
end ) 
  
addEvent ( "msgToClient", true ) 
addEventHandler ( "msgToClient", root, function (  msg  ) 
  if ( msg ) then 
    if ( getElementData ( localPlayer, "GroupData" ) ) then 
        table.insert(edit_, "[ Support ] : "..msg.."") 
    else 
        table.insert(edit_, getPlayerName ( localPlayer )..": "..msg.."") 
    end 
     if #guiGetText(memo) == 1 then 
            guiSetText(memo,table.concat(edit_,' ')) 
            guiSetText( edit, "" ) 
     else 
            guiSetText(memo,table.concat(edit_,'\n')) 
            guiSetText( edit, "" ) 
      end 
   end 
end )  

addEvent ( "msgToRoot", true ) 
addEventHandler ( "msgToRoot", root, function (  msg  ) 
  if ( msg ) then 
     triggerClientEvent ( root, "msgToClient", root, msg ) 
  end 
end ) 
Posted

كذا صح # ؟؟

Client Side !!

addEventHandler ( "onClientGUIClick", getRootElement() , 
function () 
if source == button3 then 
    outputChatBox("Restarted",255,255,255,true)  
       triggerServerEvent ( "S-S", localPlayer) 
end 
 end 
) 

Server Side !!

addEventHandler("onClientGUIClick",root, 
    function() 
            if getResourceState(res) == "running" then 
            restartResource(res) 
            triggerClientEvent(client,"S-S",client) 
       end 
    end 
)    

Posted
@# ZA7F = كيف تبي تشغل المود من نفس المود بعد ما تطفيه
restartResource 

restartResource امم .. صحيح ما فكرت بها .. لاكن نسيت فنكشن

وخلاص restartResource ع العموم يسوي زي ما قلت له ويستخدم

Posted

زاحف ليه مب شغال ذاا

كذا صح # ؟؟

Client Side !!

addEventHandler ( "onClientGUIClick", getRootElement() , 
function () 
if source == button3 then 
    outputChatBox("Restarted",255,255,255,true)  
       triggerServerEvent ( "S-S", localPlayer) 
end 
 end 
) 

Server Side !!

addEventHandler("onClientGUIClick",root, 
    function() 
            if getResourceState(res) == "running" then 
            restartResource(res) 
            triggerClientEvent(client,"S-S",client) 
       end 
    end 
)    

Posted
--- Server Side 
addEvent ( "S-S", true ) 
addEventHandler ( "S-S", root, function  () 
            if getResourceState(res) == "running" then 
            restartResource(res) 
       end 
    end 
)    
  

Posted

addEventHandler ( "onClientGUIClick", resourceRoot, function (    ) 
  if ( source == button3 ) then 
     triggerServerEvent ( "restartThisResource", localPlayer ) 
  end 
end ) 

addEvent ( "restartThisResource", true ) 
addEventHandler ( "restartThisResource", root, function (  ) 
    restartResource ( getThisResource (  ) ) 
end ) 

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