EOSERV Forum > EOSERV > NPC Spawn Command
Topic is locked.
Page: << 1 >>
NPC Spawn Command
Author Message
Post #10932 NPC Spawn Command

Does anyone have an NPC spawn command that shows the npc for everyone that I could have? I made one but it only shows for myself and as soon as I press F12 it dissappears.

16 years, 1 week ago
Post #10942 Re: NPC Spawn Command

Yes, I haven't been able to get it to work in rev130 yet tho. If you do let me know what I'm doing wrong xD


Usage: $sn <ID> <AMT> <TYPE>


if (command.length() >= 2 && command.compare(0,2,"sn") == 0 && arguments.size() >= 1 && this->player->character->admin >= static_cast<int>(admin_config["spawn"]))
  {
  int i;
  int id = static_cast<int>(util::variant(arguments[0]));
  int amount = (arguments.size() > 1)?static_cast<int>(util::variant(arguments[1])):1;
  int x = this->player->character->x;
  int y = this->player->character->y;
  Map* map = this->player->character->map;
  int s_type = (arguments.size() > 2)?static_cast<int>(util::variant(arguments[2])):1;
  int s_time = (arguments.size() > 3)?static_cast<int>(util::variant(arguments[3])):2;
  int index = (arguments.size() > 4)?static_cast<int>(util::variant(arguments[4])):index + 1;
  if (amount > 1)
  {
  for(i = 0; i <= amount; i++)
  {
  this->player->character->map->CreateNPC(id, map, x, y, s_type, s_time, index);
  index++;
  }
  }
  else this->player->character->map->CreateNPC(id, map, x, y, s_type, s_time, index);
  }









And another code i can't get to work is the Hide/show.


  else if (command.length() >= 4 && command.compare(0,4,"hide") == 0 && arguments.size() >= 0 && this->player->character->admin >= static_cast<int>(admin_config["warptome"]))
    {

                    this->player->character->hidden = 1;
                    this->player->character->Warp(this->player->character->mapid, this->player->character->x, this->player->character->y, WARP_ANIMATION_FADE);

                    PacketBuilder builder;
                    builder.SetID(PACKET_EFFECT, PACKET_PLAYER);
                    builder.AddShort(this->player->id);
                    builder.AddShort(24);
                    builder.AddChar(0);
                    UTIL_FOREACH(the_world->characters, character)
                        {
                        character->player->client->SendBuilder(builder);
                        }


                }
                else if (command.length() >= 4 && command.compare(0,4,"show") == 0 && arguments.size() >= 0 && this->player->character->admin >= static_cast<int>(admin_config["warptome"]))
    {
                    this->player->character->hidden = 0;
                    this->player->character->Warp(this->player->character->mapid, this->player->character->x, this->player->character->y, WARP_ANIMATION_FADE);

                    PacketBuilder builder;
                    builder.SetID(PACKET_EFFECT, PACKET_PLAYER);
                    builder.AddShort(this->player->id);
                    builder.AddShort(24);
                    builder.AddChar(0);
                    UTIL_FOREACH(the_world->characters, character)
                        {
                        character->player->client->SendBuilder(builder);
                        }





These both worked in rev115 and 117, mabe you can get them to work in 130. If you do tell meh what I'm doing wrong lol







16 years, 1 week ago
Page: << 1 >>
Topic is locked.
EOSERV Forum > EOSERV > NPC Spawn Command