mouamle Posted September 26, 2014 Share Posted September 26, 2014 السلام عليكم ابي اسوي مود مثلا أذا واحد كتب بالشات حرب ينتقل لساحة الحرب وش أحتاج + شكرا مقدما Link to comment
Mr.SAUD Posted September 26, 2014 Share Posted September 26, 2014 addEventHandler('onPlayerChat',root, function(msg) if string.find(msg,'حرب') then setElementPosition(localPlayer,x,y,z) end end ) Link to comment
TAPL Posted September 26, 2014 Share Posted September 26, 2014 addEventHandler('onPlayerChat',root, function(msg) if string.find(msg,'حرب') then setElementPosition(localPlayer,x,y,z) end end ) localPlayer --> source Link to comment
mouamle Posted September 26, 2014 Author Share Posted September 26, 2014 addEventHandler('onPlayerChat',root, function(msg) if string.find(msg,'حرب') then setElementPosition(localPlayer,x,y,z) end end ) localPlayer --> source شكرا :* Link to comment
mouamle Posted September 26, 2014 Author Share Posted September 26, 2014 واذا ردت على اكثر من منطقة يعني واحد لساحة الحرب والثاني للمعرض Link to comment
فاّرس Posted September 26, 2014 Share Posted September 26, 2014 تقدر تسويها بطريقه بسيطه ... if string.find(msg,'حرب') then .... elseif string.find(msg,'المعرض') then .... end لأنه راح يبحث في الكلام الي كتبه اللاعب string.find انا من رأيي لا تستخدم بمعنى لو كتب جمله وكتب في الجمله كلمه حرب راح ينقله حتى لو كان ما يقصد انه يروح ... Link to comment
Mr.R Posted September 26, 2014 Share Posted September 26, 2014 هذا طلبكـ ... addEventHandler("onPlayerChat", root, function( msg ) -- حدث عند الكتابه في الشات + وظيفة باسم if string.find( msg,"حرب" ) then -- تحقق انه كتب في الشات حرب setElementPosition( source, x, y, z ) -- x,y,z حط الاحداثيات الي ينتقل لها بدال end -- اند الفنكشن end -- اند الاف ) -- قوس اغلاق الحدث واذا بتسوي اكثر من كلمه اذا كتبها ينتقل لـ مكان معين انصحكـ تستخدم طريقة مختصرهـ وهي elseif <-- @The Best مثل ماقال مثال ... if string.find( msg,"حرب" ) then -- تحقق انه كتب في الشات حرب elseif string.find( msg,"البدايه" ) then -- تحقق انه كتب في الشات البدايه end -- اند الاف elseif استخدم كـ طريقه مختصرهـ if <-- عشان اذا بتحط على كل مكان end <-- بتزيد معها الاند فقط شرح بسيط عشان تعرف تختصر ومايصير الكود هريسه اتمنى اني افدتك وافدت كل القارئين سلام : ) Link to comment
KING-_-HOHO Posted September 26, 2014 Share Posted September 26, 2014 تقدر تسويها بطريقه بسيطه ... if string.find(msg,'حرب') then .... elseif string.find(msg,'المعرض') then .... end لأنه راح يبحث في الكلام الي كتبه اللاعب string.find انا من رأيي لا تستخدم بمعنى لو كتب جمله وكتب في الجمله كلمه حرب راح ينقله حتى لو كان ما يقصد انه يروح ... find يقدر يستخدم ذآ بدآل addEventHandler("onPlayerChat" , root, function( msg ) -- وظيفة وداخل آلقوسين آرقمنت آلرسآلة if tostring(msg) == "حرب" then -- بدآل آلبحث نحط آذآ كآنت آلرسآلة حرب ينفله مثل مآ قآل ذآ بست setElementPosition( source, x, y, z ) -- x,y,z حط الاحداثيات الي ينتقل لها بدال end -- نهآية آلتحقق end -- نهآية آلوظيفة ) -- قوس إغلآق آلحدث Link to comment
Mr.SAUD Posted September 27, 2014 Share Posted September 27, 2014 addEventHandler('onPlayerChat',root, function(msg) if string.find(msg,'حرب') then setElementPosition(localPlayer,x,y,z) end end ) localPlayer --> source ما انتبهت , يسلمو Link to comment
فاّرس Posted September 27, 2014 Share Posted September 27, 2014 find يقدر يستخدم ذآ بدآل addEventHandler("onPlayerChat" , root, function( msg ) -- وظيفة وداخل آلقوسين آرقمنت آلرسآلة if tostring(msg) == "حرب" then -- بدآل آلبحث نحط آذآ كآنت آلرسآلة حرب ينفله مثل مآ قآل ذآ بست setElementPosition( source, x, y, z ) -- x,y,z حط الاحداثيات الي ينتقل لها بدال end -- نهآية آلتحقق end -- نهآية آلوظيفة ) -- قوس إغلآق آلحدث مالها اي فايده tostring الداله... message: A string representing the message typed into the chat. 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