Function Error
#1

I get an error by this function, on the red line.

Код:
stock SaveAccount(playerid)
{
        format(largequery, sizeof(largequery), "UPDATE `accounts` SET `username` = '%s', `spassword` = '%s', `emailaddress` = '%s', `ipaddress` = '%s', `language` = '%d',
	`age` = '%d', `carlicense` = '%d', `flylicense` = '%d', `boatlicense` = '%d', `viprank` = '%d', `ownedproperties` = '%d', `warnreason1` = '%s', `warnreason2` = '%s',
	`warnreason3` = '%s', `serversounds` = '%d', `phone` = '%d', `positionx` = '%f', `positiony` = '%f', `positionz` = '%f', `interior` = '%f', `lastseen` = '%f' 
	WHERE `identification` = '%d'", PlayerName[playerid], AccountInfo[playerid][spassword], AccountInfo[playerid][emailaddress], AccountInfo[playerid][ipaddress],
	AccountInfo[playerid][language], AccountInfo[playerid][age], AccountInfo[playerid][carlicense], AccountInfo[playerid][flylicense], AccountInfo[playerid][boatlicense],
	AccountInfo[playerid][viprank], AccountInfo[playerid][ownedproperties], AccountInfo[playerid][warnreason1], AccountInfo[playerid][warnreason2], AccountInfo[playerid][warnreason3],
	AccountInfo[playerid][serversounds], AccountInfo[playerid][phone], AccountInfo[playerid][positionx], AccountInfo[playerid][postiony], AccountInfo[playerid][positionz],
	AccountInfo[playerid][interior], AccountInfo[playerid][lastseen], AccountInfo[playerid][identification]);
	mysql_query(query);
}
error 037: invalid string (possibly non-terminated string)
error 017: undefined symbol "UPDATE"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Reply
#2

and error is...?
Reply
#3

Stupid xD
Reply
#4

I don't see It xDDDD

hmm. try update not UPDATE

or add new update[128]; (I'm not pro scripter)
Reply
#5

That doesn't work, the array of variable 'largequery' is 600
Reply
#6

Or it this not support with pawno?
Reply
#7

I tried this, and it will fix te errors, but I won't save the account..

Код:
stock SaveAccount(playerid)
{
    format(largequery, sizeof(largequery), "UPDATE `accounts` SET `username` = '%s', `spassword` = '%s', `emailaddress` = '%s', `ipaddress` = '%s', `language` = '%d', `autologin` = '%d'", PlayerName[playerid], AccountInfo[playerid][spassword], AccountInfo[playerid][emailaddress], AccountInfo[playerid][ipaddress], AccountInfo[playerid][language], AccountInfo[playerid][autologin]);
	format(largequery, sizeof(largequery), "%s, `age` = '%d', `carlicense` = '%d', `flylicense` = '%d', `boatlicense` = '%d', `viprank` = '%d', `ownedproperties` = '%d'",largequery, AccountInfo[playerid][age], AccountInfo[playerid][carlicense], AccountInfo[playerid][flylicense], AccountInfo[playerid][boatlicense], AccountInfo[playerid][viprank], AccountInfo[playerid][ownedproperties]);
	format(largequery, sizeof(largequery), "%s, `warnreason1` = '%s', `warnreason2` = '%s', `warnreason3` = '%s', `serversounds` = '%d', `phone` = '%d'",largequery, AccountInfo[playerid][warnreason1], AccountInfo[playerid][warnreason2], AccountInfo[playerid][warnreason3],AccountInfo[playerid][serversounds], AccountInfo[playerid][phone]);
	format(largequery, sizeof(largequery), "%s, `positionx` = '%f', `positiony` = '%f', `positionz` = '%f', `interior` = '%f', `lastseen` = '%s' WHERE `identification` = '%d", largequery, AccountInfo[playerid][positionx], AccountInfo[playerid][positiony], AccountInfo[playerid][positionz],AccountInfo[playerid][interior], AccountInfo[playerid][lastseen], AccountInfo[playerid][identification]);
	mysql_query(largequery);
}
Reply
#8

Код:
stock saveAccount(playerid) { 
	new
		szForumulateQuery[512]; // I put a random string size. Also, the "sz" before it is the Hungarian Notation. (Calgon got me into it)
		
	format(szFormulateQuery, sizeof(szFormulateQuery), "UPDATE `accounts` SET `username` = '%s', `spassword` = '%s', `emailaddress` = '%s', `ipaddress` = '%s', `language` = '%d', `age` = %d, `carlicense` = %d", PlayerName[playerid], AccountInfo[playerid][spassword], AccountInfo[playerid][emailaddress], AccountInfo[playerid][ipaddress], AccountInfo[playerid][language], AccountInfo[playerid][age], AccountInfo[playerid][carlicense]);
	format(szFormulateQuery, sizeof(szFormulateQuery), "%s, `flylicense` = %d, `boatlicense` = %d, `viprank` = %d, `ownedproperties` = '%d', `warnreason1` = '%s', `warnreason2` = '%s', `warnreason3` = '%s'", szFormulateQuery, AccountInfo[playerid][flylicense], AccountInfo[playerid][boatlicense], AccountInfo[playerid][viprank], AccountInfo[playerid][ownedproperties], AccountInfo[playerid][warnreason1], AccountInfo[playerid][warnreason2], AccountInfo[playerid][warnreason3]);
	format(szFormulateQuery, sizeof(szFormulateQuery), "%s, `serversounds` = %d, `phone` = '%d', `positionx` = '%f', `positiony` = '%f', `positionz` = '%f', `interior` = '%f', `lastseen` = '%f' WHERE `identification` = %d", szFormulateQuery, AccountInfo[playerid][serversounds], AccountInfo[playerid][phone], AccountInfo[playerid][positionx], AccountInfo[playerid][postiony], AccountInfo[playerid][positionz], AccountInfo[playerid][interior], AccountInfo[playerid][lastseen], AccountInfo[playerid][identification]);
	
	mysql_query(szFormulateQuery);
}
This should work.
Reply
#9

Quote:
Originally Posted by Kenoja
Посмотреть сообщение
Код:
stock saveAccount(playerid) { 
	new
		szForumulateQuery[512]; // I put a random string size. Also, the "sz" before it is the Hungarian Notation. (Calgon got me into it)
		
	format(szFormulateQuery, sizeof(szFormulateQuery), "UPDATE `accounts` SET `username` = '%s', `spassword` = '%s', `emailaddress` = '%s', `ipaddress` = '%s', `language` = '%d', `age` = %d, `carlicense` = %d", PlayerName[playerid], AccountInfo[playerid][spassword], AccountInfo[playerid][emailaddress], AccountInfo[playerid][ipaddress], AccountInfo[playerid][language], AccountInfo[playerid][age], AccountInfo[playerid][carlicense]);
	format(szFormulateQuery, sizeof(szFormulateQuery), "%s, `flylicense` = %d, `boatlicense` = %d, `viprank` = %d, `ownedproperties` = '%d', `warnreason1` = '%s', `warnreason2` = '%s', `warnreason3` = '%s'", szFormulateQuery, AccountInfo[playerid][flylicense], AccountInfo[playerid][boatlicense], AccountInfo[playerid][viprank], AccountInfo[playerid][ownedproperties], AccountInfo[playerid][warnreason1], AccountInfo[playerid][warnreason2], AccountInfo[playerid][warnreason3]);
	format(szFormulateQuery, sizeof(szFormulateQuery), "%s, `serversounds` = %d, `phone` = '%d', `positionx` = '%f', `positiony` = '%f', `positionz` = '%f', `interior` = '%f', `lastseen` = '%f' WHERE `identification` = %d", szFormulateQuery, AccountInfo[playerid][serversounds], AccountInfo[playerid][phone], AccountInfo[playerid][positionx], AccountInfo[playerid][postiony], AccountInfo[playerid][positionz], AccountInfo[playerid][interior], AccountInfo[playerid][lastseen], AccountInfo[playerid][identification]);
	
	mysql_query(szFormulateQuery);
}
This should work.
It doens't xD

error 075: input line too long (after substitutions)
error 017: undefined symbol "identificat"
warning 217: loose indentation
error 017: undefined symbol "ion"
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line
Reply
#10

Problem Resolved!

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)