King12 Posted July 3, 2013 Share Posted July 3, 2013 السلام عليكم حبيت آستفسر عن مثال لسكربت : انه الشخص اذا كتب /sound /sound1 الامر الاول يطلع صوت للناس كلهم اللي بالسيرفر + ويطلع كلام بالشات واذا كتب الامر الثاني نفس الشي بس بصوت ثاني , بس اتمنى يكون بطريقه اسهل يعني يفضل لو يكون table على ما اضن علشان تسهل العمليه وآهم شي لما يخلص الصوت يعني تنتهي مدته يقفل خلاص , يعني مايقعد يعيد كل شوي آتمنى مثال Link to comment
iPrestege Posted July 3, 2013 Share Posted July 3, 2013 addCommandHandler triggerClientEvent getRootElement -- Client playSound isElement destroyElement Link to comment
PaiN^ Posted July 3, 2013 Share Posted July 3, 2013 addCommandHandler - tirggerClientEvent - isElement - stopSound - playSound - Link to comment
King12 Posted July 3, 2013 Author Share Posted July 3, 2013 -- Client Side PlaySoundFunction_ = function ( ) if isElement(theSound) then destroyElement(theSound) theSound = false end theSound = playSound("sound1.mp4",true); end addEvent("PlaySound",true); addEventHandler("PlaySound",root,PlaySoundFunction_); StopSoundFunction_ = function ( ) if isElement(theSound) then destroyElement(theSound) theSound = false end end addEvent("StopSound",true); addEventHandler("StopSound",root,StopSoundFunction_); -- Server Side CheckTheMsgFunction_ = function (theCmd) if ( theCmd == "sound" ) then triggerClientEvent("PlaySound",root); elseif ( theCmd == "stopS" ) then if isObjectInACLGroup ("user."..getAccountName ( getPlayerAccount ( source ) ), aclGetGroup ( "Admin" ) ) then triggerClientEvent("StopSound",root) end end end addEventHandler("onPlayerCommand",root,CheckTheMsgFunction_); سويت هذا قبل فتره , بس مافيه طريقه آسهل ؟ لآنه معقد كل شوي لازم انسخ نفس الفنكشن واعدل داخله علشان يضبط وحوسه طبعا الكود فيه نواقص ( حاذفها بنفسي علشان نفتك من السرقه )! Link to comment
iPrestege Posted July 3, 2013 Share Posted July 3, 2013 ^ الكود انا اذكر سويتة لك -_-" ذآ ذذ .. عموما مالنا بـ الطويلة تقدر تسوية كذآ .. local vCommandLoader = { { 'Command','Path' }, { 'Command','Path' }, { 'Command','Path' }, { 'Command','Path' }, { 'Command','Path' }, { 'Command','Path' }, { 'Command','Path' }, { 'Command','Path' } } 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 [ 1 ] ) elseif ( vCmd == 'stopS' ) then triggerClientEvent ( 'vSoundStopHandler',root ); end; end; end; end ); 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
King12 Posted July 3, 2013 Author Share Posted July 3, 2013 ضبطت حركتك ماتقصر بس انا ابي لما يكتب مثلاً sound1 يطلع كلام بالشات انا احدده ولما يكتب sound يطلع كلام بالشات انا حدده وياليت الكود يدعم الالوان هذي #FF0000 Link to comment
./BlackBird# Posted July 3, 2013 Share Posted July 3, 2013 ^ الكود انا اذكر سويتة لك -_-" ذآ ذذ .. عموما مالنا بـ الطويلة تقدر تسوية كذآ .. local vCommandLoader = { { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' } } 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 ] ) elseif ( vCmd == 'stopS' ) then triggerClientEvent ( 'vSoundStopHandler',root ); end; end; end; end ); 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
King12 Posted July 3, 2013 Author Share Posted July 3, 2013 طريقتك ضبطت وطلع الكلام بس ماقدرت الونه زي كذا #FF0000 + تقدر تضيف للكود انه بآخر الكلام اللي اكتبه يطلع اسم اللاعب اللي كتب الامر ؟ Link to comment
./BlackBird# Posted July 3, 2013 Share Posted July 3, 2013 طريقتك ضبطت وطلع الكلام بس ماقدرت الونه زي كذا#FF0000 + تقدر تضيف للكود انه بآخر الكلام اللي اكتبه يطلع اسم اللاعب اللي كتب الامر ؟ اخوي مافي شي جاهز تعلم Link to comment
iPrestege Posted July 3, 2013 Share Posted July 3, 2013 ضيف متغير الاعب و الوان r,g,b,true < Color code! Link to comment
jafar Posted July 3, 2013 Share Posted July 3, 2013 bool outputChatBox ( string text [, element visibleTo=getRootElement(), int r=231, int g=217, int b=176, bool colorCoded=false ] ) Link to comment
King12 Posted July 3, 2013 Author Share Posted July 3, 2013 bool outputChatBox ( string text [, element visibleTo=getRootElement(), int r=231, int g=217, int b=176, bool colorCoded=false ] ) وش الكود ذا مافهمته O_o قصدي مادري وين احطه >< Link to comment
#Al-Ha[J]aRii Posted July 3, 2013 Share Posted July 3, 2013 bool outputChatBox ( string text [, element visibleTo=getRootElement(), int r=231, int g=217, int b=176, bool colorCoded=false ] ) وش الكود ذا مافهمته O_o قصدي مادري وين احطه >< هذه مو كود هذه انت تسويه Link to comment
iPrestege Posted July 3, 2013 Share Posted July 3, 2013 local vCommandLoader = { { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' } } 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 ) elseif ( vCmd == 'stopS' ) then triggerClientEvent ( 'vSoundStopHandler',root ); end; end; end; end ); الحين يصير يقبل Link to comment
King12 Posted July 3, 2013 Author Share Posted July 3, 2013 مشكور ماقصرت بس هل راح يطلع اسم اللاعب اللي كتب الامر ؟ يعني sound started by King12 معليش تعبتك معي بقوه >< Link to comment
iPrestege Posted July 3, 2013 Share Posted July 3, 2013 outputChatBox ( 'Sound Has Been Started By '..getPlayerName ( source )..' ',root,255,255,255,true ) Link to comment
King12 Posted July 3, 2013 Author Share Posted July 3, 2013 يصير كذا ؟ local vCommandLoader = { { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' }, { 'Command','Path','msg' } } 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 ( 'Sound Has Been Started By '..getPlayerName ( source )..' ',root,255,255,255,true ) elseif ( vCmd == 'stopS' ) then triggerClientEvent ( 'vSoundStopHandler',root ); end; end; end; end ); Link to comment
King12 Posted July 4, 2013 Author Share Posted July 4, 2013 ماضبط الكود عجزت اخليه يطلع اسم اللاعب Link to comment
King12 Posted July 4, 2013 Author Share Posted July 4, 2013 -- Server Side! local vCommandLoader = { { 'bla','Sound/bukbuk.mp3','[sounds]blabla Sound Has Been Started By '..getPlayerName(thePlayer)..' '} } 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 ) elseif ( vCmd == 'stopS' ) then triggerClientEvent ( 'vSoundStopHandler',root ); end; end; end; end ); Link to comment
iPrestege Posted July 4, 2013 Share Posted July 4, 2013 -- Server Side! local vCommandLoader = { { 'bla','Sound/bukbuk.mp3','Sound'} } 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 ); حط هذا هنا لانة الاعب ماهو معرف جرب كذآ ! Link to comment
King12 Posted July 4, 2013 Author Share Posted July 4, 2013 الشي هذا يشتغل على امر واحد يعني ما اقدر اضيف اوامر بس اقدر اعرف الاوت بوت شات بوكس ؟ اعرف = حرف الراء بالشده ( علشان تفهمني ^^ ) د هذي كلمة blabla ابدلها لـ ..text.. ..text.. = الكلام اللي اكتبه فوق Link to comment
iPrestege Posted July 4, 2013 Share Posted July 4, 2013 كيف اوامر؟ الا تقدر ضيف بالتيبل .. قصدك تسوي متغير مثل كذآ ؟ local Text = 'Hello Woovie!' outputChatBox ( Text ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now