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

Does this function exist

Jgarder

Tprogramming Ex-Adm|n
Premium User
Joined
Jun 7, 2007
Messages
355
Reaction score
3
Location
Michigan
i want to know if there is a function exactly like docreaturesay.. but it operates off of location and not by CID.. i need to write long things for my tutorial :/

Code:
function onSay(cid, words, param, channel)
	if (isPlayer(cid) == true) then
----------
doCreatureSay({x=866,y=591,z=7},'In this area i can make long messages appear anywhere i need!',19)
doCreatureSay(cid,'In this area i can make long messages appear anywhere i need!',19)
------------	
	end
	return true
end
 
It can be done in TFS 0.3 - there has been added few optional parameters, including position.

doCreatureSay(uid, text[, type = SPEAK_SAY[, ghost = false[, cid = 0[, pos]]]])

You can also use doSendAnimatedText, but its limited to 10 characters or even less.
 
Great! thanks a million


It can be done in TFS 0.3 - there has been added few optional parameters, including position.

doCreatureSay(uid, text[, type = SPEAK_SAY[, ghost = false[, cid = 0[, pos]]]])

You can also use doSendAnimatedText, but its limited to 10 characters or even less.
 
double post.. Hey slawkens.. i have a question

Code:
	//doCreatureSay(uid, text[, type = SPEAK_SAY[, ghost = false[, cid = 0[, pos]]]])
	uint32_t params = lua_gettop(L), cid = 0, uid = 0;
	PositionEx pos;
	if(params > 5)
		popPosition(L, pos);

why does it only pop the pos if there is 5 paramters.. why doesnt it say
Code:
	//doCreatureSay(uid, text[, type = SPEAK_SAY[, ghost = false[, cid = 0[, pos]]]])
	uint32_t params = lua_gettop(L), cid = 0, uid = 0;
	PositionEx pos;
	[color=red]if pos > nil then[/color]
		popPosition(L, pos);

and the same goes for the rest of the optional variables.. because i cannot get it to popposition unless i have all 5 parameters defined..
 
Because position is fifth param in that lua function:
//doCreatureSay(uid, text[, type = SPEAK_SAY[, ghost = false[, cid = 0[, pos]]]])

doCreatureSay(cid, "text", SPEAK_SAY, false, 0, THE_POSITION)
 
Because position is fifth param in that lua function:
//doCreatureSay(uid, text[, type = SPEAK_SAY[, ghost = false[, cid = 0[, pos]]]])

doCreatureSay(cid, "text", SPEAK_SAY, false, 0, THE_POSITION)


im well aware of that.. but you missed my point entirely.. i am forced to use all of the optional parameters just so i have all 6 paramters.. instead of just being able to define pos=THE_POSITION and have only 2-3 parameters..
 
//doCreatureSay(uid, text[, type = SPEAK_SAY[, ghost = false[, cid = 0[, pos]]]])
third param = type = optional => default SPEAK_SAY => set to SPEAK_SAY = no change
ghost default = false => set false => no change
cid default = 0 => set 0 => no change
pos defaul = no default pos => set your pos => be happy with arrows => ;d => :( sad
 
double post.. Hey slawkens.. i have a question

Code:
	//doCreatureSay(uid, text[, type = SPEAK_SAY[, ghost = false[, cid = 0[, pos]]]])
	uint32_t params = lua_gettop(L), cid = 0, uid = 0;
	PositionEx pos;
	if(params > 5)
		popPosition(L, pos);

why does it only pop the pos if there is 5 paramters.. why doesnt it say
Code:
	//doCreatureSay(uid, text[, type = SPEAK_SAY[, ghost = false[, cid = 0[, pos]]]])
	uint32_t params = lua_gettop(L), cid = 0, uid = 0;
	PositionEx pos;
	[color=red]if pos > nil then[/color]
		popPosition(L, pos);

and the same goes for the rest of the optional variables.. because i cannot get it to popposition unless i have all 5 parameters defined..

It cannot be. The same way it works in all modern languages. Just do as @Rhux said.
 
Use lil` replacement if it's really problem to use 6 params...
Code:
function doCreatureSayAway(cid, text, type, position)
	return doCreatureSay(cid, text, type, false, 0, position)
end

xD!
 
Back
Top