What's new

Lua Functions getPlayerWorldId(cid)

Status
Not open for further replies.

Forseti

Senior User
Joined
Dec 23, 2011
Messages
954
Reaction score
82
Funkcja zwraca ID ?wiata gracza. Mo?liwe, ?e komu? si? przyda.

The Forgotten Server 0.3 +.

PHP:
function getPlayerWorldId(cid)
	if not(isPlayer(cid)) then
		return false
	end

	local pid = getPlayerGUID(cid)
	local worldPlayer = 0
	
	local result_plr = db.getResult("SELECT * FROM `players` WHERE `id` = "..pid..";")
    if(result_plr:getID() ~= -1) then
		worldPlayer = tonumber(result_plr:getDataInt("world_id"))
		result_plr:free()
	else
		return false
    end
	
	return worldPlayer
end

Pozdrawiam,
Dawido.
 
Status
Not open for further replies.
Top