Jump to content

عند ابضغط على الصورة يصير سباون وعنده سيارة


Recommended Posts

addEventHandler ( "onClientGUIClick", root, 
    function ( ) 
        theData = getElementData ( localPlayer, "theSound" ) 
        if source == driftImage then 
            triggerServerEvent ( "setTeam", localPlayer, "drift" ) 

عندما يضغط على الصورة يصير سباون وعنده سيارة

Link to comment

جرب ذا

-- Client Side --

addEventHandler("onClientGUIClick",root, 
    function () 
        if ( source == picname ) then 
            triggerServerEvent("onGetVeh",localPlayer) 
        end 
    end 
) 

-- Server Side --

addEvent("onGetVeh",true) 
addEventHandler("onGetVeh",root, 
    function () 
        local x,y,z = getElementPosition(source) 
        local veh = createVehicle(411,x,y,z) 
        warpPedIntoVehicle(source,veh) 
    end 
) 

Link to comment
جرب ذا

-- Client Side --

addEventHandler("onClientGUIClick",root, 
    function () 
        if ( source == picname ) then 
            triggerServerEvent("onGetVeh",localPlayer) 
        end 
    end 
) 

-- Server Side --

addEvent("onGetVeh",true) 
addEventHandler("onGetVeh",root, 
    function () 
        local x,y,z = getElementPosition(source) 
        local veh = createVehicle(411,x,y,z) 
        warpPedIntoVehicle(source,veh) 
    end 
) 

شلون اخليه اذا طلع من السيارة السيارة تنفجر وهو يموت عشان لا يصير لااق في السيرفر

Link to comment
vehicles = getElementsByType ( "vehicle" ) 
for vehicleKey, vehicleValue in ipairs(vehicles) do 
    blowVehicle ( vehicleValue ) 
end 
addEventHandler ( "onPlayerVehicleExit", getRootElement(), vehicle ) 

اعتقد كذا

local vehicles = getPedOccupiedVehicle ( source ) 
function doBlow ( source ) 
    blowVehicle (vehicles) 
end 
addEventHandler ( "onPlayerVehicleExit", getRootElement(), doBlow) 

Edited by Guest
Link to comment

سو وظيفة و حط لها اسم

  
function BLOW ( )  
  

وش اللي تبيه يصير حطه داخل الوظيفة

  
function BLOW ( ) 
    blowVehicle ( ) 
  

كذا الكود ناقص اي سيارة يفجرها ؟؟

  
function BLOW ( ) 
    blowVehicle ( getPedOccupiedVehicle ( source ) ) 
  

و ننهي الوظيفة بـ كلمة end

  
function BLOW ( ) 
    blowVehicle ( getPedOccupiedVehicle ( source ) ) 
end 
  

طيب هالحين نبي شيء يشغلها متى تنفجر السيارة ؟؟

  
function BLOW ( ) 
    blowVehicle ( getPedOccupiedVehicle ( source ) ) 
end 
addEventHandler ( "onPlayerVehicleEnter", root, BLOW ) 
  

root حنا استخدمنا

يعني اي سيارة راح تخرج منها تنفجر

Link to comment
if source == hajlwlaImage then 
            triggerServerEvent ( "setTeam", localPlayer, "hajlwla" ) 
            if theData then 
                destroyElement ( theData ) 
            end 
            theSound = playSound ( "1.mp3" ) 
            setElementData ( localPlayer, "theSound", theSound )        
            VisibleOff ( ) 
  

+

addEventHandler("onClientGUIClick",root, 
    function () 
        if ( source == hajlwlaImage ) then 
            triggerServerEvent("onGetVeh",localPlayer) 
        end 
    end 
) 

انا ابغي ان اذا طلع من السيارة تنفجر وتختفي بعد ما تتفجر

Link to comment
addEvent("onGetVeh",true) 
addEventHandler("onGetVeh",root, 
    function () 
        local x,y,z = getElementPosition(source) 
        local veh = createVehicle(411,x,y,z) 
        warpPedIntoVehicle(source,veh) 
          
blowVehicle ( getPedOccupiedVehicle ( source ) ) 
  
addEventHandler ( "onPlayerVehicleExit", root, veh ) 
  
    end 
) 

ذا اول ماضغط على الصورة تنفجر

Link to comment
addEvent("onGetVeh",true) 
addEventHandler("onGetVeh",root, 
    function () 
        local x,y,z = getElementPosition(source) 
        local veh = createVehicle(411,x,y,z) 
        warpPedIntoVehicle(source,veh) 
          
blowVehicle ( getPedOccupiedVehicle ( source ) ) 
  
addEventHandler ( "onPlayerVehicleExit", root, veh ) 
  
    end 
) 

اذا طلع اللعب من اي سياره يسوي عنده سياره ويركبها ويفجرها

Link to comment

try

-- Server Side--

addEventHandler("onVehicleExplode",root,function () 
    setTimer(destroyElement,100,1,source) 
end) 
  
addEventHandler ( "onPlayerVehicleExit",getRootElement(),function(player) 
    local team = getTeamFromName("Test") 
    local teamp = getPlayerTeam(player) 
        if ( teamp == team ) then 
            blowVehicle ( getPedOccupiedVehicle (player) ) 
        end 
end) 
  
function xcreateTeam() 
    NewTeam = createTeam ( "Test", 0, 255, 0 ) 
end 
addEventHandler("onResourceStart", resourceRoot, xcreateTeam)  
  
addEvent("SetTeamAndGiveCar", true) 
function v() 
    setPlayerTeam(source, NewTeam) 
    local x,y,z = getElementPosition(source) 
    local veh = createVehicle(411,x,y,z) 
    warpPedIntoVehicle(source,veh) 
end  
addEventHandler("SetTeamAndGiveCar", rootElement, v) 

--Client Side--

button = guiCreateButton(...) 
  
addEventHandler("onClientGUIClick",guiRoot,function() 
    if source == button then 
triggerServerEvent("SetTeamAndGiveCar", localPlayer) 
    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...