Jump to content

ارحو مبرمج محترف يعرف تحويل الكلام دا الي كود


Recommended Posts

.السلام عليكم ورحمه الله وبركاته

.مثلا في كلمه معينه لو حد كتابها بتعمل شئ معين مثلا بتوديه مكان
بس لو 10 لاعبين كتبوا الكلمه دي لو حد كتبها بعد ال 10 لاعبين دول ما يتفعل الكلمه
يعني كان اخد العدد الكافي 
ازاي احسب عدد الاعبين اللي كتبوها ؟؟؟؟
.وارجوا المساعده والاجابه علي سؤالي 

Edited by w.T|{K}iller_PrO
Link to comment
aPlayers_ = 0
x,y,z = الاحداثيات حقتك
addCommandHandler("الكلمة",
  function( player )
aPlayers_=aPlayers_+1
setElementPosition(player, x,y,z)
if aPlayers_ >= 10 then
return
outputChatBox("لا يمكنك الانضمام يوجد 10 لاعبين",player, 255,0,0,true)
end
end
)

 

Link to comment
12 minutes ago, #RoLde said:

aPlayers_ = 0
x,y,z = الاحداثيات حقتك
addCommandHandler("الكلمة",
  function( player )
aPlayers_=aPlayers_+1
setElementPosition(player, x,y,z)
if aPlayers_ >= 10 then
return
outputChatBox("لا يمكنك الانضمام يوجد 10 لاعبين",player, 255,0,0,true)
end
end
)

 

كودك بينقلهم برضو حتي لو بعد الـ10 لاعبين

local playersCount = 0
local x, y, z = 0, 0, 0  -- [ بدل الـ 0, 0, 0 بالاحداثيات حقك ]
local command = "warp" -- غيرها للكلمه الي تباها

addCommandHandler(command,
	function(player)
		if playersCount < 10 then
			if setElementPosition(player, x, y, z) then
				playersCount = playersCount + 1
			else
				outputChatBox("ERROR - "..getPlayerName(player).." couldn't get warped", root, 255, 0, 0, true)
			end
		else
			outputChatBox("ERROR - there's already 10 players used the command before you !", player, 255, 0, 0, true)
		end
	end
)

 

  • Thanks 1
Link to comment
7 minutes ago, #َxLysandeR said:

كودك بينقلهم برضو حتي لو بعد الـ10 لاعبين


local playersCount = 0
local x, y, z = 0, 0, 0  -- [ بدل الـ 0, 0, 0 بالاحداثيات حقك ]
local command = "warp" -- غيرها للكلمه الي تباها

addCommandHandler(command,
	function(player)
		if playersCount < 10 then
			if setElementPosition(player, x, y, z) then
				playersCount = playersCount + 1
			else
				outputChatBox("ERROR - "..getPlayerName(player).." couldn't get warped", root, 255, 0, 0, true)
			end
		else
			outputChatBox("ERROR - there's already 10 players used the command before you !", player, 255, 0, 0, true)
		end
	end
)

 

نفترض ان الاعب كتب الكلمة اكثر من مرة  ؟ وش بيصير

  • Haha 1
Link to comment
2 minutes ago, Abdul KariM said:

نفترض ان الاعب كتب الكلمة اكثر من مرة  ؟ وش بيصير

ما حدد هوا او قال انو يبي هيك + لاكن لو يبي 

تفضل

local usedWaprs = {}
local playersCount = 0
local x, y, z = 0, 0, 0  -- [ بدل الـ 0, 0, 0 بالاحداثيات حقك ]
local command = "warp" -- غيرها للكلمه الي تباها

addCommandHandler(command,
	function(player)
		if not usedWaprs[player] then
			if playersCount < 10 then
				if setElementPosition(player, x, y, z) then
					playersCount = playersCount + 1
					usedWaprs[player] = true
				else
					outputChatBox("ERROR - "..getPlayerName(player).." couldn't get warped", root, 255, 0, 0, true)
				end
			else
				outputChatBox("ERROR - there's already 10 players used the command before you !", player, 255, 0, 0, true)
			end
		else
			outputChatBox("ERROR - you can't use this command twice !!", player, 255, 0, 0, true)
		end
	end
)

 

  • Thanks 1
Link to comment
13 hours ago, #َxLysandeR said:
  1. local usedWaprs = {}
  2. local playersCount = 0
  3. local x, y, z = 0, 0, 0 -- [ بدل الـ 0, 0, 0 بالاحداثيات حقك ]
  4. local command = "warp" -- غيرها للكلمه الي تباها
  5.  
  6. addCommandHandler(command,
  7. function(player)
  8. if not usedWaprs[player] then
  9. if playersCount < 10 then
  10. if setElementPosition(player, x, y, z) then
  11. playersCount = playersCount + 1
  12. usedWaprs[player] = true
  13. else
  14. outputChatBox("ERROR - "..getPlayerName(player).." couldn't get warped", root, 255, 0, 0, true)
  15. end
  16. else
  17. outputChatBox("ERROR - there's already 10 players used the command before you !", player, 255, 0, 0, true)
  18. end
  19. else
  20. outputChatBox("ERROR - you can't use this command twice !!", player, 255, 0, 0, true)
  21. end
  22. end
  23. )

طيب تمام بس ممكن حضرتك تشرح الاكواد

 

Link to comment
11 hours ago, w.T|{K}iller_PrO said:

طيب تمام بس ممكن حضرتك تشرح الاكواد

 

local usedWaprs = {} -- جدول فاضي عشان نحط فيه اللاعبين الي دخلو عشان ما يدخلو تاني
local playersCount = 0 -- نبداء بعدد اللاعبين الي هو 0 لان المود لسا فاتح
local x, y, z = 0, 0, 0  -- [ بدل الـ 0, 0, 0 بالاحداثيات حقك ] --
local command = "warp" -- غيرها للكلمه الي تباها

addCommandHandler(command, -- نضيف الأمر
	function(player) -- وظيفه الأمر
		if not usedWaprs[player] then -- نتحقق ان اللاعب مو موجود بالجدول ( يعني ما دخل قبل )ي
			if playersCount < 10 then -- نتحقق ان عدد اللاعبين اقل من 10
				if setElementPosition(player, x, y, z) then -- نتحقق ان وظيفه النقل تنفذت لان ممكن ما تتنفذ اذا اللاعب خرج و هو يكتب او حصل شي تاني
					playersCount = playersCount + 1 -- نزيد عدد اللاعبين الي دخلو
					usedWaprs[player] = true -- نضيف اللاعب للجدول لانه دخل
				else -- لو ما تحققت وظيفه النقل
					outputChatBox("ERROR - "..getPlayerName(player).." couldn't get warped", root, 255, 0, 0, true) -- يكتب له كذا
				end -- اغلاق تحقق وظيفه النقل
			else -- لو ما كان عدد اللاعبين اقل من 10
				outputChatBox("ERROR - there's already 10 players used the command before you !", player, 255, 0, 0, true) -- يطلع للاعب كدا
			end -- اغلاق تحقق عدد اللاعبين
		else -- لو اللاعب دخل من قبل
			outputChatBox("ERROR - you can't use this command twice !!", player, 255, 0, 0, true) -- يطلع له كدا
		end -- اغلاق تحقق الدخول من قبل
	end -- اغلاق الفانكشن
) -- قوس لاغلاق الأمر

------------- ذا نفس الطريقه بس شلت المتغير و حطيت بدالو يجيب حجم الجدول

local usedWaprs = {}
local x, y, z = 0, 0, 0  -- [ بدل الـ 0, 0, 0 بالاحداثيات حقك ]
local command = "warp" -- غيرها للكلمه الي تباها

addCommandHandler(command,
	function(player)
		if not usedWaprs[player] then
			if #usedWaprs < 10 then
				if setElementPosition(player, x, y, z) then
					usedWaprs[player] = true
				else
					outputChatBox("ERROR - "..getPlayerName(player).." couldn't get warped", root, 255, 0, 0, true)
				end
			else
				outputChatBox("ERROR - there's already 10 players used the command before you !", player, 255, 0, 0, true)
			end
		else
			outputChatBox("ERROR - you can't use this command twice !!", player, 255, 0, 0, true)
		end
	end
)

 

  • Thanks 1
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...