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

/newtype

Edwin2705

Nothing :)
Joined
Aug 6, 2007
Messages
32
Reaction score
1
Location
Poland -> Szczecinek
How to make this function to set looktype for other players, like this:
Code:
/newtype PLAYERNAME, OUTFITNUMBER
?????? :confused:

Code:
bool Commands::newType(Creature* creature, const std::string& cmd, const std::string& param)
{
	Player* player = creature->getPlayer();
	int32_t lookType = atoi(param.c_str());
	if(player)
	{
		if(lookType < 0 || lookType == 1 || lookType == 135 || lookType > 160 && lookType < 192 || lookType > 282)
			player->sendTextMessage(MSG_STATUS_SMALL, "This looktype does not exist.");
		else
		{
			g_game.internalCreatureChangeOutfit(creature, (const Outfit_t&)lookType);
			return true;
		}
	}
	return false;
}

Please help me!
 
Hehe, good idea ;>

I'll try make it.

#Edit

Try this:
Code:
bool Commands::newType(Creature* creature, const std::string& cmd, const std::string& param)
{
	boost::char_separator<char> sep(",");
	tokenizer cmdtokens(param, sep);
	tokenizer::iterator cmdit = cmdtokens.begin();
	std::string param1, param2;
	param1 = parseParams(cmdit, cmdtokens.end());
	param2 = parseParams(cmdit, cmdtokens.end());
	trimString(param1);
	trimString(param2);
	Player* player = creature->getPlayer();
	int32_t lookType = atoi(param2.c_str());
	if(player)
	{
		Player* paramPlayer = g_game.getPlayerByName(param1);
		if(paramPlayer)
		{
			if(lookType < 0 || lookType == 1 || lookType == 135 || lookType > 160 && lookType < 192 || lookType > 283)
				player->sendTextMessage(MSG_STATUS_SMALL, "This looktype does not exist.");
			else
			{
				g_game.internalCreatureChangeOutfit(paramPlayer, (const Outfit_t&)lookType);
				return true;
			}
		}
		else
			player->sendTextMessage(MSG_STATUS_SMALL, "Couldn't find target.");
	}
	return false;
}
 
Last edited:
Back
Top