You bot check the player, it sends him a problem, and send you the answer.
cannot test sorry.
cannot test sorry.
Lua:
--------bot check----------
local access_to_check = 3
local types = (+, -, *, /)
local first_rand = math.random(1, 50)
local second_rand = math.random(1, 50)
local rand_types = math.random(types)
local odd = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47, 49} -- This is so all problems will turn out even (not so hard to figure out for players)
function onSay(cid, words, param, channel)
if (param == "") then
return false
end
t = string.explode(param, "")
t[1] = player
if getPlayerAccess(cid) >= access_to_check then
if (param == "/botcheck") then
if (isPlayer(player)) then
text = "You are being bot checked by: " .. getPlayerName(cid) .. "Please answer: "
for i, amount1 in ipairs(first_rand) do
if (amount1 == odd) then
amount1 = amount1 - 1
end
text = "You are being bot checked by: " .. getPlayerName(cid) .. "Please answer: " .. amount1 .. " "
end
for i, mathtype in ipairs(rand_types) do
text2 = .. mathtype .. " "
end
for i, amount2 in ipairs(second_rand) do
if (amount2 == odd) then
amount2 = amount2 - 1
end
text3 = .. amount2 .. ""
end
local answer = amount1 mathtype amount2
doPlayerPopupFYI(cid, "His answe should be " .. answer .. "")
doPlayerPopupFYI(player, text)
end
end
else
doPlayerSendCancel(cid, "You cannot use this command.")
return false
end
end