SA-MP Forums Archive
Argument Type Missmatch - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Argument Type Missmatch (/showthread.php?tid=534208)



Argument Type Missmatch - adithegman - 28.08.2014

I have a problem with this function when i load the player info from the mysql server... please help

Код:
(926) : error 035: argument type mismatch (argument 4)
Код:
stock LoadPlayerInfo(playerid)
{
	new string[128],Name[MAX_PLAYER_NAME];
	GetPlayerName(playerid,Name,sizeof(Name));
	format(string,sizeof(string),"SELECT `Cash`, `Admin`, `Faction`, `Rank`, `Leader`, `FWarns`, `Radio`, `Channel`, `Slot`, `Skin`, `Kills`, `Deaths`, `Banned` FROM `users` WHERE `Username` = '%s",Name);
	mysql_tquery(MySQL,string,"OnPlayerDataLoad",playerid);
}

Skeleton::OnPlayerDataLoad(playerid)
{
	PlayerInfo[playerid][pCash] = cache_get_field_content_int(0,"Cash");
	PlayerInfo[playerid][pAdmin] = cache_get_field_content_int(0,"Admin");
	PlayerInfo[playerid][pFaction] = cache_get_field_content_int(0,"Faction");
	PlayerInfo[playerid][pRank] = cache_get_field_content_int(0,"Rank");
	PlayerInfo[playerid][pLeader] = cache_get_field_content_int(0,"Leader");
	PlayerInfo[playerid][pFWarns] = cache_get_field_content_int(0,"FWarns");
	PlayerInfo[playerid][pRadio] = cache_get_field_content_int(0,"Radio");
	PlayerInfo[playerid][pChannel] = cache_get_field_content_int(0,"Channel");
	PlayerInfo[playerid][pSlot] = cache_get_field_content_int(0,"Slot");
	PlayerInfo[playerid][pSkin] = cache_get_field_content_int(0,"Skin");
	PlayerInfo[playerid][pKills] = cache_get_field_content_int(0,"Kills");
	PlayerInfo[playerid][pDeaths] = cache_get_field_content_int(0,"Deaths");
	PlayerInfo[playerid][pBanned] = cache_get_field_content_int(0,"Banned");
	return 1;
}
Line 926:
Код:
mysql_tquery(MySQL,string,"OnPlayerDataLoad",playerid);



Re: Argument Type Missmatch - jakejohnsonusa - 28.08.2014

Is it line 926 or 296...?


Re: Argument Type Missmatch - adithegman - 28.08.2014

Quote:
Originally Posted by jakejohnsonusa
Посмотреть сообщение
Is it line 926 or 296...?
My bad, it's line 926


Re: Argument Type Missmatch - VishvaJeet - 28.08.2014

Код:
mysql_tquery(MySQL,string,"OnPlayerDataLoad","d",playerid);
Try this


Re: Argument Type Missmatch - adithegman - 28.08.2014

Quote:
Originally Posted by VishvaJeet
Посмотреть сообщение
Код:
mysql_tquery(MySQL,string,"OnPlayerDataLoad","d",playerid);
Try this
Saved my day , rep++


Re: Argument Type Missmatch - Eth - 28.08.2014

nvm :P


Re: Argument Type Missmatch - FUNExtreme - 28.08.2014

Quote:
Originally Posted by adithegman
Посмотреть сообщение
Line 926:
Код:
mysql_tquery(MySQL,string,"OnPlayerDataLoad",playerid);
tquery needs to know what kind of data you're passing to it.
Код:
mysql_tquery(MySQL,string,"OnPlayerDataLoad","d", playerid);
Here's fairly up-to-date documentation that you can check if you're unsure about the parameters:
https://sampwiki.blast.hk/wiki/MySQL/R33


Re: Argument Type Missmatch - adithegman - 28.08.2014

Quote:
Originally Posted by FUNExtreme
Посмотреть сообщение
tquery needs to know what kind of data you're passing to it.
Код:
mysql_tquery(MySQL,string,"OnPlayerDataLoad","d", playerid);
Here's fairly up-to-date documentation that you can check if you're unsure about the parameters:
https://sampwiki.blast.hk/wiki/MySQL/R33
I totally forgot that you need to specify that, big thanks to all of you