SA-MP Forums Archive
%S is not working - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: %S is not working (/showthread.php?tid=417456)



%S is not working - Vizi - 21.02.2013

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;
    }



Re: %S is not working - Vince - 21.02.2013

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


Re: %S is not working - Vizi - 21.02.2013