number of arguments does not match definition -
Maraudeur - 25.01.2013
pawn Код:
if(Logged[playerid] == 1)
{
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
PlayerInfo[playerid][pPosX] = x;
PlayerInfo[playerid][pPosY] = y;
PlayerInfo[playerid][pPosZ] = z;
PlayerInfo[playerid][pPosA] = a;
new score = GetPlayerScore(playerid);
new money = GetPlayerMoney(playerid);
new health = GetPlayerHealth(playerid); //(1867) : warning 202: number of arguments does not match definition
new armour = GetPlayerArmour(playerid); //(1868) : warning 202: number of arguments does not match definition
new interior = GetPlayerInterior(playerid);
new virtualworld = GetPlayerVirtualWorld(playerid);
new query[300], pname[24];
GetPlayerName(playerid, pname, 24);
format(query, sizeof(query), "UPDATE playerdata SET score=%d, money=%d, health=%d, armour=%d, interior=%d, virtualworld=%d, level=%d, vip=%d, kma=%d, rank=%d, kills=%d, deaths=%d, muted=%d, skin=%d, spec=%d, duty=%d, jailed=%d, frozen=%d, mutedtimes=%d, jailedtimes=%d, frozentimes=%d, banned=%d, bannedby='%s', logins=%d, posx=%f, posy=%f, posz=%f, posa=%f WHERE user='%s'",
score,
money,
health,
armour,
interior,
virtualworld,
PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pVIP],
PlayerInfo[playerid][pKMA],
PlayerInfo[playerid][pRank],
PlayerInfo[playerid][pKills],
PlayerInfo[playerid][pDeaths],
PlayerInfo[playerid][pMuted],
PlayerInfo[playerid][pSkin],
PlayerInfo[playerid][pSpec],
PlayerInfo[playerid][pDuty],
PlayerInfo[playerid][pJailed],
PlayerInfo[playerid][pFrozen],
PlayerInfo[playerid][pMutedTimes],
PlayerInfo[playerid][pJailedTimes],
PlayerInfo[playerid][pFrozenTimes],
PlayerInfo[playerid][pBanned],
PlayerInfo[playerid][pBannedBy],
PlayerInfo[playerid][pLogins],
PlayerInfo[playerid][pPosX],
PlayerInfo[playerid][pPosY],
PlayerInfo[playerid][pPosZ],
PlayerInfo[playerid][pPosA],
pname);
mysql_query(query);
}
return 1;
Re: number of arguments does not match definition -
Infinity90 - 25.01.2013
new Float:health = GetPlayerHealth(playerid,health);
new Float:armour = GetPlayerArmour(playerid,armour);
Or
new Float:hp,Float:ar;
new health = GetPlayerHealth(playerid,hp);
new armour = GetPlayerArmour(playerid,ar);
Re: number of arguments does not match definition -
Babul - 25.01.2013
GetPlayerHealth and Armour doesnt return a value, so you need to declare the variable before using the function.
Код:
new Float:health;
GetPlayerHealth(playerid,health);
...it takes 2 parameters, not 1.
Re: number of arguments does not match definition -
Maraudeur - 25.01.2013
Thanks! How do I make this line shorter/divide into several lines? I get input line too long.. =/
pawn Код:
mysql_query("CREATE TABLE IF NOT EXISTS playerdata(user VARCHAR(24), password VARCHAR(40), score INT(20), money INT(20), health INT(20), armour INT(20), interior INT(20), virtualworld INT(20), level INT(20), vip INT(20), kma INT(20), rank INT(20), kills INT(20), deaths INT(20), muted INT(20), skin INT(20), spec INT(20), duty INT(20), jailed INT(20), frozen INT(20), mutedtimes INT(20), jailedtimes INT(20), frozentimes INT(20), banned INT(20), bannedby VARCHAR(24), logins INT(20), posx INT(20), posy INT(20), posz INT(20), posa INT(20), IP VARCHAR(15) )");
Re: number of arguments does not match definition -
MP2 - 25.01.2013
Use strcat();
Re: number of arguments does not match definition -
Maraudeur - 25.01.2013
Quote:
Originally Posted by MP2
Use strcat();
|
It doesn't create the table for me :S
What did I do wrong?
pawn Код:
mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
new Query[500];
strcat(Query, "mysql_query(CREATE TABLE IF NOT EXISTS `playerdata` (\
`user` VARCHAR(24),\
`password` VARCHAR(40),\
`score` INT(20),\
`money` INT(20),\
`health` INT(20),\
`armour` INT(20),\
`interior` INT(20),");
strcat(Query, "`virtualworld` INT(20),\
`level` INT(20),\
`vip` INT(20),\
`kma` INT(20),\
`rank` INT(20),\
`kills` INT(20),\
`deaths` INT(20),\
`muted` INT(20),\
`skin` INT(20),");
strcat(Query, "`spec` INT(20),\
`duty` INT(20),\
`jailed` INT(20),\
`frozen` INT(20),\
`mutedtimes` INT(20),\
`jailedtimes` INT(20),\
`frozentimes` INT(20),\
`banned` INT(20),\
`bannedby` VARCHAR(24),");
strcat(Query, "`logins` INT(20),\
`posx` INT(20),\
`posy` INT(20),\
`posz` INT(20),\
`posa` INT(20),\
`IP` VARCHAR(15),\
PRIMARY KEY (`playerdata`)) ENGINE=MyISAM DEFAULT CHARSET=latin1;");
mysql_query(Query);
mysql_debug(1);