13.12.2013, 02:48
(
Последний раз редактировалось Deduction; 14.12.2013 в 18:16.
)
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:
Now they get stored into an array using this code which is in a function:
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.
But the thing is when I do that, it prints the text as:
Does anyone know how I can fix this?
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|
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 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;
}
pawn Код:
TLCJTLClive_Rogers