Jump to content

كيف أصلح


Sparrow

Recommended Posts

إنها لا تدمر مركبة

function destroyVeh() 
    local theVehicle = getPedOccupiedVehicle (localPlayer) 
    if (theVehicle) then 
        destroyElement (theVehicle) 
        outputChatBox("Your vehicle has been destroyed.", 0, 255, 0) 
        guiSetVisible(window, false) 
        showCursor(false) 
    else 
        outputChatBox("You aren't in a vehicle.", 255, 0, 0) 
        guiSetVisible(window, false) 
        showCursor(false) 
    end 
end 
addEventHandler("onClientGUIClick", destroyButton, destroyVeh, false) 

Link to comment

Server:

addEvent("destroyVehicle",true) 
addEventHandler("destroyVehicle",root,function(vehicle) 
destroyElement(vehicle) 
end) 

Client:

function destroyVeh() 
    local theVehicle = getPedOccupiedVehicle (localPlayer) 
    if (theVehicle) then 
        triggerServerEvent("destroyVehicle",localPlayer,theVehicle) 
        outputChatBox("Your vehicle has been destroyed.", 0, 255, 0) 
        guiSetVisible(window, false) 
        showCursor(false) 
    else 
        outputChatBox("You aren't in a vehicle.", 255, 0, 0) 
        guiSetVisible(window, false) 
        showCursor(false) 
    end 
end 
addEventHandler("onClientGUIClick", destroyButton, destroyVeh, false) 

Link to comment

Server

 ccc  
addEvent("buyBommcar", true) 
addEventHandler("buyBommcar", rootElement, 
function() 
       if ( getPlayerMoney (source) >= 2000000 ) then 
        takePlayerMoney(source, 2000000) 
        outputChatBox("All cars Is Boom", source, 255, 255, 0, true) 
        vehicles = getElementsByType ( "vehicle" ) 
for vehicleKey, vehicleValue in ipairs(vehicles) do 
    blowVehicle ( vehicleValue ) 
end      
      else 
        outputChatBox("Not enough money.", source, 255, 0, 0, true) 
    end 
  end 
) 
  

Link to comment

إنها لا تعمل

local vehicles = {} 
function spawnVeh(model) 
    local x, y, z = getElementPosition(source) 
    local rot = getPedRotation(source) 
    local theVehicle = createVehicle (model, x, y, z, 0, 0, rot) 
    if isElement(vehicles[source]) then destroyElement(vehicles[source]) end 
    warpPedIntoVehicle(source,theVehicle) 
end 
addEvent("onGUIClick",true) 
addEventHandler("onGUIClick",root,spawnVeh) 

Link to comment
local vehicles = {} 
function spawnVeh(model) 
    local x, y, z = getElementPosition(source) 
    local rot = getPedRotation(source) 
    if isElement(vehicles[source]) then destroyElement(vehicles[source]) end 
    local vehicles[source] = createVehicle (model, x, y, z, 0, 0, rot) 
    warpPedIntoVehicle(source,vehicles[source]) 
end 
addEvent("onGUIClick",true) 
addEventHandler("onGUIClick",root,spawnVeh) 
  
addEventHandler("onPlayerQuit",root, 
function() 
     if isElement(vehicles[source]) then 
          destroyElement(vehicles[source]) 
          vehicles[source] = nil 
     end 
end) 

Link to comment

~_~

local vehicles = {} 
function spawnVeh(model) 
    local x, y, z = getElementPosition(source) 
    local rot = getPedRotation(source) 
    if isElement(vehicles[source]) then destroyElement(vehicles[source]) end 
    vehicles[source] = createVehicle (model, x, y, z, 0, 0, rot) 
    warpPedIntoVehicle(source,vehicles[source]) 
end 
addEvent("onGUIClick",true) 
addEventHandler("onGUIClick",root,spawnVeh) 
  
addEventHandler("onPlayerQuit",root, 
function() 
     if isElement(vehicles[source]) then 
          destroyElement(vehicles[source]) 
          vehicles[source] = nil 
     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...