</Mr.Tn6eL> Posted February 9, 2014 Share Posted February 9, 2014 السلام عليكم ورحمة الله وبركاته اليوم واجهت مشكلة هنا السباون يجي للكل server triggerClientEvent (source, "Hide", source) client addEvent("Hide", true) addEventHandler("Hide",root, function() fadeCamera ( false, 2.0, 0, 0, 0) fadeCamera(true) setTime(12, 0) setWeather(3) addEventHandler("onClientRender", root, thop) setCameraMatrix(...............) removeEventHandler("onClientRender", getRootElement(), Camera) guiSetVisible (reglogwnd, false) showCursor(false) ped = createPed(................) setElementFrozen(ped,true) bindKey("......", "down", play) bindKey("......", "down", last) bindKey("......", "down", next) end ) + طلب فنكشن ابي فنكشن تحقق من الاعبين ويكون 24 واذ جو 1 ياخذ فلوس عشان ابسوي مود جديد Link to comment
The Killer Posted February 9, 2014 Share Posted February 9, 2014 الكود الاول حاط لي الترايقر بس ومدري وش الزبده = خرابيط الكود الثاني مدري وش تقول Link to comment
al-Kobra Posted February 9, 2014 Share Posted February 9, 2014 انت حاط فيد للكاميرا ترو وفولس Link to comment
</Mr.Tn6eL> Posted February 9, 2014 Author Share Posted February 9, 2014 انت حاط فيد للكاميرا ترو وفولس ههه والله كنت مسوي تايمر لاكن شلته عشان الاق ونسيت ذذ true thekiller مني فاهم ؟ الخرابيش الللي مسويها عشان محد يسرق الاكواد Link to comment
</Mr.Tn6eL> Posted February 9, 2014 Author Share Posted February 9, 2014 انت حاط فيد للكاميرا ترو وفولس ههه والله كنت مسوي تايمر لاكن شلته عشان الاق ونسيت ذذ true thekiller مني فاهم ؟ الخرابيش الللي مسويها عشان محد يسرق الاكواد الكود الثاني سويت مسابقة وابي اللاعبين يكونون 24 اذ كانو اقل من 2 يلغي المسابقة + اخر واحد بالمسابقة يبقا ياخذ فلوس 5000 Link to comment
#DRAGON!FIRE Posted February 9, 2014 Share Posted February 9, 2014 عشان تتحق من اللاعبين الموجودين في اكثر من طريقة .. اولأ التيبلأت : Event: "onMarkerHit" Event: "onMarkerLeave" table table.insert table.remove او تسوي ماركر وتجيب عدد الموجودين بالماركر او كول شيب . Link to comment
al-Kobra Posted February 9, 2014 Share Posted February 9, 2014 هذا كود عناد Race = { Players = { }; Vehicles = { }; Position = { [1] = { x, y, z }; [2] = { x, y, z }; [3] = { x, y, z }; [4] = { x, y, z }; [5] = { x, y, z }; }; Cars = { { 432 }; { 432 }; }; }; setRaceStats = function ( stats ) if stats then setElementData ( resourceRoot, "RaceStarted", true ) else Race.Players = 0 setElementData ( resourceRoot, "RaceStarted", false ) outputChatBox ( "* تم إفتتاح السباق", root, 255, 255, 0, true ) end end addEventHandler ( "onPlayerChat", root, function ( msg ) if string.find ( msg, "سباق" ) then if getElementData ( resourceRoot, "RaceStarted" ) then return outputChatBox ( "* لم ينتهي السباق بعد", source, 255, 0, 0, true ) end if Race.Players < 5 then if not Race.Vehicles[source] then if Race.Players == 4 then setRaceStats ( true ) end Race.Players = Race.Players+1 Race.Vehicles[source] = createVehicle ( Race.Cars[math.random(#Race.Cars)][1], Race.Position[Race.Players][1], Race.Position[Race.Players][2], Race.Position[Race.Players][3] ) setTimer ( warpPedIntoVehicle, 100, 1, source, Race.Vehicles[source] ) setElementDimension( Race.Vehicles[source], 1) setElementDimension( source, 1) setElementData ( Race.Vehicles[source], "Owner", source ) end else outputChatBox ( "* أكتمل العدد", source, 255, 0, 0, true ) end end end ) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) if Race.Players == 1 then local player = getElementData ( source, "Owner" ) if isElement ( player ) then if getElementData ( resourceRoot, "RaceStarted" ) then givePlayerMoney ( player, 5000 ) outputChatBox ( "* $5000 لقد ربحت", player, 255, 255, 0, true ) end Race.Vehicles[player] = nil end setTimer ( setRaceStats, 2000, 1, false ) else Race.Players = Race.Players-1 end end ) addEventHandler ( "onElementDestroy", resourceRoot, function ( ) if getElementType ( source ) == "vehicle" then if Race.Players == 1 then local player = getElementData ( source, "Owner" ) if isElement ( player ) then if getElementData ( resourceRoot, "RaceStarted" ) then givePlayerMoney ( player, 5000 ) outputChatBox ( "* $5000 لقد ربحت", player, 255, 255, 0, true ) end Race.Vehicles[player] = nil end setTimer ( setRaceStats, 2000, 1, false ) else Race.Players = Race.Players-1 end end end ) addEventHandler ( "onPlayerQuit", root, function ( ) if Race.Vehicles[source] then if isElement ( Race.Vehicles[source] ) then destroyElement ( Race.Vehicles[source] ) else if Race.Players == 1 then setTimer ( setRaceStats, 2000, 1, false ) else Race.Players = Race.Players-1 end end Race.Vehicles[source] = nil end end ) setRaceStats ( false ) Link to comment
</Mr.Tn6eL> Posted February 9, 2014 Author Share Posted February 9, 2014 هذا كود عناد Race = { Players = { }; Vehicles = { }; Position = { [1] = { x, y, z }; [2] = { x, y, z }; [3] = { x, y, z }; [4] = { x, y, z }; [5] = { x, y, z }; }; Cars = { { 432 }; { 432 }; }; }; setRaceStats = function ( stats ) if stats then setElementData ( resourceRoot, "RaceStarted", true ) else Race.Players = 0 setElementData ( resourceRoot, "RaceStarted", false ) outputChatBox ( "* تم إفتتاح السباق", root, 255, 255, 0, true ) end end addEventHandler ( "onPlayerChat", root, function ( msg ) if string.find ( msg, "سباق" ) then if getElementData ( resourceRoot, "RaceStarted" ) then return outputChatBox ( "* لم ينتهي السباق بعد", source, 255, 0, 0, true ) end if Race.Players < 5 then if not Race.Vehicles[source] then if Race.Players == 4 then setRaceStats ( true ) end Race.Players = Race.Players+1 Race.Vehicles[source] = createVehicle ( Race.Cars[math.random(#Race.Cars)][1], Race.Position[Race.Players][1], Race.Position[Race.Players][2], Race.Position[Race.Players][3] ) setTimer ( warpPedIntoVehicle, 100, 1, source, Race.Vehicles[source] ) setElementDimension( Race.Vehicles[source], 1) setElementDimension( source, 1) setElementData ( Race.Vehicles[source], "Owner", source ) end else outputChatBox ( "* أكتمل العدد", source, 255, 0, 0, true ) end end end ) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) if Race.Players == 1 then local player = getElementData ( source, "Owner" ) if isElement ( player ) then if getElementData ( resourceRoot, "RaceStarted" ) then givePlayerMoney ( player, 5000 ) outputChatBox ( "* $5000 لقد ربحت", player, 255, 255, 0, true ) end Race.Vehicles[player] = nil end setTimer ( setRaceStats, 2000, 1, false ) else Race.Players = Race.Players-1 end end ) addEventHandler ( "onElementDestroy", resourceRoot, function ( ) if getElementType ( source ) == "vehicle" then if Race.Players == 1 then local player = getElementData ( source, "Owner" ) if isElement ( player ) then if getElementData ( resourceRoot, "RaceStarted" ) then givePlayerMoney ( player, 5000 ) outputChatBox ( "* $5000 لقد ربحت", player, 255, 255, 0, true ) end Race.Vehicles[player] = nil end setTimer ( setRaceStats, 2000, 1, false ) else Race.Players = Race.Players-1 end end end ) addEventHandler ( "onPlayerQuit", root, function ( ) if Race.Vehicles[source] then if isElement ( Race.Vehicles[source] ) then destroyElement ( Race.Vehicles[source] ) else if Race.Players == 1 then setTimer ( setRaceStats, 2000, 1, false ) else Race.Players = Race.Players-1 end end Race.Vehicles[source] = nil end end ) setRaceStats ( false ) كود عناد خربان >< Link to comment
#DRAGON!FIRE Posted February 9, 2014 Share Posted February 9, 2014 هذا كود عناد Race = { Players = { }; Vehicles = { }; Position = { [1] = { x, y, z }; [2] = { x, y, z }; [3] = { x, y, z }; [4] = { x, y, z }; [5] = { x, y, z }; }; Cars = { { 432 }; { 432 }; }; }; setRaceStats = function ( stats ) if stats then setElementData ( resourceRoot, "RaceStarted", true ) else Race.Players = 0 setElementData ( resourceRoot, "RaceStarted", false ) outputChatBox ( "* تم إفتتاح السباق", root, 255, 255, 0, true ) end end addEventHandler ( "onPlayerChat", root, function ( msg ) if string.find ( msg, "سباق" ) then if getElementData ( resourceRoot, "RaceStarted" ) then return outputChatBox ( "* لم ينتهي السباق بعد", source, 255, 0, 0, true ) end if Race.Players < 5 then if not Race.Vehicles[source] then if Race.Players == 4 then setRaceStats ( true ) end Race.Players = Race.Players+1 Race.Vehicles[source] = createVehicle ( Race.Cars[math.random(#Race.Cars)][1], Race.Position[Race.Players][1], Race.Position[Race.Players][2], Race.Position[Race.Players][3] ) setTimer ( warpPedIntoVehicle, 100, 1, source, Race.Vehicles[source] ) setElementDimension( Race.Vehicles[source], 1) setElementDimension( source, 1) setElementData ( Race.Vehicles[source], "Owner", source ) end else outputChatBox ( "* أكتمل العدد", source, 255, 0, 0, true ) end end end ) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) if Race.Players == 1 then local player = getElementData ( source, "Owner" ) if isElement ( player ) then if getElementData ( resourceRoot, "RaceStarted" ) then givePlayerMoney ( player, 5000 ) outputChatBox ( "* $5000 لقد ربحت", player, 255, 255, 0, true ) end Race.Vehicles[player] = nil end setTimer ( setRaceStats, 2000, 1, false ) else Race.Players = Race.Players-1 end end ) addEventHandler ( "onElementDestroy", resourceRoot, function ( ) if getElementType ( source ) == "vehicle" then if Race.Players == 1 then local player = getElementData ( source, "Owner" ) if isElement ( player ) then if getElementData ( resourceRoot, "RaceStarted" ) then givePlayerMoney ( player, 5000 ) outputChatBox ( "* $5000 لقد ربحت", player, 255, 255, 0, true ) end Race.Vehicles[player] = nil end setTimer ( setRaceStats, 2000, 1, false ) else Race.Players = Race.Players-1 end end end ) addEventHandler ( "onPlayerQuit", root, function ( ) if Race.Vehicles[source] then if isElement ( Race.Vehicles[source] ) then destroyElement ( Race.Vehicles[source] ) else if Race.Players == 1 then setTimer ( setRaceStats, 2000, 1, false ) else Race.Players = Race.Players-1 end end Race.Vehicles[source] = nil end end ) setRaceStats ( false ) كود عناد خربان >< روح الموضوع وخذ اخر كود انطرح بالموضوع Link to comment
al-Kobra Posted February 9, 2014 Share Posted February 9, 2014 Race = { Players = { }; Vehicles = { }; Position = { [1] = { x, y, z }; [2] = { x, y, z }; [3] = { x, y, z }; [4] = { x, y, z }; [5] = { x, y, z }; }; Cars = { { 432 }; { 432 }; }; }; setRaceStats = function ( stats ) if stats then setElementData ( resourceRoot, "RaceStarted", true ) else Race.Players = 0 setElementData ( resourceRoot, "RaceStarted", false ) outputChatBox ( "* تم إفتتاح السباق", root, 255, 255, 0, true ) end end addEventHandler ( "onPlayerChat", root, function ( msg ) if string.find ( msg, "سباق" ) then if getElementData ( resourceRoot, "RaceStarted" ) then return outputChatBox ( "* لم ينتهي السباق بعد", source, 255, 0, 0, true ) end if Race.Players < 5 then if not Race.Vehicles[source] then if Race.Players == 4 then setRaceStats ( true ) end Race.Players = Race.Players+1 Race.Vehicles[source] = createVehicle ( Race.Cars[math.random(#Race.Cars)][1], Race.Position[Race.Players][1], Race.Position[Race.Players][2], Race.Position[Race.Players][3] ) setTimer ( warpPedIntoVehicle, 100, 1, source, Race.Vehicles[source] ) setElementData ( Race.Vehicles[source], "Owner", source ) end else outputChatBox ( "* أكتمل العدد", source, 255, 0, 0, true ) end end end ) addEventHandler ( "onVehicleExplode", resourceRoot, function ( ) if Race.Players == 1 then local player = getElementData ( source, "Owner" ) if isElement ( player ) then if getElementData ( resourceRoot, "RaceStarted" ) then givePlayerMoney ( player, 5000 ) outputChatBox ( "* $5000 لقد ربحت", player, 255, 255, 0, true ) end Race.Vehicles[player] = nil end setTimer ( setRaceStats, 2000, 1, false ) else Race.Players = Race.Players-1 end end ) addEventHandler ( "onElementDestroy", resourceRoot, function ( ) if getElementType ( source ) == "vehicle" then if Race.Players == 1 then local player = getElementData ( source, "Owner" ) if isElement ( player ) then if getElementData ( resourceRoot, "RaceStarted" ) then givePlayerMoney ( player, 5000 ) outputChatBox ( "* $5000 لقد ربحت", player, 255, 255, 0, true ) end Race.Vehicles[player] = nil end setTimer ( setRaceStats, 2000, 1, false ) else Race.Players = Race.Players-1 end end end ) addEventHandler ( "onPlayerQuit", root, function ( ) if Race.Vehicles[source] then if isElement ( Race.Vehicles[source] ) then destroyElement ( Race.Vehicles[source] ) else if Race.Players == 1 then setTimer ( setRaceStats, 2000, 1, false ) else Race.Players = Race.Players-1 end end Race.Vehicles[source] = nil end end ) setRaceStats ( false ) Link to comment
</Mr.Tn6eL> Posted February 9, 2014 Author Share Posted February 9, 2014 (edited) شوف ذا الكود صح ؟ local Marker = createMarker(......................) ksa = getMarkerCount(Marker) race = true function chat ( message ) if ( message == "...." ) then if ( race == false ) outputChatBox ( "لايمكنك الدخول الى ااسباق", source, 255, 0, 0, true ) end if ( race == true ) then if ksa < 1 then ksa = false cancelEvent ( ) end if ksa < 24 then addEventHandler ( "onPlayerWasted", root, wasted ) addEventHandler( "onMarkerHit", Marker, ksa ) end end end end addEventHandler( "onPlayerChat", root, chat ) function ksa() if getElementType(hitElement) == "player" then vehicle = createVehicle(id,x,y,z) warpPedIntoVehicle(hitElement, vehicle ) end end function wasted() race = false end Edited February 10, 2014 by Guest Link to comment
al-Kobra Posted February 9, 2014 Share Posted February 9, 2014 (edited) شوف ذا الكود صح ؟ local Marker = createMarker(......................) ksa = getMarkerCount(Marker) race = true function chat ( message ) if ( message == "...." ) then if ( race == false ) outputChatBox ( "لايمكنك الدخول الى ااسباق", source, 255, 0, 0, true ) end if ( race == true ) then if ksa < 1 then ksa = false cancelEvent ( ) end if ksa < 24 then addEventHandler ( "onPlayerWasted", root, wasted ) addEventHandler( "onMarkerHit", Marker, ksa ) end end end end addEventHandler( "onPlayerChat", root, chat ) function ksa() if getElementType(hitElement) == "player" then vehicle = createVehicle(id,x,y,z) warpPedIntoVehicle(hitElement, vehicle ) end end function wasted() race = dalse end انت تبغي تضيفه على هذاك الكود ؟؟ Edited February 9, 2014 by Guest Link to comment
</Mr.Tn6eL> Posted February 9, 2014 Author Share Posted February 9, 2014 (edited) شوف ذا الكود صح ؟ local Marker = createMarker(......................) ksa = getMarkerCount(Marker) race = true function chat ( message ) if ( message == "...." ) then if ( race == false ) outputChatBox ( "لايمكنك الدخول الى ااسباق", source, 255, 0, 0, true ) end if ( race == true ) then if ksa < 1 then ksa = false cancelEvent ( ) end if ksa < 24 then addEventHandler ( "onPlayerWasted", root, wasted ) addEventHandler( "onMarkerHit", Marker, ksa ) end end end end addEventHandler( "onPlayerChat", root, chat ) function ksa() if getElementType(hitElement) == "player" then vehicle = createVehicle(id,x,y,z) warpPedIntoVehicle(hitElement, vehicle ) end end function wasted() race = false end انت تبغي تضيفى على هذاك الكود ؟؟ كود عناد مابيه ابي اسوي مسابقة من 24 لاعب واخرر واحد ياخذ فلوس 5000 اوكي Edited February 10, 2014 by Guest Link to comment
</Mr.Tn6eL> Posted February 10, 2014 Author Share Posted February 10, 2014 الووو بليز حل Link to comment
al-Kobra Posted February 10, 2014 Share Posted February 10, 2014 function wasted() race = dalse end وش يعني dalse ?? Link to comment
</Mr.Tn6eL> Posted February 10, 2014 Author Share Posted February 10, 2014 function wasted() race = dalse end وش يعني dalse ?? يوووه كتبت dalse كنت ابكتب false سيتم التعديل ------------ الكود الاول صلحوه Link to comment
abu5lf Posted February 11, 2014 Share Posted February 11, 2014 وش تبي تسوي انت بالضبط Link to comment
Do_De<3 Posted February 11, 2014 Share Posted February 11, 2014 local marker = createMarker( 1827.7938232422, 335.53656005859, 18.626741409302, "cylinder", 2.0, 255, 0, 0, 150 ) function getPlayersInMarker(marker) local players = 0 if marker then if isElement ( marker ) and getElementType ( marker ) == "marker" then for i, player in ipairs ( getElementsByType ( "player" ) ) do if isElementWithinMarker ( player, marker ) then players = players +1 end end end end return players end addCommandHandler ( "aa", function ( player ) outputChatBox ( getPlayersInMarker ( marker ).." العدد", player, 255, 255, 0, true ) end ) يمكن رآحح يفيدكك : ) كودد عنآدد ترى : ) Link to comment
</Mr.Tn6eL> Posted February 15, 2014 Author Share Posted February 15, 2014 ابي شرط تحقق اللي لعبو السباق ابيهم 24 عشان مايجي لاق بالسباق + اذ كانو اقل من 2 سلاب و يلغى السبباق واذ فاز يكسب فلوس عشوائي + زاحف مني خبير بالجداول Link to comment
abu5lf Posted February 15, 2014 Share Posted February 15, 2014 ابي شرط تحقق اللي لعبو السباق ابيهم 24 عشان مايجي لاق بالسباق+ اذ كانو اقل من 2 سلاب و يلغى السبباق واذ فاز يكسب فلوس عشوائي + زاحف مني خبير بالجداول طيب وين كود السباق حقك Link to comment
</Mr.Tn6eL> Posted February 18, 2014 Author Share Posted February 18, 2014 ابي شرط تحقق اللي لعبو السباق ابيهم 24 عشان مايجي لاق بالسباق+ اذ كانو اقل من 2 سلاب و يلغى السبباق واذ فاز يكسب فلوس عشوائي + زاحف مني خبير بالجداول طيب وين كود السباق حقك انا لساع ماسويته بس اذ جاء الكود اسويه ان شاء الله بس ذا الكود اللي ناقصني ابيك تشرحلي table.insert table.remove لاني ماعمري سويت كود منها Link to comment
abu5lf Posted February 18, 2014 Share Posted February 18, 2014 aTable = { } print( aTable[1] ) -- nil table.insert( aTable, 1, 'k__s__a' ) print( aTable[1] ) -- k__s__a table.remove( aTable, 1 ) print( aTable[1] ) -- nil Link to comment
al-Kobra Posted February 18, 2014 Share Posted February 18, 2014 table.insert :Inserts element value at position pos in table, shifting up other elements to open space, if necessary. The default value for pos is n+1, where n is the length of the table (see §2.5.5), so that a call table.insert(t,x) inserts x at the end of table t. بإختصار يضيف قيم في الجدول , مثال, local Table = {1,2,'four'} addCommandHandler('insert',function(plr) table.insert(Table, 3, 'three') outputChatBox('Values number : '..#Table..' Texts : '..table.concat(Table,' , '),plr,255,200,25,true) end ) لو تلاحظ الجدول , local Table = {1,2,'four'} في واحد واثنين واربعه مافي 3 وانا ابي اضيفها للجدول , table.insert(Table, 3, 'three') ^ طبعا اول ارقومنت حق الجدول ثاني ارقومنت مكان القيمه يعني مثلا بعد 1 او 4 ثالث ارقومنت القيمه طبعا تقدر تسويها كذا, table.insert(Table, 'three') table.insert تستخدم لإضآفة القيم للجدول الاستخدآم table.insert(القيمه,المفتاح,الجدول) او table.insert(القيمه,الجدول) مثآل لاستخدام table.insert [/lua] Test = { [1] = 2, [2] = 3, [3] = 4 } نضيف له قيم بستخدم الداله table.insert(t,21) يطلع الجدول Test = { [1] = 2, [2] = 3, [3] = 4, [4] = 21 } [/lua] مثال #2 Test = { [1] = 2, [2] = 3, [3] = 4, } table.insert(t,2,99) يطلع الجدول Test = { [1] = 2, [2] = 99, [3] = 3, [4] = 4 } table.remove لحذف قيمه او جدول لازم المفتاح يصير رقم مثال #1 Test = { [1] = 2, [2] = 3, [3] = 4 } table.insert(t,2,99) يطلع الجدول Test = { [1] = 2, [2] = 99, [3] = 3, [4] = 4 } نسوي حذف للقيمه table.remove(t,2) يطلع الجدول Test = { [1] = 2, [2] = 3, [3] = 4 } 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