11.03.2011, 14:33
Hello there ServerFFS keeps sending me e-mails that I am using too much CPU,
They told me it has something to do with this part of my script:
Can anyone edit it that it does not use so much CPU?
Thanks!
They told me it has something to do with this part of my script:
Code:
public OnPlayerUpdate(playerid) { if(IsPlayerConnected(playerid)) { if(AccountInfo[playerid][aLogged] == 1) { new string3[128]; new playername3[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername3, sizeof(playername3)); format(string3, sizeof(string3), ACCOUNTS_FOLDER, playername3); new ip[20]; GetPlayerIp(playerid,ip,sizeof(ip)); new File: hFile = fopen(string3, io_write); new PlayerScore, PlayerMoney; PlayerMoney = GetPlayerMoney(playerid); PlayerScore = GetPlayerScore(playerid); AccountInfo[playerid][aScore] = PlayerScore; AccountInfo[playerid][aMoney] = PlayerMoney; if (hFile) { new var[128]; format(var, 128, "Password=%s\n", AccountInfo[playerid][aPassword]);fwrite(hFile, var); format(var, 128, "IP=%s\n",ip);fwrite(hFile, var); format(var, 128, "Level=%i\n", AccountInfo[playerid][aLevel]);fwrite(hFile, var); format(var, 128, "Score=%i\n", PlayerScore);fwrite(hFile, var); format(var, 128, "Money=%d\n", PlayerMoney);fwrite(hFile, var); format(var, 128, "Airstrike=%i\n", airstrike[playerid]);fwrite(hFile, var); format(var, 128, "Landmines=%i\n", LandMines[playerid]);fwrite(hFile, var); format(var, 128, "Rank=%i\n", Rank[playerid]);fwrite(hFile, var); fclose(hFile); } } } return 1; }
Thanks!