15.08.2013, 22:53
hello guys!
sorry about my english..
i tried to cut my String but i cant store it in the variable..
(btw, im doing this cut to cut the \r\n)
this is the code
i did some checks and i saw that the variable PlayerInfo[playerid][IP] does not have any value ( i mean "")
so i tried another way:
and now it works!
my question is why in the first try it ddidnt work?
btw the enum is:
the variable is:
thanks for all helpers
sorry about my english..
i tried to cut my String but i cant store it in the variable..
(btw, im doing this cut to cut the \r\n)
Код:
new File:myfile = fopen(file(playerid), io_read); while (fread(myfile, String)) { if(!strcmp(String, "IP", false, strlen("IP"))) strmid(PlayerInfo[playerid][IP], String, strlen("IP="), strlen(String) - 2); }
i did some checks and i saw that the variable PlayerInfo[playerid][IP] does not have any value ( i mean "")
so i tried another way:
Код:
new File:myfile = fopen(file(playerid), io_read); while (fread(myfile, String)) { if(!strcmp(String, "IP", false, strlen("IP"))) { new string[100]; strmid(string, String, strlen("IP="), strlen(String) - 2); format(PlayerInfo[playerid][IP], 20, string); } }
my question is why in the first try it ddidnt work?
btw the enum is:
Код:
enum pInfo { ... IP[30], ... }
Код:
new PlayerInfo[MAX_PLAYERS][IP]
![Smiley](images/smilies/smile.png)