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

[REQUEST] Set Offline Player Pos

Grehy

Killroy
Joined
Nov 21, 2008
Messages
2,631
Reaction score
33
Location
United States
A command to set an offline player's position to yours, or another pos doesn't matter;

/respawn Dan

And when he logs on his position will be where you used the command
 
Code:
function onSay(cid, words, param)
	if(not(isPlayer(getPlayerByName(param)))) then
		local pos = getCreaturePosition(cid)
		return db.executeQuery("UPDATE `players` SET `posx` = ".. pos.x ..", `posy` = ".. pos.y ..", `posz` = ".. pos.z .." WHERE `name` = '".. escapeString(param) .."';")
	else
		return doPlayerSendCancel("The player needs to be offline.")
	end
end
 
[31/12/2009 18:10:29] data/talkactions/scripts/reset.lua:4: attempt to call global 'escapeString' (a nil value)
[31/12/2009 18:10:29] stack traceback:
[31/12/2009 18:10:29] data/talkactions/scripts/reset.lua:4: in function <data/talkactions/scripts/reset.lua:1>
 
Replace
Code:
return db.executeQuery("UPDATE `players` SET `posx` = ".. pos.x ..", `posy` = ".. pos.y ..", `posz` = ".. pos.z .." WHERE `name` = '".. db.escapeString(param) .."';")
 
Replace
Code:
return db.executeQuery("UPDATE `players` SET `posx` = ".. pos.x ..", `posy` = ".. pos.y ..", `posz` = ".. pos.z .." WHERE `name` = '".. db.escapeString(param) .."';")

[01/01/2010 01:00:41] mysql_real_query(): UPDATE `players` SET `posx` = 1051, `posy` = 1011, `posz` = 7 WHERE `name` = ''Darkalsmith''; - MYSQL ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Darkalsmith''' at line 1 (1064)
 
Back
Top