☠ RaZeR ☠ Posted April 11, 2015 Share Posted April 11, 2015 (edited) هلا شباب : ليه مااشتغل ذا addEventHandler( "onPlayerWasted", getRootElement( ), function() if isElement(source) then setTimer( nk2 = createVehicle, 2000, 1, 350, unpack(posB[math.random(1,3)]) ) warpPedIntoVehicle ( source, nk2 ) setElementHealth ( nk2, 350 ) toggleControl ( source, "enter_exit", false ) end end ) Edited April 11, 2015 by Guest Link to comment
yazan Posted April 11, 2015 Share Posted April 11, 2015 local VehicleID = { 560,540 } local car = { } addEventHandler( "onPlayerWasted", root, function() if isElement ( car [ source ] ) then destroyElement ( car [ source ] ) end local ID = VehicleID[ math.random( #VehicleID ) ] local x,y,z = getElementPosition (source) car [ source ] = createVehicle ( ID, x, y, z ) if car [ source ] then warpPedIntoVehicle ( source, car [ source ] ) toggleControl ( source, "enter_exit", false ) end end end ) Link to comment
☠ RaZeR ☠ Posted April 11, 2015 Author Share Posted April 11, 2015 للاسف مااشتغل الديبوق يقول في مشكلة في السطر 16 و 5 Link to comment
The Killer Posted April 11, 2015 Share Posted April 11, 2015 وش تبي تسوي انت بالضبط ؟ Link to comment
☠ RaZeR ☠ Posted April 11, 2015 Author Share Posted April 11, 2015 لو واحد مات يوديه الاماكن العشوائية local posB = { {-102.37923, 2377.39893, 231.38014}, {-125.39194, 2493.71021, 231.63734}, {-119.94868, 2509.49927, 231.63800}, } local tank = createVehicle ( 432,unpack(posB[math.random(1,3)]) ) --- ينزل السيارة warpPedIntoVehicle ( source, tank )---- ينقل اللاعب داخلها setElementHealth ( tank, 350 )--- يغير حياة السيارة toggleControl ( source, "enter_exit", false )--- يمنع الدخول والخروج فيها الكوود كامل __ : local posB = { {-102.37923, 2377.39893, 231.38014}, -- المكان الاول {-125.39194, 2493.71021, 231.63734}, -- الثاني {-119.94868, 2509.49927, 231.63800}, -- الثالث } ------------ addEventHandler("onPlayerWasted", root, function() if isElement(source) then local tank = createVehicle ( 432,unpack(posB[math.random(1,3)]) ) warpPedIntoVehicle ( source, tank ) setElementHealth ( tank, 350 ) toggleControl ( source, "enter_exit", false ) end end) ليه مااشتغل Link to comment
The Killer Posted April 11, 2015 Share Posted April 11, 2015 تبيه اذا مات ينتقل للمكان الي فيه السياره ويكون راكب فيها ؟ Link to comment
☠ RaZeR ☠ Posted April 11, 2015 Author Share Posted April 11, 2015 يب بس ** setElementHealth ( tank, 350 )--- يغير حياة السيارة toggleControl ( source, "enter_exit", false )--- يمنع الدخول والخروج فيه Link to comment
The Killer Posted April 11, 2015 Share Posted April 11, 2015 local posB = { {-102.37923, 2377.39893, 231.38014}, {-125.39194, 2493.71021, 231.63734}, {-119.94868, 2509.49927, 231.63800} } local veh = { } addEventHandler("onPlayerWasted", root, function() if isElement (veh [source]) then destroyElement (veh [source]) veh [source] = nil end local pos = math.random(1, #posB) spawnPlayer (source, posB[pos][1], posB[pos][2], posB[pos][3], 0, getElementModel (source), 0, 0) veh [source] = createVehicle (432, posB[pos][1], posB[pos][2], posB[pos][3]) setElementHealth (veh [source], 350) warpPedIntoVehicle (source, veh [source]) toggleControl (source, "enter_exit", false) end ) addEventHandler ("onPlayerQuit", root, function () if isElement (veh [source]) then destroyElement (veh [source]) veh [source] = nil end end ) Link to comment
☠ RaZeR ☠ Posted April 11, 2015 Author Share Posted April 11, 2015 مشكور : طلب اخير كيف اسوي شريط كانه يحمل: يعني خط ابيض يمشي مثل التحميل وممكن مثال Link to comment
yazan Posted April 11, 2015 Share Posted April 11, 2015 مثال ب ال رندر و تايمر و ثنين كلنت local progress = guiCreateProgressBar( 0.8, 0.8, 0.1, 0.1, true) render = function() if guiProgressBarGetProgress(progress) >= 100 then removeEventHandler('onClientRender',root,render) end guiProgressBarSetProgress(progress,guiProgressBarGetProgress(progress)+1) end addEventHandler('onClientRender',root,render) و هذه بتايمر local progress = guiCreateProgressBar( 0.8, 0.8, 0.1, 0.1, true) t = setTimer ( function() if guiProgressBarGetProgress( progress ) >= 100 then if isTimer ( t ) then killTimer ( t ) t = nil end guiProgressBarSetProgress( progress, guiProgressBarGetProgress( progress ) + 1 ) end, 1000,0,true ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now