Jump to content

طلب كود


MJNON

Recommended Posts

Posted

السلام عليكم

ابي كوود الى هو مثل اذا كتبت في الشات "ابي سياره" الشخص الي كتب في الشات يعطيه سياره

والسلام

Posted

وعليكم السلام

سوي جدول وحط فيه الكلمات الي تبيها

وسوي لوب

+

استخدم هذي الاكواد

string.find 
getElementPosition 
createVehicle 
warpPedIntoVehicle 
Posted
addEventHandler ( "onPlayerChat",root, 
    function ( msg, msgType )  
        if ( msg == "الكلام الذي تريده يكتبه بالشات ويعطيه" and msgType == 0 ) then 
  
        end 
    end 
) 
  

warpPedIntoVehicle 
createVehicle 
Posted

^ اظن انه يبي يبحث مثلا واحد كاتب ابي سيارة سريع كذا ذذ

vehicle = {} 
  
addEventHandler('onPlayerChat',root,function(msg) 
    if string.find(msg,'ابي سيارة') then 
        if isElement(vehicle[source]) then destroyElement(vehicle[source]) end 
            vehicle[source] = createVehicle(455,unpack({getElementPosition(source)})) 
                warpPedIntoVehicle(source,vehicle[source]) 
        end 
    end 
) 
Posted

الطريقة غير مجربة **

سويت لك كود يسهل عملية طلبك

وهو ان وجد الكلمة راح ينفذ الإيفنت

Words = {  
    ["ابي سيارة"] = "onOrderVehicle"; 
    ["ابي سلاح"] = "onOrderWeapon"; 
   --[ "Word" ] = "Event"; 
}; 
  
addEventHandler ( "onPlayerChat", root, 
    function ( msg, type ) 
        if type == 0 then 
            for word, event in pairs ( Words ) do 
                if string.find ( msg, tostring(word) ) then 
                    triggerEvent ( tostring(event), source ) 
                end 
            end 
        end 
    end 
) 

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

Vehicles = { }; 
addEvent ( "onOrderVehicle", true ) 
addEventHandler ( "onOrderVehicle", root, 
    function ( ) 
        local x, y, z = getElementPosition ( source ) 
        if Vehicles[source] then 
            if isElement ( Vehicles[source] ) then 
                destroyElement ( Vehicles[source] ) 
            end 
            Vehicles[source] = nil 
        end 
        Vehicles[source] = createVehicle ( math.random ( 400, 611 ), x, y+1, z+1 ) 
        setTimer ( warpPedIntoVehicle, 100, 1, source, Vehicles[source] ) 
    end 
) 
  
addEvent ( "onOrderWeapon", true ) 
addEventHandler ( "onOrderWeapon", root, 
    function ( ) 
        giveWeapon ( source, math.random ( 22, 38 ), 60, true ) 
    end 
) 

  • 3 weeks later...
Posted
الطريقة غير مجربة **

سويت لك كود يسهل عملية طلبك

وهو ان وجد الكلمة راح ينفذ الإيفنت

Words = {  
    ["ابي سيارة"] = "onOrderVehicle"; 
    ["ابي سلاح"] = "onOrderWeapon"; 
   --[ "Word" ] = "Event"; 
}; 
  
addEventHandler ( "onPlayerChat", root, 
    function ( msg, type ) 
        if type == 0 then 
            for word, event in pairs ( Words ) do 
                if string.find ( msg, tostring(word) ) then 
                    triggerEvent ( tostring(event), source ) 
                end 
            end 
        end 
    end 
) 

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

Vehicles = { }; 
addEvent ( "onOrderVehicle", true ) 
addEventHandler ( "onOrderVehicle", root, 
    function ( ) 
        local x, y, z = getElementPosition ( source ) 
        if Vehicles[source] then 
            if isElement ( Vehicles[source] ) then 
                destroyElement ( Vehicles[source] ) 
            end 
            Vehicles[source] = nil 
        end 
        Vehicles[source] = createVehicle ( math.random ( 400, 611 ), x, y+1, z+1 ) 
        setTimer ( warpPedIntoVehicle, 100, 1, source, Vehicles[source] ) 
    end 
) 
  
addEvent ( "onOrderWeapon", true ) 
addEventHandler ( "onOrderWeapon", root, 
    function ( ) 
        giveWeapon ( source, math.random ( 22, 38 ), 60, true ) 
    end 
) 

اخوي عناد كيف يعني اخلي الإيفنت بمود و الجدول بمود

Posted

يعني اسوي مودين علشان يشتغل مود الي فيه الجدول لازم اشغل مود الي فيه الايفنت

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