%S is not working
#1

Hey i have /txt command when admin type /txt blabla need to show Admin: Nickname : Blablaa
but the nickname is not showing


pawn Код:
if(strcmp(cmd, "/txt", true) == 0) // By CuervO_NegrO
    {
        if (PlayerInfo[playerid][pAdmin] >= 2)
        {
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[128];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            new sendername[MAX_PLAYER_NAME]; // <<<
            GetPlayerName(playerid, sendername, MAX_PLAYER_NAME); // <<<
            result[idx - offset] = EOS;
            idx++;
            if(!strlen(result)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /txt [text]");

            format(string, sizeof(string), "* ADMIN %s: %s ",sendername,(result));
            SendClientMessageToAll(playerid, COL_WHITE, string);
            new y, m, d;
            new h,mi,s;
            getdate(y,m,d);
            gettime(h,mi,s);
        }
        return 1;
    }
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=120356
Reply
#3

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)