aL.Kfo Posted August 3, 2015 Share Posted August 3, 2015 كود شخص اجنبي .. الكود لا يقوم بنقلي عندمـأ اموت للمكان المحدد hospitalsTable = { { 1179.22803,-1323.52087,14.15908 }, { 1606.85559,1822.30957,10.82031 }, { -2659.85767,632.98505,14.45313 }, } function spawn( player ) local i=0 local minDistance=100000 local minHospital = 0 local posX, posY, posZ = getElementPosition(player) for key,val in ipairs(hospitalsTable) do i=i+1 local distance = getDistanceBetweenPoints2D(posX, posY, val[1], val[2]) if (distance) then minDistance=distance minHospital=i end end spawnPlayer( player, hospitalsTable[minHospital][1], hospitalsTable [minHospital][2], hospitalsTable [minHospital][3], hospitalsTable [minHospital][4] ) end addEventHandler("onPlayerWasted", getRootElement(),spawn) اتمنئ الافادةة Link to comment
Mr.Ronaldo Posted August 3, 2015 Share Posted August 3, 2015 تفضل : hospitalsTable = { { 1179.22803,-1323.52087,14.15908 }, { 1606.85559,1822.30957,10.82031 }, { -2659.85767,632.98505,14.45313 }, } function spawn( player ) local i=0 local minDistance=100000 local minHospital = 0 local posX, posY, posZ = getElementPosition(player) for key,val in ipairs(hospitalsTable) do i=i+1 local distance = getDistanceBetweenPoints2D(posX, posY, val[1], val[2]) if (distance) then minDistance=distance minHospital=i end end spawnPlayer( player, hospitalsTable[minHospital][1], hospitalsTable [minHospital][2], hospitalsTable [minHospital][3], hospitalsTable [minHospital][4] ) end addEventHandler("onPlayerSpawn", getRootElement(),spawn) المشكله انك كنت مسوي الحدث OnPlayerWasted المفروض تسويه OnPlayerSpawn Link to comment
Dr.Zlh Posted August 3, 2015 Share Posted August 3, 2015 hospitalsTable = { { 1179.22803,-1323.52087,14.15908 }, { 1606.85559,1822.30957,10.82031 }, { -2659.85767,632.98505,14.45313 }, } function spawn( player ) local i=0 local minDistance=100000 local minHospital = 0 local posX, posY, posZ = getElementPosition(player) for key,val in ipairs(hospitalsTable) do i=i+1 local distance = getDistanceBetweenPoints2D(posX, posY, val[1], val[2]) if (distance) then minDistance=distance minHospital=i end end for k,v in ipairs ( getElementsByType ( "player" ) ) do local x, y, z = unpack ( hospitalsTable[ math.random ( #hospitalsTable ) ] ) setTimer ( spawnPlayer, 1200, 1, v, x, y, z, 90, 46 ) end end addEventHandler("onPlayerWasted", getRootElement(),spawn) Link to comment
iMr.SFA7 Posted August 3, 2015 Share Posted August 3, 2015 hospitalsTable = { { 1179.22803,-1323.52087,14.15908 }, { 1606.85559,1822.30957,10.82031 }, { -2659.85767,632.98505,14.45313 }, } function spawn( player ) local i=0 local minDistance=100000 local minHospital = 0 local posX, posY, posZ = getElementPosition(player) for key,val in ipairs(hospitalsTable) do i=i+1 local distance = getDistanceBetweenPoints2D(posX, posY, val[1], val[2]) if (distance) then minDistance=distance minHospital=i end end for k,v in ipairs ( getElementsByType ( "player" ) ) do local x, y, z = unpack ( hospitalsTable[ math.random ( #hospitalsTable ) ] ) setTimer ( spawnPlayer, 1200, 1, v, x, y, z, 90, 46 ) end end addEventHandler("onPlayerWasted", getRootElement(),spawn) hospitalsTable = { { 1179.22803,-1323.52087,14.15908 }, { 1606.85559,1822.30957,10.82031 }, { -2659.85767,632.98505,14.45313 }, } function spawn( ) local i=0 local minDistance=100000 local minHospital = 0 local posX, posY, posZ = getElementPosition(source) for key,val in ipairs(hospitalsTable) do i=i+1 local distance = getDistanceBetweenPoints2D(posX, posY, val[1], val[2]) if (distance) then minDistance=distance minHospital=i end end for k,v in ipairs ( getElementsByType ( "player" ) ) do local x, y, z = unpack ( hospitalsTable[ math.random ( #hospitalsTable ) ] ) setTimer ( spawnPlayer, 1200, 1, v, x, y, z, 90, 46 ) end end addEventHandler("onPlayerWasted", getRootElement(),spawn) Link to comment
TAPL Posted August 3, 2015 Share Posted August 3, 2015 ^ لاعب مات تروح تسوي سباون لكل اللاعبين ليه؟ Link to comment
iMr.SFA7 Posted August 3, 2015 Share Posted August 3, 2015 أنا حطيت سورس لكود الي فوقي لا أكثر hospitalsTable = { { 1179.22803,-1323.52087,14.15908 }, { 1606.85559,1822.30957,10.82031 }, { -2659.85767,632.98505,14.45313 }, } function spawn( ) local i=0 local minDistance=100000 local minHospital = 0 local posX, posY, posZ = getElementPosition(source) for key,val in ipairs(hospitalsTable) do i=i+1 local distance = getDistanceBetweenPoints2D(posX, posY, val[1], val[2]) if (distance) then minDistance=distance minHospital=i end end spawnPlayer( source, hospitalsTable[minHospital][1], hospitalsTable [minHospital][2], hospitalsTable [minHospital][3], hospitalsTable [minHospital][4] ) end addEventHandler("onPlayerSpawn", getRootElement(),spawn) Link to comment
TAPL Posted August 3, 2015 Share Posted August 3, 2015 أنا حطيت سورس لكود الي فوقي لا أكثر hospitalsTable = { { 1179.22803,-1323.52087,14.15908 }, { 1606.85559,1822.30957,10.82031 }, { -2659.85767,632.98505,14.45313 }, } function spawn( ) local i=0 local minDistance=100000 local minHospital = 0 local posX, posY, posZ = getElementPosition(source) for key,val in ipairs(hospitalsTable) do i=i+1 local distance = getDistanceBetweenPoints2D(posX, posY, val[1], val[2]) if (distance) then minDistance=distance minHospital=i end end spawnPlayer( source, hospitalsTable[minHospital][1], hospitalsTable [minHospital][2], hospitalsTable [minHospital][3], hospitalsTable [minHospital][4] ) end addEventHandler("onPlayerSpawn", getRootElement(),spawn) داري انه كود الي فوقك بس كيف انت تعدل بكود بدون ما تشوف وش الي بالكود؟ الأفنت الي حاطه خطأ لما اللاعب يجيه سباون تسوي سباون و لما تسوي سباون رح يشتغل حدث لما اللاعب يجيه سباون و انت رح تسوي سباون مره ثانية و رح يشتغل الحدث مره ثالثة و رح يستمر ل ما لا نهاية و بينفجر المود و يغير بلاير إلى سورس ب فنكشن الي يجيب الأحداثيات و فنكشن السباون function الحدث الي حاطه صاحب الموضوع الصحيح بس يحذف بلاير من و الجدول فيه 3 ارقام و انتو حاطين 4 بفنكشن السباون و يفضل يستخدم تايمر ل فنكشن السباون عشان مو اول ما يموت اللاعب على طول يلقى نفسه يركض جنب المستشفى Link to comment
iMr.SFA7 Posted August 3, 2015 Share Posted August 3, 2015 اما ينفجر hospitalsTable = { { 1179.22803,-1323.52087,14.15908 }, { 1606.85559,1822.30957,10.82031 }, { -2659.85767,632.98505,14.45313 }, } addEventHandler("onPlayerWasted",root, setTimer ( function() function ( ) local i=0 local minDistance=100000 local minHospital = 0 local posX, posY, posZ = getElementPosition(source) for key,val in ipairs(hospitalsTable) do i=i+1 local distance = getDistanceBetweenPoints2D(posX, posY, val[1], val[2]) if (distance) then minDistance=distance minHospital=i end end spawnPlayer( source, hospitalsTable[minHospital][1], hospitalsTable [minHospital][2], hospitalsTable [minHospital][3], hospitalsTable [minHospital][4] ) end end,5000 , 1) ) Link to comment
aL.Kfo Posted August 3, 2015 Author Share Posted August 3, 2015 (edited) يعطيككم العافيةة كل واحد بأسمة بس ولا كود شغال وجربت اسوي نفس مقال الاخ تابل بس مدري تعديلي صح ولا لن ماشتغل hospitalsTable = { { 1179.22803,-1323.52087,14.15908 }, { 1606.85559,1822.30957,10.82031 }, { -2659.85767,632.98505,14.45313 }, } function ( ) local i=0 local minDistance=100000 local minHospital = 0 local posX, posY, posZ = getElementPosition(source) for key,val in ipairs(hospitalsTable) do i=i+1 local distance = getDistanceBetweenPoints2D(posX, posY, val[1], val[2]) if (distance) then minDistance=distance minHospital=i end end spawnPlayer( source, hospitalsTable[minHospital][1], hospitalsTable [minHospital][2], hospitalsTable [minHospital][3], hospitalsTable [minHospital][4] ) end addEventHandler("onPlayerWasted", getRootElement(),spawn) Edited August 3, 2015 by Guest Link to comment
Simple. Posted August 3, 2015 Share Posted August 3, 2015 (edited) hospitalsTable = { { 1179.22803,-1323.52087,14.15908 }, { 1606.85559,1822.30957,10.82031 }, { -2659.85767,632.98505,14.45313 }, } function spawn() local i=0 local minDistance=100000 local minHospital = 0 local posX, posY, posZ = getElementPosition(source) for key,val in ipairs(hospitalsTable) do i=i+1 local distance = getDistanceBetweenPoints2D(posX, posY, val[1], val[2]) if (distance) then minDistance=distance minHospital=i end end spawnPlayer( source, hospitalsTable[minHospital][1], hospitalsTable [minHospital][2], hospitalsTable [minHospital][3] ) end addEventHandler("onPlayerWasted", getRootElement(),spawn) Edited August 3, 2015 by Guest Link to comment
aL.Kfo Posted August 3, 2015 Author Share Posted August 3, 2015 xClassiCx # مو شغـأل شباب احد بيدية الحلوة يطرح لنا كود شغال او رابط موضوع نفس طلبي Link to comment
Simple. Posted August 3, 2015 Share Posted August 3, 2015 آنسخه مره ثانيه معليش كان فيه خطاء بسيط ! مججرب Link to comment
aL.Kfo Posted August 3, 2015 Author Share Posted August 3, 2015 بططل كلاسيك .. شغال تمام .. # Link to comment
aL.Kfo Posted August 4, 2015 Author Share Posted August 4, 2015 عذرأ ع تكرار الرد لكن ابي فيه تايمر Link to comment
Simple. Posted August 4, 2015 Share Posted August 4, 2015 (edited) hospitalsTable = { { 1179.22803,-1323.52087,14.15908 }, { 1606.85559,1822.30957,10.82031 }, { -2659.85767,632.98505,14.45313 }, } function spawn() local i=0 local minDistance=100000 local minHospital = 0 local posX, posY, posZ = getElementPosition(source) for key,val in ipairs(hospitalsTable) do i=i+1 local distance = getDistanceBetweenPoints2D(posX, posY, val[1], val[2]) if (distance) then minDistance=distance minHospital=i end end setTimer ( spawnPlayer, 3000, 1, source, hospitalsTable[minHospital][1], hospitalsTable [minHospital][2], hospitalsTable [minHospital][3] ) end addEventHandler("onPlayerWasted", getRootElement(),spawn) Edited August 4, 2015 by Guest Link to comment
aL.Kfo Posted August 4, 2015 Author Share Posted August 4, 2015 اممم ماصار ينقل لا متت Link to comment
Simple. Posted August 4, 2015 Share Posted August 4, 2015 نسيت فآصله معليش , آنسخه مره ثانيه Link to comment
aL.Kfo Posted August 4, 2015 Author Share Posted August 4, 2015 تمام شغال زي العسسل ي عسل .. لا يختلف شغلككك .. يعطيكك العافيةةة .. # 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