Jump to content

مطلوب كود


ALw7sH

Recommended Posts

اذا ضغطت على زر تجي سيارة

كلنت

addEventHandler ("onClientGUIClick", getRootElement(), 
  
function(button, state, absoluteX, absoluteY) 
  
if ( source ==  اسم الزر ) then  
  
triggerServerEvent("car",getLocalPlayer())  
end  
  
end  
) 

سيرفر

vehicle = {} 
  
addEvent("car", true) 
addEventHandler("car", root, 
function() 
      if (getPlayerMoney (source) >= 0) then 
        takePlayerMoney(source, 0) 
        if isElement(vehicle[source]) then destroyElement(vehicle[source]) end 
        local x, y, z = getElementPosition(source) 
        vehicle[source] = createVehicle(id , x, y, z) 
        warpPedIntoVehicle(source, vehicle[source]) 
    end 
  end 
) 

Link to comment
اذا ضغطت على زر تجي سيارة

كلنت

addEventHandler ("onClientGUIClick", getRootElement(), 
  
function(button, state, absoluteX, absoluteY) 
  
if ( source ==  اسم الزر ) then  
  
triggerServerEvent("car",getLocalPlayer())  
end  
  
end  
) 

سيرفر

vehicle = {} 
  
addEvent("car", true) 
addEventHandler("car", root, 
function() 
      if (getPlayerMoney (source) >= 0) then 
        takePlayerMoney(source, 0) 
        if isElement(vehicle[source]) then destroyElement(vehicle[source]) end 
        local x, y, z = getElementPosition(source) 
        vehicle[source] = createVehicle(id , x, y, z) 
        warpPedIntoVehicle(source, vehicle[source]) 
    end 
  end 
) 

اذا اظغط على الزر مايصير شي

Link to comment
اذا ضغطت على زر تجي سيارة

كلنت

addEventHandler ("onClientGUIClick", getRootElement(), 
  
function(button, state, absoluteX, absoluteY) 
  
if ( source ==  اسم الزر ) then  
  
triggerServerEvent("car",getLocalPlayer())  
end  
  
end  
) 

سيرفر

vehicle = {} 
  
addEvent("car", true) 
addEventHandler("car", root, 
function() 
      if (getPlayerMoney (source) >= 0) then 
        takePlayerMoney(source, 0) 
        if isElement(vehicle[source]) then destroyElement(vehicle[source]) end 
        local x, y, z = getElementPosition(source) 
        vehicle[source] = createVehicle(id , x, y, z) 
        warpPedIntoVehicle(source, vehicle[source]) 
    end 
  end 
) 

اذا اظغط على الزر مايصير شي

كود خرابيص >< ديستوري للالمنت ؟ قبل مايسوي السيارهـ ؟

ذذ

:

بسوي لك الكود بسس بسيط ^^ وانت كمل التيمات ..الخ

Client :

function Car() 
    if ( source == Button ) then 
  
      triggerServerEvent("Car",localPlayer) 
    end 
end  
addEventHandler( "onClientGUIClick", root, Car ) 

Server :

addEvent( "Car", true) 
addEventHandler( "Car", root, 
    function ()              
        x,y,z = getElementPosition ( source ) 
        vehicle = createVehicle ( id, x, y, z ) 
        warpPedIntoVehicle ( source, vehicle ) 
    end 
) 

Link to comment

راح تتكرر السياره يمديك تخليه يقدر يطلع وحده فقط

-- Server Side

Veh = {} 
addEvent("Car",true) 
addEventHandler("caprs",root,function() 
    if Veh[source] then 
        if isElement(Veh[source]) then 
            destroyElement(Veh[source]) 
        end 
    end 
    local x,y,z = getElementPosition(source) 
    Veh[source] = createVehicle(id,x,y,z)       
    warpPedIntoVehicle(source,Veh[source]) 
end) 

Link to comment
راح تتكرر السياره يمديك تخليه يقدر يطلع وحده فقط

-- Server Side

Veh = {} 
addEvent("Car",true) 
addEventHandler("caprs",root,function() 
    if Veh[source] then 
        if isElement(Veh[source]) then 
            destroyElement(Veh[source]) 
        end 
    end 
    local x,y,z = getElementPosition(source) 
    Veh[source] = createVehicle(id,x,y,z)       
    warpPedIntoVehicle(source,Veh[source]) 
end) 

caprs :?

+

الكود حقي شغال -_-

Link to comment
راح تتكرر السياره يمديك تخليه يقدر يطلع وحده فقط

-- Server Side

Veh = {} 
addEvent("Car",true) 
addEventHandler("Car",root,function() 
    if Veh[source] then 
        if isElement(Veh[source]) then 
            destroyElement(Veh[source]) 
        end 
    end 
    local x,y,z = getElementPosition(source) 
    Veh[source] = createVehicle(id,x,y,z)       
    warpPedIntoVehicle(source,Veh[source]) 
end) 

كذا صح

:lol::lol::lol:

Link to comment

طلبكـ الأول , فتح النافذة لتيم معين عند لمس المآركر ,

-- Client Side !

VisibleM = createMarker ( x, y, z, "cylinder", size, r, g, b, alpha ) 
  
addEventHandler ( "onClientMarkerHit", VisibleM, 
    function ( hitPlayer ) 
        if getElementType ( hitPlayer ) == "player" and getPlayerTeam ( hitPlayer ) and getPlayerTeam ( hitPlayer ) == getTeamFromName ( "NameTeam" ) then 
            guiSetVisible ( Wnd, true ) 
            showCursor ( true ) 
        else 
            outputChatBox ( "* You must be in 'Name Team' !", 210, 0, 0, true ) 
        end 
    end 
) 
  
addEventHandler ( "onClientMarkerLeave", VisibleM, 
    function ( leavePlayer ) 
        if getElementType ( leavePlayer ) == "player" then 
            guiSetVisible ( Wnd, false ) 
            showCursor ( false ) 
        end 
    end 
) 

الإستبدآل ,

السطر الأول :

x, y, z = الإحداثيات

size = الحجم حق الدائرة

r, g, b = (0-255) الألوان تقدر تحط كل واحده منها بين

^ 255, 120, 0 : مثآل

alpha = (0-255) الشفافية : يعني مدى وضوح الدائرة وتقدر تحطه بين

السطر الخامس :

NameTeam = اسم التيم الي تبي النافذة تفتح له فقط !

السطر السادس :

Wnd = اسم النافذة

السطر التاسع :

Name Team = اسم التيم , عشآن لما يكون اللاعب مهو بالتيم يجيه بالشات انه لازم يكون بالتيم المحدد !

السطر 17 :

Wnd = اسم النافذة

===========================

طلبكـ الثآني , إذا ضغطت على الزر تجيكـ سيآرة

-- Client Side !

addEventHandler( "onClientGUIClick", اسم الزر, 
    function ( ) 
        triggerServerEvent ( "CreateVehicle", localPlayer ) 
    end 
) 

-- ServerSide !

Vehicles = {} 
addEvent ( "CreateVehicle", true ) 
addEventHandler ( "CreateVehicle", root, 
    function ( ) 
        if Vehicles[source] then 
            destroyElement( Vehicles[source] ) 
        end 
        local x,y,z = getElementPosition( source ) 
        Vehicles[source] = createVehicle ( ID, x, y, z ) 
        if Vehicles[source] then 
            warpPedIntoVehicle( source, Vehicles[source] ) 
        end 
    end 
) 

^ الإستبدال في السطر التاسع فقط ,

ID = رقم السيارة , واذا تبي تعرف ارقام السيارات + انواعها ادخل هنا : https://wiki.multitheftauto.com/wiki/Vehicle_IDs

===========================

طلبكـ الثآلث والأخير , لما يموت اللاعب تنسحب السيآرة منه !

-- Server Side !

addEventHandler( "onPlayerWasted", root, 
    function( ) 
        if Vehicles[source] then 
            destroyElement( Vehicles[source] ) 
        end 
    end 
) 

Link to comment

بالنسبه لـ ذا

addEventHandler( "onPlayerWasted", root, 
    function( ) 
        if Vehicles[source] then 
            destroyElement( Vehicles[source] ) 
        end 
    end 
) 

اذا تبيه مع كود السياره بس الصقه كذا

اما اذا تبيه لحاله خليه كذا

  
Vehicles = {} 
addEventHandler( "onPlayerWasted", root, 
    function( ) 
        if Vehicles[source] then 
            destroyElement( Vehicles[source] ) 
        end 
    end 
) 

Link to comment
الكود حقك شغال لاكن وش دخل الفلوس بالموضوع ! هذا يدل على انه الكود مو حقك زآرفه, وبعدين ترا خطأي نصي كلمة وحدة

هذا حاطه بشوب ونسيت ماحذفته "-_-

Link to comment
بالنسبه لـ ذا
addEventHandler( "onPlayerWasted", root, 
    function( ) 
        if Vehicles[source] then 
            destroyElement( Vehicles[source] ) 
        end 
    end 
) 

اذا تبيه مع كود السياره بس الصقه كذا

اما اذا تبيه لحاله خليه كذا

  
Vehicles = {} 
addEventHandler( "onPlayerWasted", root, 
    function( ) 
        if Vehicles[source] then 
            destroyElement( Vehicles[source] ) 
        end 
    end 
) 

^ أقول لا تعفس بالأكواد بس , افهم طلباته ثم تعال -_-"

Link to comment
بالنسبه لـ ذا
addEventHandler( "onPlayerWasted", root, 
    function( ) 
        if Vehicles[source] then 
            destroyElement( Vehicles[source] ) 
        end 
    end 
) 

اذا تبيه مع كود السياره بس الصقه كذا

اما اذا تبيه لحاله خليه كذا

  
Vehicles = {} 
addEventHandler( "onPlayerWasted", root, 
    function( ) 
        if Vehicles[source] then 
            destroyElement( Vehicles[source] ) 
        end 
    end 
) 

^ أقول لا تعفس بالأكواد بس , افهم طلباته ثم تعال -_-"

:lol::lol::lol:

Link to comment
انت مبدع بصراحه
addEventHandler( "onPlayerWasted", root, 
    function( ) 
        if Vehicles[source] then 
            destroyElement( Vehicles[source] ) 
        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...