Mr.Mostafa Posted August 8, 2018 Share Posted August 8, 2018 سلام عليكم آبي لو آحد كتب سسبآون بآف 8 يحطه في آلآحدآثيآت آلآولي ولو آحد تآني كتب سبآون في آلآحدآثيآت آلتآنية ولو آحد تآلت كتب سبآون في آلآحدآثيآت آلتآلتة وآلخ ..... local RespawnPosition = { {2,3,4}, {1,2,3}, } addCommandHandler("respawn", function() local x, y, z = unpack(RespawnPosition[math.random(#RespawnPosition)]) spawnPlayer ( source,x, y, z,180, 46, 0, 0) end ) Link to comment
Trefeor Posted August 8, 2018 Share Posted August 8, 2018 جرب هذا local positionTable,countTable = { [1] = {0,0,3}, [2] = {100,0,3}, [3] = {120,0,1}, },0 addCommandHandler ( "spawn" , function ( player ) countTable = countTable + 1 if ( countTable >= #positionTable+1 ) then countTable = 0 end spawnPlayer ( player ,positionTable[countTable][1],positionTable[countTable][2],positionTable[countTable][3],180, 46, 0, 0) end ) ; Link to comment
Mr.Mostafa Posted September 18, 2018 Author Share Posted September 18, 2018 (edited) On 08/08/2018 at 03:45, Trefeor said: جرب هذا local positionTable,countTable = { [1] = {0,0,3}, [2] = {100,0,3}, [3] = {120,0,1}, },0 addCommandHandler ( "spawn" , function ( player ) countTable = countTable + 1 if ( countTable >= #positionTable+1 ) then countTable = 0 end spawnPlayer ( player ,positionTable[countTable][1],positionTable[countTable][2],positionTable[countTable][3],180, 46, 0, 0) end ) ; ظبط , بس يجي علي اخر احداثيات ويكررها مرتين يعني لو كتبت الكوماند ينقلني ل 1 لو كتبت تاني ينقلني 2 لو كتبت ثالث ينقلني 3 لو كتبت رابع ينقلني 3 تاني .. بعدين يعيد الجدول ــ يعني اخر احداثيات تنعاد مرتين , مافي لها حل؟ Edited September 18, 2018 by Mr.Mostafa Link to comment
N3xT Posted September 18, 2018 Share Posted September 18, 2018 استبدل ذا باللي عندك local placeCount = 0 local RespawnPosition = { { 2, 3, 4 }, { 1, 2, 3 }, } addCommandHandler("respawn", function ( player ) placeCount = placeCount + 1 spawnPlayer ( player, RespawnPosition[placeCount][1], RespawnPosition[placeCount][2], RespawnPosition[placeCount][3], 180, 46, 0, 0 ) if placeCount >= #RespawnPosition then placeCount = 0 end end ) 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