Обычная решала викторины
Code:
net.Receive("QuizHuiz",function(len,pl)
local prize = net.ReadFloat()
local color_1 = Color(153, 204, 255)
local color_2 = Color(255, 255, 255)
local question = 'Сколько будет '
local color_3 = Color(51, 204, 51)
local num1 = net.ReadFloat()
local num2 = net.ReadFloat()
local action = net.ReadString()
local color_4 = Color(0, 255, 0)
local color_5 = Color(255, 153, 0)
num1 = tostring(num1)
num2 = tostring(num2)
chat.AddText(color_1, "[", color_3, prefix, color_1, "] ", color_2, question, color_4, num1, " ", color_5, action, " ", color_4, num2, color_2, " ?")
if action == "+" then
summ = num1 + num2
end
if action == "-" then
summ = num1 - num2
end
if action == "*" then
summ = num1 * num2
end
if action == ":" then
summ = num1 / num2
end
math.randomseed( CurTime() )
timer.Simple( math.Rand( 1, 3 ), function() RunConsoleCommand( "say", tostring(summ) ) end )
chat.AddText(Color(255,0,0),"Spizdiv))))))))")
end)
print("Init!")
Attachments
-
1.2 KB Views: 105