Jump to content

طلب - خش و تعرف ضروري


Recommended Posts

السلام عليكم ...

مثلا نبي نسوي مود جوائز العشوائية في الشات

نبيها تجي كل ساعة جوائز تجي لللاعب الي يختاره المود و واش فاز مود يختار 2 لاعبين مب واحد

كود مطلوب هو الي يسوي random.math للداتا

مثلا رح اسوي كم داتا مب وحدة بس حق اكس بي و لفل و شيء اخر و نبي داتا يختاره المود هو و 2 لاعبين

فكر مليح و جاوب ...

Link to comment

تفضل ,ابهرنا ...

function RandomPrizes()
local players = getElementsByType ( "player" )
local randomPlayer = players[math.random(#players)]
local Data = math.random("Money","XP","Launcher")
exports["guimessages"]:outputServer(root, "#65E3FC[Random Prizes] #00FF00Player ".. getPlayerName ( randomPlayer ) .." #15FF00[#66AA0D".. XP .." XP#15FF00]#FFFFFF Has Won #15FF00[#66AA0D$".. Data .."#15FF00].", 0, 255, 0)
exports["guimessages"]:outputServer(root, "#65E3FC[Random Prizes] #00FF00You Have Got #15FF00[#66AA0D".. getPlayerName ( randomPlayer ) .." #15FF00]#FFFFFF Has Won #15FF00[#66AA0D$".. Data .."#15FF00].", 0, 255, 0)
setElementData(randomPlayer, "Data", (getElementData(randomPlayer, "Data") or 0) + Data)
playSoundFrontEnd(5)
end
setTimer(RandomPrizes,*60,1000,0)
setTimer(RandomPrizes,3000,1)

Edited by #1'Maycle
Link to comment
function table.random ( theTable )
    return theTable[math.random ( #theTable )]
end
W = { "Money","XP","Launcher" }
function RandomPrizes()
local randomPlayer = getRandomPlayer ( )
local Data = table.random(W)
exports["guimessages"]:outputServer(root, "#65E3FC[Random Prizes] #00FF00Player ".. getPlayerName ( randomPlayer ) .." #15FF00[#66AA0D".. XP .." XP#15FF00]#FFFFFF Has Won #15FF00[#66AA0D$".. Data .."#15FF00].", 0, 255, 0)
exports["guimessages"]:outputServer(root, "#65E3FC[Random Prizes] #00FF00You Have Got #15FF00[#66AA0D".. getPlayerName ( randomPlayer ) .." #15FF00]#FFFFFF Has Won #15FF00[#66AA0D$".. Data .."#15FF00].", 0, 255, 0)
setElementData(randomPlayer, ""..Data.."", (getElementData(randomPlayer, ""..Data.."") or 0) + Data)
playSoundFrontEnd(5)
end
setTimer(RandomPrizes,*60,1000,0)
setTimer(RandomPrizes,3000,1) 

جرب

الكود سيرفر سايد

Link to comment

للاسف حتى عدلت عليه اخطاء كانت شوي و ماشتغل !!

ذي الكودات حاليا

function table.random ( theTable )
    return theTable[math.random ( #theTable )]
end
Money = 20000
XP = 50
Launcher = 10
W = { "Money","XP","Launcher" }
function RandomPrizes()
local randomPlayer = getRandomPlayer ( )
local Data = table.random(W)
exports["guimessages"]:outputServer(root, "#65E3FC[Random Prizes] #00FF00".. getPlayerName ( randomPlayer ) .." #FFFFFF Has Won #15FF00[#66AA0D$".. Data .."#15FF00].", 0, 255, 0)
exports["guimessages"]:outputServer(root, "#65E3FC[Random Prizes] #00FF00[#66AA0D".. getPlayerName ( randomPlayer ) .." #15FF00]#FFFFFF Has Won #15FF00[#66AA0D$".. Data .."#15FF00].", 0, 255, 0)
setElementData(randomPlayer, ""..Data.."", (getElementData(randomPlayer, ""..Data.."") or 0) + Data)
playSoundFrontEnd(5)
end
setTimer(RandomPrizes,*1,1000,1)
setTimer(RandomPrizes,3000,1)

Link to comment
W = {
{"Money"},
{"XP"},
{"Launcher"},
}

function RandomPrizes()
local randomPlayer = getRandomPlayer ( )
local Data = table.random(W)
local randomnumb = math.random(1,7)
exports["guimessages"]:outputServer(root, "#65E3FC[Random Prizes] #00FF00Player ".. getPlayerName ( randomPlayer ) .." #FFFFFF Has Won #15FF00[#66AA0D".. Data .."#15FF00].", 0, 255, 0)
setElementData(randomPlayer, ""..Data.."", (getElementData(randomPlayer, Data) or 0) + randomnumb)
playSoundFrontEnd(5)
end
setTimer(RandomPrizes,*60,1000,0)
setTimer(RandomPrizes,3000,1) 

 

Edited by #RoLde
Link to comment

جرب كذا

local prizes = {"EXP", "MONEY", "LEVEL"}

function randomWinner ()
	local randomPrize = prizes[math.random(#prizes)]
	local firstPlayer, secondPlayer = getRandomPlayer(), getRandomPlayer()
	if ( randomPrize ) then
		if ( firstPlayer and secondPlayer ) then
			outputChatBox("First Winner:" .. getPlayerName(firstPlayer) .. " : " .. randomPrize, root, 255, 255, 255, true)
			outputChatBox("Second Winner:" .. getPlayerName(secondPlayer) .. " : " .. randomPrize, root, 255, 255, 255, true)
      		-- اعطي اللاعب جائزة على حسب كودك
		end
	end
end
setTimer(randomWinner,3600000,0) 

 

Edited by N3xT
Link to comment
3 hours ago, N3xT said:

جرب كذا


local prizes = {"EXP", "MONEY", "LEVEL"}

function randomWinner ()
	local randomPrize = prizes[math.random(#prizes)]
	local firstPlayer, secondPlayer = getRandomPlayer(), getRandomPlayer()
	if ( randomPrize ) then
		if ( firstPlayer and secondPlayer ) then
			outputChatBox("First Winner:" .. getPlayerName(firstPlayer) .. " : " .. randomPrize, root, 255, 255, 255, true)
			outputChatBox("Second Winner:" .. getPlayerName(secondPlayer) .. " : " .. randomPrize, root, 255, 255, 255, true)
      		-- اعطي اللاعب جائزة على حسب كودك
		end
	end
end
setTimer(randomWinner,3600000,0) 

 

نسيت تحط

setElementData

Link to comment
9 hours ago, #RoLde said:

نسيت تحط

setElementData

كاتب اعطي اللاعب الجائزة على حسب كودك, انا معرف كيف طريقة اكواده عشان اعطيه جائزة

  • Like 1
Link to comment
local prizes = {"EXP", "MONEY", "LEVEL"}

function randomWinner ()
	local randomPrize = prizes[math.random(#prizes)]
	local firstPlayer, secondPlayer = getRandomPlayer(), getRandomPlayer()
	if ( randomPrize ) then
		if ( firstPlayer and secondPlayer ) then
			outputChatBox("First Winner:" .. getPlayerName(firstPlayer) .. " : " .. randomPrize, root, 255, 255, 255, true)
setElementData(firstPlayer, randomPrize, (getElementData(firstPlayer, randomPrize) or 0 ) + الجائزة)
			outputChatBox("Second Winner:" .. getPlayerName(secondPlayer) .. " : " .. randomPrize, root, 255, 255, 255, true)
      setElementData(secondPlayer, randomPrize, (getElementData(secondPlayer, randomPrize) or 0 ) + الجائزة)
      		-- اعطي اللاعب جائزة على حسب كودك
		end
	end
end
setTimer(randomWinner,3600000,0) 

الجائزة الي هي العدد حق الي تبيه ياخذه

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...