Example #1
0
    static bool HandleJusticeAddCommand(ChatHandler* handler, const char* args)
    {
        if (!*args)
            return false;

        Player *target = handler->getSelectedPlayer();
        if (!target)
        {
            handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
            handler->SetSentErrorMessage(true);
            return false;
        }

        // check online security
        if (handler->HasLowerSecurity(target, 0))
            return false;

        uint32 amount = (uint32) atoi(args);
        target->AddJusticePoints(amount);
        return true;
    }