FU

[rev 3086~] /skull

Por Fusion32, 15 de abr. de 2008 em Linguagens de Programação

7
2.6k
Fusion32F
15 de abril de 2008 às 21:53

eae galera eu venho traze um comando que eu acho que pode ajudar mtu gm por ai

 

server usado foi avesta revisão 3086

 

ai vai o code

 

adicione em commands.cpp depois de

 

{"/raid",&Commands::forceRaid},

 

adicione

 

{"/skull",&Commands::changeSkull},

 

no final do arquivo adicione

 

bool Commands::changeSkull(Creature* creature, const std::string& cmd, const std::string& param)
{
std::stringstream msg, param_stream(param);
std::string name, skullType, skull;

if(!getline(param_stream, name, ','))
{
	if(creature && creature->getPlayer()) creature->getPlayer()->sendCancel("No player specified.");
	return false;
}
Player* player = game->getPlayerByName(name);
if(!player)
{
	if(creature && creature->getPlayer()) creature->getPlayer()->sendCancel("Player is not online.");
	return false;
}

param_stream >> skullType;

if(skullType == "white"){
	Tile* tile = player->getTile();
	if(!tile->hasFlag(TILESTATE_PROTECTIONZONE)){
		player->pzLocked = true;
		player->addInFightTicks();
		player->setSkull(SKULL_WHITE);
		player->sendTextMessage(MSG_INFO_DESCR, "You have a white skull now.");
	}
	else{
		creature->getPlayer()->sendTextMessage(MSG_STATUS_CONSOLE_BLUE, "This player is on a pz tile.");
		return false;
	}
}
else if(skullType == "red"){
	player->redSkullTicks = 3 * 60 * 60 * 1000;
	player->setSkull(SKULL_RED);
	player->sendTextMessage(MSG_INFO_DESCR, "You have a red skull now.");
}
else if(skullType == "noskull"){
	player->redSkullTicks = 0;
	player->setSkull(SKULL_NONE);
	player->sendTextMessage(MSG_INFO_DESCR, "Your skull has been removed.");
}
else{
	creature->getPlayer()->sendTextMessage(MSG_STATUS_CONSOLE_BLUE, "This isn\'t a valid skull type.");
	return false;
}

g_game.updateCreatureSkull(player);

return true;
}

 

 

e agora pra finalizar em commands.h abaixo de

 

bool forceRaid(Creature* creature, const std::string& cmd, const std::string& param);

 

adicione

 

bool changeSkull(Creature* creature, const std::string &cmd, const std::string &param);

 

a e nao se esqueçam de por em commands.xml

 

<command cmd="/skull" 			  access="3"/>		-- Change player skull example : "/skull Fusion, white"

 

caso encontrem bugs por favor postem para eu poder corrigo-lo

 

flw

Editado Maio 14 por Fusion32

2 meses depois...
satan666S
21 de junho de 2008 às 11:20

ou manow ond eu encontro comands.cpp?

Abacate123A
21 de junho de 2008 às 11:59

@Marcryzius

na pasta das source...

 

 

legal o /skull...

1 mês depois...
ShenlongS
21 de julho de 2008 às 13:49

Boa gostei do CODE

vou usar no meu server

valeu mesmo mano :D

gareG
27 de julho de 2008 às 12:35

Otimos comandos ;x :smile_positivo:

7 meses depois...
FuctureF
26 de fevereiro de 2009 às 20:08

muito bom em!!!

ajudo demais!

gostei desse comando :party:

:positive:

9517539
02 de março de 2009 às 16:43

Onde axu a pasta das sources (desculpe se a pergunta e muito NB)