02.12.2016, 21:59
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:
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; }