Jump to content

Server src, do an exec with one command ? all player do /dance5 for example..


Go to solution Solved by Denis,

Recommended Posts

  • Solution
struct DanceCommand
{
    DanceCommand() :
    {
    }

    void operator () (LPENTITY ent)
    {
        if (!ent->IsType(ENTITY_CHARACTER))
            return;

        LPCHARACTER pkChr = (LPCHARACTER) ent;
        
        const char* command = "dance 5"; // if it won't work try to replace dance 5 with /dance 5
        size_t len = strlen(command);
        interpret_command(pkChr, command, len);
    }
};

ACMD(do_new_command)
{
    char arg1[256];
    one_argument(argument, arg1, sizeof(arg1));

    DanceCommand func(ch);

    LPSECTREE sectree = ch->GetSectree();
    if (sectree)
    {
        sectree->ForEachAround(func);
    }
    else
    {
        sys_err("PURGE_ERROR.NULL_SECTREE(mapIndex=%d, pos=(%d, %d)", ch->GetMapIndex(), ch->GetX(), ch->GetY());
    }
}

  • Love 2
Link to comment
Share on other sites

Hi, thanks for your answer !

 

I've done all the job but actualy your system does not make the /dance5 thing just say "dance 5" on the white chat, I want that players around the map dance when i tip this command.

 

Thanks in advance :)

 

g6qFwXS.png

Edited by Metin2 Dev
Core X - External 2 Internal
 

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.