Jump to content

طلب كود


i,xAhmed

Recommended Posts

^

+

string.find 

مآ يحتاج , لأن الحدث onPlayerChat

فيه برامتر إسمه msg ..

فاهم غلط ,, وظيفة الكود هو يبحث عن الكلمة بشكل دقيق

مثلا لو استخدمت الكود بدون string.find

واللاعب كتب " ابي موتر " ما راح يجيه لكن اذا كتب " موتر " راح يجيه

ف اذا استعملها وكتب " ابي موتر " راح يجيه الموتر

^

Link to comment

فاهم غلط ,, وظيفة الكود هو يبحث عن الكلمة بشكل دقيق

مثلا لو استخدمت الكود بدون string.find

واللاعب كتب " ابي موتر " ما راح يجيه لكن اذا كتب " موتر " راح يجيه

ف اذا استعملها وكتب " ابي موتر " راح يجيه الموتر

^

إدري عن وظيفتها ..

لكن الأخ صاحب الموضوع قال إذا كتبت بالتحديد " موتر " تجيني السياره

يعني ما قال ودهـ إذا كتب ابي موتر يجيني موتر بعد ذذ

يعني بهاته الحاله string.find ما لها داعي

ننتظر محاولتك أخي الكريم

:wink:

^

Link to comment
  
addEventHandler( "onPlayerChat",root,function ( msg ) 
if ( msg == "موتر" ) then 
local x,y,z = getElementPosition ( source ) 
local xMyCar = createVehicle( 500,x + 3,y,z ) 
warpPedIntoVehicle ( source, xMyCar ) 
outputChatBox("Welcome To Your Car !",source,255,255,0,true) 
end 
end) 
  

Link to comment

local TableV = {}; 
local ID = 605                  --- أيدي السيارة 
  
addEventHandler( "onPlayerChat", root, function ( msg ) 
  if ( msg and msg == "موتر" ) then 
     if isElement(TableV[source]) then destroyElement(TableV[source]) end 
     local x, y, z = getElementPosition ( source ) 
     TableV[source] = createVehicle( ID, x + 3, y, z ) 
      if ( TableV[source] ) then 
                warpPedIntoVehicle ( source, TableV[source] ) 
                outputChatBox("** You Have Get Vehicle .",source,255,255,0,true) 
              end 
         end 
  end 
) 
  
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...