04.03.2017, 15:14
Hey guys, I was following this tutorial: https://sampforum.blast.hk/showthread.php?tid=505081
And now I managed to get player weapons saved into a db but I'm having some troubles with the code (Mostly because I can't find any updated MySQL R41-2 functions/commands -I'm not sure how it's called-).
Errors:
Code:
The lines with errors are the bold ones.
And by the way, I know I should add a SELECT query there but I'm not sure where specifically.
And now I managed to get player weapons saved into a db but I'm having some troubles with the code (Mostly because I can't find any updated MySQL R41-2 functions/commands -I'm not sure how it's called-).
Errors:
Код:
warning 213: tag mismatch warning 213: tag mismatch warning 213: tag mismatch
Код:
forward OnLoadPlayerWeapons(playerid);
public OnLoadPlayerWeapons(playerid)
{
new
weaponid,
ammo;
for(new i, j = cache_get_row_count(g_SQL); i < j; i++) // loop through all the rows that were found
{
weaponid = cache_get_value_int(i, 0, g_SQL);
ammo = cache_get_value_int(i, 1, g_SQL);
if(!(0 <= weaponid <= 46)) // check if weapon is valid (should be)
{
printf("[info] Warning: OnLoadPlayerWeapons - Unknown weaponid '%d'. Skipping.", weaponid);
continue;
}
GivePlayerWeapon(playerid, weaponid, ammo);
}
return;
}
And by the way, I know I should add a SELECT query there but I'm not sure where specifically.


