SA-MP Forums Archive
Not save the statistic.. - 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: Not save the statistic.. (/showthread.php?tid=571294)



Not save the statistic.. - Ytoavee - 17.04.2015

Hey!

Having trouble so that when we step out from the server does not save the data on the server player.

I'm sorry, I do not know much English, I used ****** translator

Code:
Код:
function SavePlayer(playerid) {
	if(!GetPVarInt(playerid, "Logged")) return 1;
	new weapons[13][2];
	line[0] = EOS;
	query[0] = EOS;

	for(new i = 0; i < 13; i++) {
	    GetPlayerWeaponData(playerid, i, weapons[i][0], weapons[i][1]);
		format(string, sizeof(string), "%i ", weapons[i][0]);
		strcat(line, string);
		format(string, sizeof(string), "%i ", weapons[i][1]);
		strcat(query, string);
	}
	strdel(line, strlen(line)-1, strlen(line));
	strdel(query, strlen(query)-1, strlen(query));

	new spawnplace[256];
	GetPVarString(playerid, "SpawnPlace_Data", spawnplace, sizeof(spawnplace));

	new IGZ[256];
	for(new x; x < 100; x++) strcat(IGZ, (IsIntactGZ[playerid][x] == true) ? (" 1") : (" 0"));

	format(query, sizeof(query), "UPDATE `Users` SET Money = '%i', XP = '%i', Kills = '%i', Deaths = '%i', NameColor = '%i', Time = '%i', Weapons = '%s', Ammos = '%s', Admin = '%i', Warns = '%i', Mute = '%i', SpawnPlace = '%s', IGZ = '%s' WHERE Name = '%s';",
		GetPlayerCash(playerid),
		GetPlayerXP(playerid),
		GetPVarInt(playerid, "Kills"),
		GetPVarInt(playerid, "Deaths"),
		GetPlayerColor(playerid),
		GetPlayerServerTime(playerid),
		line,
		query,
		GetPVarInt(playerid, "Admin"),
		GetPVarInt(playerid, "Warns"),
		GetPVarInt(playerid, "MuteTime"),
		spawnplace,
		IGZ[1],
		pName(playerid)
	);
	mysql_function_query(sql, query, true, "THREAD_Finish", "");
	return 1;
}



Re: Not save the statistic.. - Azula - 17.04.2015

i cant understand why line[0] = End Of string ??


Re: Not save the statistic.. - Ytoavee - 18.04.2015

I downloaded it and the way it was in it, but now I try to be without