Jump to content

x[طلب]x


Recommended Posts

سلآم عليكم

آبي ككود يحذف سيارةة اللاعب اذا بيآخذ سيآأرةة ثآنيةةء

يعني ..

اذا معههء سيآرةة وتركهآ ورآح بياخذ وحدةة ثآنيةة من المآركر يحذف القديمةة وينزلههء الجديدةة :]

@#_iMr.[E]coo

 

Edited by #F9SoOoL
Link to comment
-- client side

function markers ()
  car1 = createMarker (928.70001220703, -2168, 12, 'cylinder', 3, 255, 0, 0, 255)
  end
addEventHandler("onClientResourceStart", getRootElement(), markers)

function carss (thePlayer)
if ( source == car1 ) and ( getElementData(thePlayer, 'Group') == 'root' ) and not isPedInVehicle(thePlayer) then

carwnd1 = guiCreateWindow(182, 81, 429, 425, "Choose a Car .. !", false)
guiWindowSetSizable(carwnd1, false)

buf = guiCreateButton(9, 35, 122, 44, "Buffalo", false, carwnd1)
inf = guiCreateButton(10, 96, 122, 44, "Infernus", false, carwnd1)
    showCursor(true)
end
end
addEventHandler("onClientMarkerHit", getRootElement(), carss)


addEventHandler("onClientGUIClick", getRootElement(), function()
if source == buf then
triggerServerEvent ("buff", getLocalPlayer())
guiSetVisible(carwnd1,false)
showCursor(false)
end
end)


-- server side

addEvent("buff",true)
addEventHandler("buff", root, 
function ()
x,y,z = getElementPosition( source )
buffalo = createVehicle (402, x-7, y, z+1)
warpPedIntoVehicle(source,buffalo)
addVehicleUpgrade (buffalo, 1010)
end)

 

Link to comment
local vehicle = { } 

addEvent("buff",true)
addEventHandler("buff", root, 
function ()
if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end 
x,y,z = getElementPosition( source )
vehicle[source] = createVehicle (402, x-7, y, z+1)
warpPedIntoVehicle(source,vehicle[source])
addVehicleUpgrade (vehicle[source], 1010)
end)

 

Link to comment
50 minutes ago, #_iMr.[E]coo said:

local vehicle = { } 

addEvent("buff",true)
addEventHandler("buff", root, 
function ()
if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end 
x,y,z = getElementPosition( source )
vehicle[source] = createVehicle (402, x-7, y, z+1)
warpPedIntoVehicle(source,vehicle[source])
addVehicleUpgrade (vehicle[source], 1010)
end)

 

ممكن تسويلي مثال ع اكثر من سيآرةة لآهنت

@#_iMr.[E]coo

Edited by #F9SoOoL
Link to comment
6 minutes ago, #F9SoOoL said:

ممكن تسويلي مثال ع اكثر من سيآرةة لآهنت

@#_iMr.[E]coo

بدك ضيف سيارات اخري ؟

 
local vehicle = { } 

addEvent("buff",true)
addEventHandler("buff", root, 
function ()
if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end 
x,y,z = getElementPosition( source )
vehicle[source] = createVehicle (402,400,420,410,405, x-7, y, z+1)
warpPedIntoVehicle(source,vehicle[source])
addVehicleUpgrade (vehicle[source], 1010)
end)

@#F9SoOoL

Link to comment
11 minutes ago, #F9SoOoL said:

ممكن تسويلي مثال ع اكثر من سيآرةة لآهنت

@#_iMr.[E]coo

local vehicle = { } 
local CarNumber = 0
addEvent("buff",true)
addEventHandler("buff", root, 
function ()
--if isElement ( vehicle[source] ) then destroyElement ( vehicle[source] ) end 
x,y,z = getElementPosition( source )
CarNumber = CarNumber + 1;
vehicle[source][CarNumber] = createVehicle (402, x-7, y, z+1)
warpPedIntoVehicle(source,vehicle[source][CarNumber])
addVehicleUpgrade (vehicle[source][CarNumber], 1010)
end)

 

Edited by iMr.WiFi..!
Link to comment

جرب سوي كذا 

local vehicle = { } 

addEvent("buff",true)
addEventHandler("buff", root, 
function ()
if #vehicle[source] == 2 then 
destroyElement ( vehicle[source] )
end 
x,y,z = getElementPosition( source )
vehicle[source] = createVehicle (402, x-7, y, z+1)
warpPedIntoVehicle(source,vehicle[source])
addVehicleUpgrade (vehicle[source], 1010)
end)

 

Link to comment
Just now, #_iMr.[E]coo said:

جرب سوي كذا 


local vehicle = { } 

addEvent("buff",true)
addEventHandler("buff", root, 
function ()
if #vehicle[source] == 2 then 
destroyElement ( vehicle[source] )
end 
x,y,z = getElementPosition( source )
vehicle[source] = createVehicle (402, x-7, y, z+1)
warpPedIntoVehicle(source,vehicle[source])
addVehicleUpgrade (vehicle[source], 1010)
end)

 

على حسب ظني ماراح يزبط

لأنك بدلت القيمة 

كأنك سويت كذا

Car = 1

ثم بدلته

Car = 2

يعني ماسويت شيء ذذ

 

Link to comment

local vehicle = { } 

addEvent("buff",true)
addEventHandler("buff", root, 
function ()
vevehicle[source] = vehicle[source] + 1
if #vehicle[source] == 2 then 
destroyElement ( vehicle[source] )
end 
x,y,z = getElementPosition( source )
vehicle[source] = createVehicle (402, x-7, y, z+1)
warpPedIntoVehicle(source,vehicle[source])
addVehicleUpgrade (vehicle[source], 1010)
end)

كذا يزبط

Link to comment
18 hours ago, #_iMr.[E]coo said:

local vehicle = { } 

addEvent("buff",true)
addEventHandler("buff", root, 
function ()
vevehicle[source] = vehicle[source] + 1
if #vehicle[source] == 2 then 
destroyElement ( vehicle[source] )
end 
x,y,z = getElementPosition( source )
vehicle[source] = createVehicle (402, x-7, y, z+1)
warpPedIntoVehicle(source,vehicle[source])
addVehicleUpgrade (vehicle[source], 1010)
end)

كذا يزبط

ERROR: root\ms.lua:6: attempt to perform arithmetic on field '?'(a nil value)

Link to comment
14 minutes ago, #BrosS said:

بدل سطر 7 ب

vehicle[source]

vevehicle اقصد 

بدلتها نفس المشكلةة ,, م يححذف الموتر الققديم ..

وآزيدك من الششعر ببيت ؟

المموتر ذذ صآر م ينزل ..

Edited by #F9SoOoL
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...