Not showing sendername..
#1

Well this emote cmd is not showing the sender name but just the actions...

here is my code

pawn Код:
if(strcmp(cmd, "/me", true) == 0)
    {
            GetPlayerName(playerid, sendername, sizeof(sendername));
            new length = strlen(cmdtext);
            while ((idx < length) && (cmdtext[idx] <= ' '))
            {
                idx++;
            }
            new offset = idx;
            new result[64];
            while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
            {
                result[idx - offset] = cmdtext[idx];
                idx++;
            }
            result[idx - offset] = EOS;
            if(!strlen(result))
            {
                SendClientMessage(playerid, GREEN, "USAGE: /me [action]");
                return 1;
            }
            format(string, sizeof(string), "* %s %s", sendername, result);
            printf("%s", string);
            SendClientMessageToAll(COLOR_PURPLE, result);
            return 1;
    }
If someone can help me im apreciate..
Reply
#2

pawn Код:
SendClientMessageToAll(COLOR_PURPLE, result);
Here you're sending the "result" string, not the "string" string. Guess that's your error, good luck
Reply
#3

Thank you Hiddos problem solved the "string" is getting the sender name and result my bad lol "Edit"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)