• 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 player town. +rep

calveron

Bravemansworld
Joined
Feb 5, 2008
Messages
165
Reaction score
13
Location
Sweden
Hello! I need a script that shows the players town that you are looking at.

Example: You see bajs (level 666) he is a druid. he is a citizen of venore.

plx help :D
 
PokemonOnline much blx?

Also; it's would not be just lua. C++ would be required too. Description would also to be needed everytime the player would change its homecity.. I'm not quite sure, I'd have to check the sources. If nobody else helps you, I will.
 
Code:
s << (sex % 2 ? "He" : "She") << " is " << "citizen of " << Town* _town = Towns::getInstance()->getTown(town)->getName());
 
Also; it's would not be just lua. C++ would be required too.

It is only LUA, but you need to be Lua's friend xD
But it only works if you use one of the latest TFS.

Go to Creaturescripts/scripts and open "login.lua" and add this:
Lua:
registerCreatureEvent(cid, "Look")
before
Lua:
return true

Now add to creaturescripts/creaturescripts.xml:
Code:
<event type="look" name="Look" event="script" value="look.lua"/>

And in creaturescripts/scripts create "look.lua".

Add this in "look.lua":
Lua:
function onLook(cid, thing, position, lookDistance)
	if isPlayer(thing.uid) == true then
		local vocation = string.lower(getPlayerVocationName(thing.uid))
		if thing.uid ~= cid then
			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You see "..getPlayerName(thing.uid).." (Level "..getPlayerLevel(thing.uid).."). He is "..getArticle(vocation).." "..vocation..". He is from "..getTownName(getPlayerTown(thing.uid))..".")
		else
				doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR,"You see yourself. You are "..getArticle(vocation).." "..vocation..". You are from "..getTownName(getPlayerTown(thing.uid))..".")
		end
		return FALSE
	end
return TRUE
end

Rep+ if I helped you.
 
Can anyone redo for TFS 1.2?
Amusingly, I just did this for another person recently.
Check here
 
Back
Top