Jump to content

طلب كود لما يكتب كلام يطلع صوت للسيرفر كلهم


Recommended Posts

كيف اوامر؟ الا تقدر ضيف بالتيبل -_- ..

قصدك تسوي متغير مثل كذآ ؟

local Text = 'Hello Woovie!' 
   outputChatBox ( Text ) 

يب

قصدي من ناحية الاوامر ما اقدر اضيف اكثر من كوماند

حدي واحد الاول راح يشتغل

الثاني مايشتغل

Link to comment
  • Replies 53
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

بس شف هذا حاطه انت

                outputChatBox ( '[sounds]blabla Sound Has Been Started By  
  
 

هذا محدد للآمر الاول

اضفت امر ثاني وعيا يشتغل مايطلع شي

انا ابي اسوي متغير لـ هذي

blabla

واربطها بالـ message

فوق

Edited by Guest
Link to comment
ورني الكود مع الامرين كامل !
  
-- Server Side! 
local vCommandLoader = { 
      { 'bla','Sound/bukbuk.mp3','Sound'}, 
      { 'test','Sound/apologize.mp3','ss'} 
} 
addEventHandler('onPlayerCommand',root, 
    function ( vCmd ) 
     if isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( 'Admin' ) ) then 
        for index,value in ipairs ( vCommandLoader ) do 
            if ( vCmd == value [ 1 ] ) then 
                triggerClientEvent ( 'vSoundStartHandler',root,value [ 2 ] ); 
                outputChatBox ( value [ 3 ],source,255,255,255,true ) 
                outputChatBox ( '[sounds]blabla Sound Has Been Started By '..getPlayerName( source )..' ',root,255,255,255,true ) 
            elseif ( vCmd == 'stopS' ) then 
                triggerClientEvent ( 'vSoundStopHandler',root ); 
            end; 
        end; 
    end; 
end 
); 

  
-- Client Side! 
addEvent('vSoundStartHandler',true) 
addEventHandler('vSoundStartHandler',root, 
    function ( vPath ) 
            if vPath then 
                if isElement ( vSound ) then 
                    destroyElement ( vSound ); 
            end; 
                vSound = playSound ( vPath ); 
        end; 
    end 
); 
  
addEvent('vSoundStopHandler',true) 
addEventHandler('vSoundStopHandler',root, 
    function (  ) 
            if isElement ( vSound ) then 
               destroyElement ( vSound ); 
        end; 
    end 
); 

Link to comment
انت مسوي لة بالتيبل ؟

cmd,path,msg

!

مضبطها فوق وكل شي

بس عيت مشكلتها الكوماند الاول يشتغل

بس الثاني يعيي مايشتغل ولا يصير شي ><

بس قلت لك ماينفع اسوي متغير للمسج ؟

Link to comment

وهذا اللي صاير | = ؟ يطلع لكل كوماند كلمة

الاول

s

الثاني

Sound

الشات الثاني لانة محطوط كذا لاي كوماند ماتقدر تجيب اسم الاعب ممن التيبل بس تقدر تسوي للتيبل اضافة كلام وتجيب الاعب بمكان معين -_-

Link to comment

طيب و blabla

هذي تتغير ؟

لما اسوي الامر الثاني ؟

تعديل : جربت الامر الثاني عندي وماضبط

انا ابيه لكل كوماند فوق

يطلع له outputchatbox

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

Link to comment

local vCommandLoader = { 
      { 'bla','Sound/bukbuk.mp3','Sound1'}, 
      { 'blaa','Sound/apologize.mp3','Sound203'} 
} 
addEventHandler('onPlayerCommand',root, 
    function ( vCmd ) 
     if isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( 'Admin' ) ) then 
        for index,value in ipairs ( vCommandLoader ) do 
            if ( vCmd == value [ 1 ] ) then 
                triggerClientEvent ( 'vSoundStartHandler',root,value [ 2 ] ); 
                outputChatBox (value[ 3 ],source,255,255,255,true ) 
                outputChatBox ( '[sounds]blabla Sound Has Been Started By '..getPlayerName( source )..' ',root,255,255,255,true ) 
            elseif ( vCmd == 'stopS' ) then 
                triggerClientEvent ( 'vSoundStopHandler',root ); 
            end; 
        end; 
    end; 
end 
); 

لو كتبت الامر bla راح يطلع, - Sound1

ولو كتبت الامر blaa راح يطلع ,- Sound203

Link to comment
local vCommandLoader = { 
               { 'bla','Sound.wav','Sound1'}, 
               { 'blaa','Sound.wav','Sound203'} 
} 
addEventHandler('onPlayerCommand',root, 
    function ( vCmd ) 
     if isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( 'Admin' ) ) then 
        for index,value in ipairs ( vCommandLoader ) do 
            if ( vCmd == value [ 1 ] ) then 
                triggerClientEvent ( 'vSoundStartHandler',root,value [ 2 ] ); 
                outputChatBox (value[ 3 ],source,255,255,255,true ) 
                outputChatBox ( '[sounds]blabla Sound Has Been Started By '..getPlayerName( source )..' ',root,255,255,255,true ) 
            elseif ( vCmd == 'stopS' ) then 
                triggerClientEvent ( 'vSoundStopHandler',root ); 
            end; 
        end; 
    end; 
end 
); 

لو كتبت الامر bla راح يطلع, - Sound1

ولو كتبت الامر blaa راح يطلع ,- Sound203

ماقلت شي , بس قصدي ابيه الكلام يطلع يقبل اللون + يطلع اسم اللاعب

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