SendClientMessage Issue
#1

So I will explain the issue before I show the code.
I have a file which gets opened and stores a name to an array.
Then I am using a command to show the name up in SendClientMessage and it does but it has letters appearing before it which shouldn't be coming up.
So in my file I have the names printed like this:
pawn Код:
Jaxson Kildra|Thomas_Rein|Leon_Manheart|Clive_Rogers|Jaxson Kildra|Thomas_Rein|Leon_Manheart|Clive_Rogers|
Now they get stored into an array using this code which is in a function:
pawn Код:
if(file)
    {
        print("File Found!");
        fread(file, string);
        new text[128];
        for(new i = 0; i < c; i++)
        {
            split(string, SplitDiv, '|');
            print("In Loop");
            print(SplitDiv[0]);
            strmid(PlayerInfo[playerid][pFriends][i], SplitDiv[0], 0, strlen(SplitDiv[0]));
            strins(PlayerInfo[playerid][pFriends][i], SplitDiv[0], 0);
            format(text, sizeof(text), "PlayerInfo[playerid][pFriends][%d] = %s", i, PlayerInfo[playerid][pFriends][i]);
            print(text);
            strdel(string, -1, strlen(SplitDiv[0]));
        }
        print("Finished Loop");
        fclose(file);
        print("Closed File");
    }
Now when I check console, it prints the text fine.

Now I have only one command to preview the name to test if it works.
pawn Код:
new string[128];
SendClientMessage(playerid, COLOR_WHITE, PlayerInfo[playerid][pFriends][1]);
return 1;
}
But the thing is when I do that, it prints the text as:
pawn Код:
TLCJTLClive_Rogers
Does anyone know how I can fix this?
Reply


Messages In This Thread
SendClientMessage Issue [REP++] - by Deduction - 13.12.2013, 02:48
Re: SendClientMessage Issue - by Emmet_ - 13.12.2013, 02:58
Re: SendClientMessage Issue - by Excelize - 13.12.2013, 03:02
Re: SendClientMessage Issue - by Emmet_ - 13.12.2013, 03:04
Re: SendClientMessage Issue - by Deduction - 13.12.2013, 03:13
Re: SendClientMessage Issue - by Deduction - 13.12.2013, 06:23
Re: SendClientMessage Issue - by Vince - 13.12.2013, 08:49
Re: SendClientMessage Issue - by Deduction - 14.12.2013, 18:13

Forum Jump:


Users browsing this thread: 2 Guest(s)