warning 202: number of arguments does not match definition
#1

Hello i keep getting this warning: gm.pwn(3966) : warning 202: number of arguments does not match definition

line: mysql_tquery(connectionID, queryBuffer);

anyone can help me i +REP
Reply
#2

https://sampwiki.blast.hk/wiki/MySQL#mysql_tquery
(MySQL:handle, const query[], const callback[] = "", const format[] = "", {Float,_}:...)

MySQL:handle The connection handle this will be processed on.
const query[] The query you want to execute.
const callback[] The query you want to process (optional).
const format[] The format specifier string (optional).
{Float,_}:... Indefinite number of arguments (optional).
Reply
#3

Do you have the latest version of MySQL? Older versions don't have the callback and format arguments defaulted to "" if I remember correctly.
Reply
#4

sorry i didint understand but here is the full code

Код HTML:
GiveJobSkill(playerid, jobid)
{
	new level = GetJobLevel(playerid, jobid);

	switch(jobid)
	{
		case JOB_COURIER:
		{
		    PlayerInfo[playerid][pCourierSkill]++;

	    	mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET courierskill = courierskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]);
			mysql_tquery(connectionID, queryBuffer);

			if(GetJobLevel(playerid, jobid) != level)
			{
			    SendClientMessageEx(playerid, COLOR_GREEN, "Your courier skill level is now %i/5. You will deliver more products and earn more money now.", level + 1);
			}
		}
		case JOB_FISHERMAN:
		{
		    PlayerInfo[playerid][pFishingSkill]++;

			mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fishingskill = fishingskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]);
			mysql_tquery(connectionID, queryBuffer);

			if(GetJobLevel(playerid, jobid) != level)
			{
				SendClientMessageEx(playerid, COLOR_GREEN, "Your fishing skill level is now %i/5. You will catch bigger fish and your cooldowns are reduced.", level + 1);
			}
		}
		case JOB_BODYGUARD:
		{
		    PlayerInfo[playerid][pGuardSkill]++;

            mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET guardskill = guardskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]);
			mysql_tquery(connectionID, queryBuffer);

			if(GetJobLevel(playerid, jobid) != level)
			{
			    SendClientMessageEx(playerid, COLOR_GREEN, "Your bodyguard skill level is now %i/5. Vests that you sell will now contain extra armor.", level + 1);
			}
		}
		case JOB_WEAPONDEALER:
		{
		    PlayerInfo[playerid][pWeaponSkill]++;

            mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weaponskill = weaponskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]);
			mysql_tquery(connectionID, queryBuffer);

			if(GetJobLevel(playerid, jobid) != level)
			{
			    SendClientMessageEx(playerid, COLOR_GREEN, "Your weapons dealer skill level is now %i/5. You have unlocked more weapons.", level + 1);
			}
		}
		case JOB_MECHANIC:
		{
		    PlayerInfo[playerid][pMechanicSkill]++;

            mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET mechanicskill = mechanicskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]);
			mysql_tquery(connectionID, queryBuffer);

			if(GetJobLevel(playerid, jobid) != level)
			{
			    SendClientMessageEx(playerid, COLOR_GREEN, "Your mechanic skill level is now %i/5. You will now pay less for components.", level + 1);
			}
		}
		case JOB_DRUGDEALER:
		{
		    PlayerInfo[playerid][pSmugglerSkill]++;

            mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET smugglerskill = smugglerskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]);
			mysql_tquery(connectionID, queryBuffer);

			if(GetJobLevel(playerid, jobid) != level)
			{
			    SendClientMessageEx(playerid, COLOR_GREEN, "Your drug smuggler skill level is now %i/5. You will now earn more cash for smuggling.", level + 1);
			}
		}
		case JOB_LAWYER:
		{
		    PlayerInfo[playerid][pLawyerSkill]++;

            mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET lawyerskill = lawyerskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]);
			mysql_tquery(connectionID, queryBuffer);

			if(GetJobLevel(playerid, jobid) != level)
			{
			    SendClientMessageEx(playerid, COLOR_GREEN, "Your lawyer skill level is now %i/5. Your cooldown times are reduced and you can free people for more time.", level + 1);
			}
		}
		case JOB_DETECTIVE:
		{
		    PlayerInfo[playerid][pDetectiveSkill]++;

            mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET detectiveskill = detectiveskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]);
			mysql_tquery(connectionID, queryBuffer);

			if(GetJobLevel(playerid, jobid) != level)
			{
			    SendClientMessageEx(playerid, COLOR_GREEN, "Your detective skill level is now %i/5. Your cooldown times are now reduced.", level + 1);
			}
		}
	}
}
Reply
#5

sorry i didint understand but here is the full code

Код HTML:
GiveJobSkill(playerid, jobid)
{
	new level = GetJobLevel(playerid, jobid);

	switch(jobid)
	{
		case JOB_COURIER:
		{
		    PlayerInfo[playerid][pCourierSkill]++;

	    	mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET courierskill = courierskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]);
			mysql_tquery(connectionID, queryBuffer);

			if(GetJobLevel(playerid, jobid) != level)
			{
			    SendClientMessageEx(playerid, COLOR_GREEN, "Your courier skill level is now %i/5. You will deliver more products and earn more money now.", level + 1);
			}
		}
		case JOB_FISHERMAN:
		{
		    PlayerInfo[playerid][pFishingSkill]++;

			mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fishingskill = fishingskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]);
			mysql_tquery(connectionID, queryBuffer);

			if(GetJobLevel(playerid, jobid) != level)
			{
				SendClientMessageEx(playerid, COLOR_GREEN, "Your fishing skill level is now %i/5. You will catch bigger fish and your cooldowns are reduced.", level + 1);
			}
		}
		case JOB_BODYGUARD:
		{
		    PlayerInfo[playerid][pGuardSkill]++;

            mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET guardskill = guardskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]);
			mysql_tquery(connectionID, queryBuffer);

			if(GetJobLevel(playerid, jobid) != level)
			{
			    SendClientMessageEx(playerid, COLOR_GREEN, "Your bodyguard skill level is now %i/5. Vests that you sell will now contain extra armor.", level + 1);
			}
		}
		case JOB_WEAPONDEALER:
		{
		    PlayerInfo[playerid][pWeaponSkill]++;

            mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weaponskill = weaponskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]);
			mysql_tquery(connectionID, queryBuffer);

			if(GetJobLevel(playerid, jobid) != level)
			{
			    SendClientMessageEx(playerid, COLOR_GREEN, "Your weapons dealer skill level is now %i/5. You have unlocked more weapons.", level + 1);
			}
		}
		case JOB_MECHANIC:
		{
		    PlayerInfo[playerid][pMechanicSkill]++;

            mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET mechanicskill = mechanicskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]);
			mysql_tquery(connectionID, queryBuffer);

			if(GetJobLevel(playerid, jobid) != level)
			{
			    SendClientMessageEx(playerid, COLOR_GREEN, "Your mechanic skill level is now %i/5. You will now pay less for components.", level + 1);
			}
		}
		case JOB_DRUGDEALER:
		{
		    PlayerInfo[playerid][pSmugglerSkill]++;

            mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET smugglerskill = smugglerskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]);
			mysql_tquery(connectionID, queryBuffer);

			if(GetJobLevel(playerid, jobid) != level)
			{
			    SendClientMessageEx(playerid, COLOR_GREEN, "Your drug smuggler skill level is now %i/5. You will now earn more cash for smuggling.", level + 1);
			}
		}
		case JOB_LAWYER:
		{
		    PlayerInfo[playerid][pLawyerSkill]++;

            mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET lawyerskill = lawyerskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]);
			mysql_tquery(connectionID, queryBuffer);

			if(GetJobLevel(playerid, jobid) != level)
			{
			    SendClientMessageEx(playerid, COLOR_GREEN, "Your lawyer skill level is now %i/5. Your cooldown times are reduced and you can free people for more time.", level + 1);
			}
		}
		case JOB_DETECTIVE:
		{
		    PlayerInfo[playerid][pDetectiveSkill]++;

            mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET detectiveskill = detectiveskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]);
			mysql_tquery(connectionID, queryBuffer);

			if(GetJobLevel(playerid, jobid) != level)
			{
			    SendClientMessageEx(playerid, COLOR_GREEN, "Your detective skill level is now %i/5. Your cooldown times are now reduced.", level + 1);
			}
		}
	}
}
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)