14.12.2013, 18:13
Quote:
Well yes, but the difference is that most of the file functions are geared to reading separate lines. For example:
pawn Код:
|
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);
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;
}
pawn Код:
JLFTAFDS
LFTAFDS
FTAFDS
TAFDS
AFDS
FDS
DS
S
pawn Код:
Jamie Walker
LOL POP
Franklin Gardener
Tom Frank
AJ Smith
Forrest Gump
Damian Adelaide
Salve Holmes
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];