• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

check number of players

Doggynub

LUA / C++
Joined
Sep 28, 2008
Messages
2,541
Reaction score
186
i want to know if this thing work
LUA:
function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor)
t = getPlayerStorageValue(getPlayerOnline(cid),1991) == 1
p = getPlayerStorageValue(getPlayerOnline(cid),1991) == 2
 if t >= 1 and p < 1 then


it is supposed to check if players with storage 1 are like one or more player and player with storag 2 is zero(no one have this storage)
 
Code:
function onStepIn(cid, item, position, fromPosition)
	local t, p = 0, 0
	for _, pid in ipairs(getPlayersOnline()) do
		local v = getPlayerStorageValue(pid, 1991)
		if v == 1 then
			t = t + 1
		elseif v == 2 then
			p = p + 1
		end
	end
	if t >= 1 and p < 1 then
 
Back
Top