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

canPlayerWearOutfit(cid, lookType, addons)

Status
Not open for further replies.

Shawak

Intermediate OT User
Joined
Sep 11, 2008
Messages
1,986
Solutions
2
Reaction score
121
Location
Germany
GitHub
Shawak
Hello, i maked a new script, and for that i searched in the doc/.. .
Then i saw this function:
LUA:
canPlayerWearOutfit(cid, lookType, addons)

So my question: Anybody know what it return? :confused:
Because "TRUE" and "FALSE" don't work, <_<.
 
PHP:
int32_t LuaScriptInterface::luaCanPlayerWearOutfit(lua_State* L)
{
	//canPlayerWearOutfit(cid, looktype, addon)
	uint32_t addon = popNumber(L), looktype = popNumber(L);

	ScriptEnviroment* env = getScriptEnv();
	if(Player* player = env->getPlayerByUID(popNumber(L)))
	{
		lua_pushboolean(L, player->canWearOutfit(looktype, addon));
		return 1;
	}

	reportErrorFunc(getErrorDesc(LUA_ERROR_PLAYER_NOT_FOUND));
	lua_pushboolean(L, false);
	return 1;
}
 
You probably haven't got TRUE and FALSE defined in constant.lua, or they have 1 and 0 values. Try:

LUA:
if (canPlayerWearOutfit(cid, lookType, addons) == true)
 
You probably haven't got TRUE and FALSE defined in constant.lua, or they have 1 and 0 values. Try:

LUA:
if (canPlayerWearOutfit(cid, lookType, addons) == true)

I'm using:
LUA:
if (canPlayerWearOutfit(cid, 128, 1) ~= true) then
  ..
  ..
  ..
else
  doPlayerSendtextMeessage(cid, 21, "<Text>")
end
And the script still tell me the "<Text>".

:(
 
are you sure that should be .... ~=

and make you sure what ir return adding

print(canPlayerWearOutfit(cid, 128, 1))

using console
 
You are using in a wrong way.
Wrong -> canPlayerWearOutfit(cid, lookType, addons)
Right -> canPlayerWearOutfit(cid, id, addons)


this id can be found at "data/XML/outfits.xml"
1595953838297.png

But how to use?
like this:
LUA:
if canPlayerWearOutfit(cid, 86, 2) == true then
doPlayerSendTextMessage(cid, 27,"You already have the addon 2 of this outfit.")
else
doPlayerSendTextMessage(cid, 27,"You dont have the addon 2 of this outfit.")
end
 
Status
Not open for further replies.
Back
Top