SendClientMessage Issue
#8

Quote:
Originally Posted by Vince
Посмотреть сообщение
Well yes, but the difference is that most of the file functions are geared to reading separate lines. For example:
pawn Код:
new count;
while(fread(file, PlayerInfo[playerid][pFriends][count], MAX_PLAYER_NAME) && count < c)
{
    count++;
}
That would completely eliminate the need for split, strmid and who know whatever else.
So I did exactly that.

pawn Код:
new c = friendly[playerid];
    if(file)
    {
        new count;
        while(fread(file, PlayerInfo[playerid][pFriends][count], MAX_PLAYER_NAME) && count <= c)
        {
            print(PlayerInfo[playerid][pFriends][count]);
            count++;
        }
        fclose(file);
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "File: Error Found!");
    }
    fclose(file);
Thats for loading the players. Which it works fine when it prints. Shows name correctly.

But then when I do a command to see the players which is this one:
pawn Код:
CMD:seefriends(playerid, params[])
{
    new c = friendly[playerid];
    for(new i = 0; i < c; i++)
    {
        format(msg, sizeof(msg), "%s", PlayerInfo[playerid][pFriends][i]);
        SendClientMessage(playerid, COLOR_WHITE, msg);
        print(msg);
    }
    return 1;
}
It ends up returning the names like this in console and ingame:
pawn Код:
JLFTAFDS
LFTAFDS
FTAFDS
TAFDS
AFDS
FDS
DS
S
The Names of the Players are in this format in the .ini file.
pawn Код:
Jamie Walker
LOL POP
Franklin Gardener
Tom Frank
AJ Smith
Forrest Gump
Damian Adelaide
Salve Holmes
Here is the PlayerInfo enum:
pawn Код:
enum p_Info
{
    pRegistered,
    pCash,
    pSkin,
    pLevel,
    pExp,,
    pAdmin,
    pInt,
    pWorld,
    pBanned,
    pWarns,
    Float:pPosX,
    Float:pPosY,
    Float:pPosZ,
    Float:pPosA,
    pDied,
    pUpgrade,
    Float:pSHealth,
    pCrashed,
    Float:pArmour,
    pHasArmour,
    pFriends[2000]
};
new PlayerInfo[MAX_PLAYERS][p_Info];
Does anyone have any idea?
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: 1 Guest(s)