What is the best way for saving guns?
#1

Hello!
I'm using this method for saving gun but I'm worried about this. I want the know what's your method about saving guns?

Here is mine:

Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
	new
		tmp_accguns[13][2],
		tmp_string[64],
		query[516];

	for(new i = 0; i <= 12; i++)
	{
		GetPlayerWeaponData(playerid, i, tmp_accguns[i][0], tmp_accguns[i][1]);
	}

	for(new i = 0; i <= 12; i++)
	{
		format(tmp_string, sizeof(tmp_string), "weapon%d", i);
		mysql_format(mysql, query, sizeof(query), "UPDATE `hesaplar` SET `%s`=%d WHERE `sqlid`=%d", tmp_string, tmp_accguns[i][0], hesap[playerid][sqlid]);
		mysql_tquery(mysql, query, "", "");

		format(tmp_string, sizeof(tmp_string), "ammo%d", i);
		mysql_format(mysql, query, sizeof(query), "UPDATE `hesaplar` SET `%s`=%d WHERE `sqlid`=%d", tmp_string, tmp_accguns[i][1], hesap[playerid][sqlid]);
		mysql_tquery(mysql, query, "", "");
	}

	new
		tmp_satir[64];

    for(new i = 0; i <= 12; i++)
	{
	    format(tmp_satir, sizeof(tmp_satir), "weapon%d", i);
	    hesap_weaponlar[playerid][i][0] = cache_get_field_content_int(0 , tmp_satir);

    	format(tmp_satir, sizeof(tmp_satir), "ammo%d", i);
    	hesap_weaponlar[playerid][i][1] = cache_get_field_content_int(0 , tmp_satir);
	}
    return true;
}
Reply


Messages In This Thread
What is the best way for saving guns? - by knuckleduster5 - 02.12.2016, 21:59
Re: What is the best way for saving guns? - by knuckleduster5 - 02.12.2016, 22:33
Re: What is the best way for saving guns? - by Dayrion - 03.12.2016, 00:25
Re: What is the best way for saving guns? - by knuckleduster5 - 03.12.2016, 00:48
Re: What is the best way for saving guns? - by knuckleduster5 - 03.12.2016, 00:52
Re: What is the best way for saving guns? - by SickAttack - 03.12.2016, 01:11
Re: What is the best way for saving guns? - by Vince - 03.12.2016, 08:34
Re: What is the best way for saving guns? - by knuckleduster5 - 09.12.2016, 20:08

Forum Jump:


Users browsing this thread: 1 Guest(s)