SA-MP Forums Archive
Refreshing files? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Refreshing files? (/showthread.php?tid=371062)



Refreshing files? - Guitar - 22.08.2012

Hello guys,

I'm using y_ini for saving accounts, now I want to change the money from the file of a player's account in scriptfiles, but after the change I want to refresh his account, how can I do this?


Re: Refreshing files? - Akira297 - 22.08.2012

What do you mean 'refresh' his account?


Re: Refreshing files? - ThePhenix - 22.08.2012

Restart the Server...


Re: Refreshing files? - Guitar - 22.08.2012

Yes exactly, I don't want to restart the server, I just want to type a command that updates the user's file, so I won't restart it .


Re: Refreshing files? - Akira297 - 22.08.2012

This is my code :

Код:
CMD:savechars(playerid, params[])
{
	if (PlayerInfo[playerid][pAdmin] >= 4) {
		SaveEventPoints();
		SaveAccountsUpdate();
		SaveHouses();
		SendClientMessageEx(playerid, COLOR_YELLOW, "All player accounts updated successfully.");
	}
	else {
		SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use that command!");
	}
	return 1;
Here is the Timer Code for it though,

Код:
// Timer Name: SaveAccountsUpdate()
// TickRate: 5 Minutes.
Timer:SaveAccountsUpdate[300000]()
{
	new playerip[32];
	foreach(Player, i)
	{
		PlayerInfo[i][pInt] = GetPlayerInterior(i);
		PlayerInfo[i][pVW] = GetPlayerVirtualWorld(i);
		PlayerInfo[i][pChar] = PlayerInfo[i][pModel];
		GetPlayerIp(i, playerip, sizeof(playerip));
		format(PlayerInfo[i][pIP], 32, "%s", playerip);
		GetPlayerPos(i, PlayerInfo[i][pPos_x], PlayerInfo[i][pPos_y], PlayerInfo[i][pPos_z]);
		GetPlayerFacingAngle(i, PlayerInfo[i][pPos_r]);
		OnPlayerStatsUpdate(i);
	}
	SaveFamilies();
	SaveFamiliesHQ();
}



Re: Refreshing files? - Guitar - 22.08.2012

Oh, thank you, I will be checking it -- Just making another thread to see why my "/ann cmd" doesn't send a full message


Re: Refreshing files? - Akira297 - 22.08.2012

What command is suppose to be "/ann" ?