• 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!

Show Players with storage

merfus

Member
Joined
Dec 27, 2011
Messages
214
Reaction score
5
Location
Poland
is there any line what show's all players with storage example:
Lua:
getPlayerStorageValue(cid,2010) == 13 then
 
PHP:
function onSay(cid, words, param, channel)
local player = {}
local str = ''
        if(param == "") then return TRUE,doPlayerSendTextMessage(cid,18,"Command param required.")end
	local t = string.explode(param, ",")
	if(not tonumber(t[1]) or not tonumber(t[2])) then
		return TRUE,doPlayerSendTextMessage(cid,18,"choose a number storage,value.")end
	for _, pid in pairs (getPlayersOnline()) do
		if getPlayerStorageValue(pid, tonumber(t[1])) == tonumber(t[2]) then
			table.insert(player, pid)
		end
	end
	        for i = 1, #player do
		str = str.." "..getPlayerName(player[i]).."[" .. getPlayerLevel(player[i]) .. "]"
                i = i + 1
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, (i - 1) .. " player(s) online with that mission:")
                end
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str)
return TRUE
end
 
Back
Top