[MySQL] Problem trying to load weapons
#1

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:

Код:
warning 213: tag mismatch
warning 213: tag mismatch
warning 213: tag mismatch
Code:

Код:
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;
}
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.
Reply


Messages In This Thread
[MySQL] Problem trying to load weapons - by nikotragedy - 04.03.2017, 15:14
Re: [MySQL] Problem trying to load weapons - by X337 - 04.03.2017, 15:17
Re: [MySQL] Problem trying to load weapons - by nikotragedy - 04.03.2017, 15:19
Re: [MySQL] Problem trying to load weapons - by nikotragedy - 04.03.2017, 17:04
Re: [MySQL] Problem trying to load weapons - by Konstantinos - 04.03.2017, 17:43
Re: [MySQL] Problem trying to load weapons - by nikotragedy - 04.03.2017, 18:05

Forum Jump:


Users browsing this thread: 3 Guest(s)