Argument Type Missmatch
#1

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);
Reply
#2

Is it line 926 or 296...?
Reply
#3

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

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

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

nvm :P
Reply
#7

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
Reply
#8

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)