Mr.Mostafa Posted December 15, 2018 Share Posted December 15, 2018 سلام عليكم معي استفسار بخصوص onPlayerChat هل اقدر اسوي تحقق , ان اجيب الكلام الي بيكون بعد الرسالة ؟ يعني مثلا ابي لو كتبت رسالة بالشات test oca يعطيني فلوس لو كتبت test ocaa ينقص مني فلوس يعني التحقق يعتمد علي الكلمة التانية , هل اقدر اجيب الكلمة التانية؟ addEventHandler ( "onPlayerChat" , root , function ( Msg , Typ ) if ( Typ == 0 ) then if Msg == "" then end end end ) Link to comment
Mr.Mostafa Posted December 15, 2018 Author Share Posted December 15, 2018 4 minutes ago, NX_CI said: string.gsub مثال لاهنت Link to comment
nxFairlywell Posted December 15, 2018 Share Posted December 15, 2018 (edited) 39 minutes ago, Mr.Mostafa said: مثال لاهنت addEventHandler ( "onPlayerChat" , root , function ( Msg , Typ ) if ( Typ == 0 ) then msgBeforeChange = Msg Msg = string.gsub(Msg, "test ", '') if string.find(msgBeforeChange, "test ", 1) then if Msg == 'oca' then givePlayerMoney(source, 1) elseif Msg == 'ocaa' then takePlayerMoney(source, 1) end end end end ) Edited December 15, 2018 by NX_CI 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