08.12.2014, 19:19
Hmm, i got this error when try remove "inline_playerid": error 017: undefined symbol "mysql_tquery_inline"
But it's work fine when i use old way
Already try to replace using inline LoadWeaponData to "LoadWeaponData" and got: warning 213: tag mismatch
P/S: MYSQL r39-2 and YSI 4.0 last version
pawn Код:
stock LoadPlayerWeapon(playerid)
{
new query[255];
inline LoadWeaponData()
{
if(cache_num_rows() > 0)
{
for(new i = 0; i < 12; i++)
{
new gstr[32];
format(gstr, sizeof gstr, "Weapon%d", i + 1);
pInfo[playerid][pGun][i] = cache_get_field_content_int(0, gstr, MySQL);
format(gstr, sizeof gstr, "Ammo%d", i + 1);
pInfo[playerid][pGunAmmo][i] = cache_get_field_content_int(0, gstr, MySQL);
if(pInfo[playerid][pGun][i] > 0 && pInfo[playerid][pGunAmmo][i] > 0)
{
GivePlayerWeapon(playerid, pInfo[playerid][pGun][i], pInfo[playerid][pGunAmmo][i]);
}
}
}
}
mysql_format(MySQL, query, sizeof query, "SELECT * FROM player_weapon WHERE UserId = %d LIMIT 1", pInfo[playerid][pID]);
mysql_tquery_inline(MySQL, query, using inline LoadWeaponData);
}
pawn Код:
stock LoadPlayerWeapon(playerid)
{
new query[255];
inline LoadWeaponData(lwd_pid)
{
#pragma unused lwd_pid
if(cache_num_rows() > 0)
{
for(new i = 0; i < 12; i++)
{
new gstr[32];
format(gstr, sizeof gstr, "Weapon%d", i + 1);
pInfo[playerid][pGun][i] = cache_get_field_content_int(0, gstr, MySQL);
format(gstr, sizeof gstr, "Ammo%d", i + 1);
pInfo[playerid][pGunAmmo][i] = cache_get_field_content_int(0, gstr, MySQL);
if(pInfo[playerid][pGun][i] > 0 && pInfo[playerid][pGunAmmo][i] > 0)
{
GivePlayerWeapon(playerid, pInfo[playerid][pGun][i], pInfo[playerid][pGunAmmo][i]);
}
}
}
}
mysql_format(MySQL, query, sizeof query, "SELECT * FROM player_weapon WHERE UserId = %d LIMIT 1", pInfo[playerid][pID]);
mysql_tquery_inline(MySQL, query, using inline LoadWeaponData, "i", playerid);
}
P/S: MYSQL r39-2 and YSI 4.0 last version