10.05.2011, 15:06
(
Последний раз редактировалось jamesbond007; 10.05.2011 в 16:19.
)
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
if(PlayerInfo[playerid][Registered] == 1 && PlayerInfo[playerid][LoggedIn] == 1)
{
new pname[MAX_PLAYER_NAME], str[128];
GetPlayerName(playerid, pname, sizeof(pname));
format(str, sizeof(str),"users/%s.txt",pname);
//new score = GetPlayerScore(playerid);
new money = GetPlayerMoney(playerid);
if(fexist(str))
{
//SendClientMessageToAll(0xCCFF00,"exists");
new string[128], string2[128], string3[128], MyVal[256], File:ftw = fopen(str,io_read);
while(fread(ftw, string))
{
//SendClientMessageToAll(0xCCFF00,"reading file...");
if(strcmp(string, "money: ", false, strlen("money: ")) == 0)
{
MyVal[playerid]=GetVal(3, string);
format(string2,sizeof(string2),"%d",MyVal); // 0
format(string3,sizeof(string3),"%d",money); // 100
new string4[128];
strdel(string2, 0, strlen(string2));
SendClientMessageToAll(0xCCFF00,string5);
new func = strins(string2,string3,0);
format(string4,sizeof(string4),"string4: %d",func);
SendClientMessageToAll(0xCCFF00,string4);
}
}
}
}
return 1;
}
im trying to replace the old string with the new string to save it in a text file someone pls help i cant figure this out ! its freakin annoying =/