Little help!
#1

Hello my saving system in MySQL have some errors which I don`t know how to fix anyone know?
pawn Код:
UpdateAccount(playerid)
{
    new Query[710];
    printf("IP: %s",pIP[playerid]);
    printf("Admin: %d",pInfo[playerid][pAdmin]);
    printf("Kills: %d",pInfo[playerid][pKills]);
    printf("Deaths: %d",pInfo[playerid][pDeaths]);
    printf("Money: %d",GetPlayerMoney(playerid));
    printf("Score: %d",GetPlayerScore(playerid));
    printf("Vip: %d",pInfo[playerid][pVip]);
    printf("CaptureZones: %d",pInfo[playerid][pCaptureZones]);
    printf("Ecstasy: %d",pInfo[playerid][pEcstasy]);
    printf("Cocaine: %d",pInfo[playerid][pCocaine]);
    printf("Heroin: %d",pInfo[playerid][pHeroin]);
    printf("Mod Shorter: %d",pMod[playerid][ShorterTimeForCapture]);
    format(Query, sizeof(Query),"UPDATE `users` SET \
    `IP` = '%s', \
    `Admin` = '%d',\
    `Kills` = '%d', \
    `Deaths` = '%d', \
    `Money` = '%d', \
    `Score` = '%d', \
    `Vip` = '%d', \
    `CaptureZones` = '%d', \
    `Ecstasy` = '%d', \
    `Cocaine` = '%d', \
    `Heroin` = '%d', \
    `KillingACH` = '%d', \
    `CapturingACH` = '%d', \
    `CaptureTime` = '%d', \
    `SkillM4` = '%d', \
    `SkillAK47` = '%d', \
    `SkillDesert` = '%d', \
    `SkillMP5` = '%d', \
    `SkillPistol` = '%d', \
    `SkillSniper` = '%d', \
    `SkillShotgun` = '%d', \
    `SkillSpas` = '%d', \
    `SkillSwan` = '%d' \
    WHERE `UserName` = '%s'"
,
    pIP[playerid],
    pInfo[playerid][pAdmin],
    pInfo[playerid][pKills],
    pInfo[playerid][pDeaths],
    GetPlayerMoney(playerid),
    GetPlayerScore(playerid),
    pInfo[playerid][pVip],
    pInfo[playerid][pCaptureZones],
    pInfo[playerid][pEcstasy],
    pInfo[playerid][pCocaine],
    pInfo[playerid][pHeroin],
    pInfo[playerid][pKillingACH],
    pInfo[playerid][pCapturingACH],
    pMod[playerid][ShorterTimeForCapture],
    pInfo[playerid][pSkillM4],
    pInfo[playerid][pSkillAK47],
    pInfo[playerid][pSkillDesert],
    pInfo[playerid][pSkillMP5],
    pInfo[playerid][pSkillPistol],
    pInfo[playerid][pSkillSniper],
    pInfo[playerid][pSkillShotgun],
    pInfo[playerid][pSkillSpas],
    pInfo[playerid][pSkillSwan],
    pName[playerid]);
    mysql_query(Query);
    return 1;
}
ERRORS
Код:
D:\SA-MP Server Stuff 2\SA-MP Server\gamemodes\battletestv6.pwn(3349) : error 075: input line too long (after substitutions)
D:\SA-MP Server Stuff 2\SA-MP Server\gamemodes\battletestv6.pwn(3350) : error 037: invalid string (possibly non-terminated string)
D:\SA-MP Server Stuff 2\SA-MP Server\gamemodes\battletestv6.pwn(3350) : error 017: undefined symbol "UPDATE"
D:\SA-MP Server Stuff 2\SA-MP Server\gamemodes\battletestv6.pwn(3350) : error 029: invalid expression, assumed zero
D:\SA-MP Server Stuff 2\SA-MP Server\gamemodes\battletestv6.pwn(3350) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
ERROR lines:
pawn Код:
`SkillSpas` = '%d', \
    `SkillSwan` = '%d' \
Reply
#2

Separate it instead of using long lines that will give you an error: error 075: input line too long (after substitutions)

I mean this

pawn Код:
UpdateAccount(playerid)
{
    new
        Query[ 656 ] ;

    printf("IP: %s",pIP[playerid]);
    printf("Admin: %d",pInfo[playerid][pAdmin]);
    printf("Kills: %d",pInfo[playerid][pKills]);
    printf("Deaths: %d",pInfo[playerid][pDeaths]);
    printf("Money: %d",GetPlayerMoney(playerid));
    printf("Score: %d",GetPlayerScore(playerid));
    printf("Vip: %d",pInfo[playerid][pVip]);
    printf("CaptureZones: %d",pInfo[playerid][pCaptureZones]);
    printf("Ecstasy: %d",pInfo[playerid][pEcstasy]);
    printf("Cocaine: %d",pInfo[playerid][pCocaine]);
    printf("Heroin: %d",pInfo[playerid][pHeroin]);
    printf("Mod Shorter: %d",pMod[playerid][ShorterTimeForCapture]);

    format( Query, sizeof( Query ),"UPDATE `users` SET \
    `IP` = '%s', `Admin` = '%d', `Kills` = '%d',  `Deaths` = '%d', \
    `Money` = '%d', `Score` = '%d', `Vip` = '%d', `CaptureZones` = '%d', \
    `Ecstasy` = '%d', `Cocaine` = '%d', `Heroin` = '%d', \
    WHERE `UserName` = '%s'"
,
    pIP[playerid], pInfo[playerid][pAdmin], pInfo[playerid][pKills], pInfo[playerid][pDeaths],
    GetPlayerMoney(playerid), GetPlayerScore(playerid), pInfo[playerid][pVip],
    pInfo[playerid][pCaptureZones], pInfo[playerid][pEcstasy], pInfo[playerid][pCocaine],
    pInfo[playerid][pHeroin], pName[playerid]);
    mysql_query( Query );

    format( Query, sizeof( Query ),"UPDATE `users` SET \
    `KillingACH` = '%d', `CapturingACH` = '%d',  `CaptureTime` = '%d',  `SkillM4` = '%d', \
    `SkillAK47` = '%d',  `SkillDesert` = '%d',  `SkillMP5` = '%d',  `SkillPistol` = '%d', \
    `SkillSniper` = '%d',  `SkillShotgun` = '%d',  `SkillSpas` = '%d', `SkillSwan` = '%d' \
    WHERE `Username` = '%s'"
,
    pInfo[playerid][pKillingACH], pInfo[playerid][pCapturingACH], pMod[playerid][ShorterTimeForCapture],
    pInfo[playerid][pSkillM4], pInfo[playerid][pSkillAK47], pInfo[playerid][pSkillDesert],
    pInfo[playerid][pSkillMP5], pInfo[playerid][pSkillPistol], pInfo[playerid][pSkillSniper],
    pInfo[playerid][pSkillShotgun], pInfo[playerid][pSkillSpas], pInfo[playerid][pSkillSwan], pName[playerid];
    mysql_query( Query );
    return 1;
}
Reply
#3

Quote:
Originally Posted by pds2k12
Посмотреть сообщение
Separate it instead of using long lines that will give you an error: error 075: input line too long (after substitutions)
Hmm .. I don`t understand..
Reply
#4

Quote:
Originally Posted by Sanady
Посмотреть сообщение
Hello my saving system in MySQL have some errors which I don`t know how to fix anyone know?
pawn Код:
UpdateAccount(playerid)
{
    new Query[710];
    printf("IP: %s",pIP[playerid]);
    printf("Admin: %d",pInfo[playerid][pAdmin]);
    printf("Kills: %d",pInfo[playerid][pKills]);
    printf("Deaths: %d",pInfo[playerid][pDeaths]);
    printf("Money: %d",GetPlayerMoney(playerid));
    printf("Score: %d",GetPlayerScore(playerid));
    printf("Vip: %d",pInfo[playerid][pVip]);
    printf("CaptureZones: %d",pInfo[playerid][pCaptureZones]);
    printf("Ecstasy: %d",pInfo[playerid][pEcstasy]);
    printf("Cocaine: %d",pInfo[playerid][pCocaine]);
    printf("Heroin: %d",pInfo[playerid][pHeroin]);
    printf("Mod Shorter: %d",pMod[playerid][ShorterTimeForCapture]);
    format(Query, sizeof(Query),"UPDATE `users` SET \
    `IP` = '%s', \
    `Admin` = '%d',\
    `Kills` = '%d', \
    `Deaths` = '%d', \
    `Money` = '%d', \
    `Score` = '%d', \
    `Vip` = '%d', \
    `CaptureZones` = '%d', \
    `Ecstasy` = '%d', \
    `Cocaine` = '%d', \
    `Heroin` = '%d', \
    `KillingACH` = '%d', \
    `CapturingACH` = '%d', \
    `CaptureTime` = '%d', \
    `SkillM4` = '%d', \
    `SkillAK47` = '%d', \
    `SkillDesert` = '%d', \
    `SkillMP5` = '%d', \
    `SkillPistol` = '%d', \
    `SkillSniper` = '%d', \
    `SkillShotgun` = '%d', \
    `SkillSpas` = '%d', \
    `SkillSwan` = '%d' \
    WHERE `UserName` = '%s'"
,
    pIP[playerid],
    pInfo[playerid][pAdmin],
    pInfo[playerid][pKills],
    pInfo[playerid][pDeaths],
    GetPlayerMoney(playerid),
    GetPlayerScore(playerid),
    pInfo[playerid][pVip],
    pInfo[playerid][pCaptureZones],
    pInfo[playerid][pEcstasy],
    pInfo[playerid][pCocaine],
    pInfo[playerid][pHeroin],
    pInfo[playerid][pKillingACH],
    pInfo[playerid][pCapturingACH],
    pMod[playerid][ShorterTimeForCapture],
    pInfo[playerid][pSkillM4],
    pInfo[playerid][pSkillAK47],
    pInfo[playerid][pSkillDesert],
    pInfo[playerid][pSkillMP5],
    pInfo[playerid][pSkillPistol],
    pInfo[playerid][pSkillSniper],
    pInfo[playerid][pSkillShotgun],
    pInfo[playerid][pSkillSpas],
    pInfo[playerid][pSkillSwan],
    pName[playerid]);
    mysql_query(Query);
    return 1;
}
ERRORS
Код:
D:\SA-MP Server Stuff 2\SA-MP Server\gamemodes\battletestv6.pwn(3349) : error 075: input line too long (after substitutions)
D:\SA-MP Server Stuff 2\SA-MP Server\gamemodes\battletestv6.pwn(3350) : error 037: invalid string (possibly non-terminated string)
D:\SA-MP Server Stuff 2\SA-MP Server\gamemodes\battletestv6.pwn(3350) : error 017: undefined symbol "UPDATE"
D:\SA-MP Server Stuff 2\SA-MP Server\gamemodes\battletestv6.pwn(3350) : error 029: invalid expression, assumed zero
D:\SA-MP Server Stuff 2\SA-MP Server\gamemodes\battletestv6.pwn(3350) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
ERROR lines:
pawn Код:
`SkillSpas` = '%d', \
    `SkillSwan` = '%d' \
At the start with mysql i had the same problem (to many data in one string)

Try this:

Код:
UpdateAccount(playerid)
{
	new Query[710];
	printf("IP: %s",pIP[playerid]);
	printf("Admin: %d",pInfo[playerid][pAdmin]);
	printf("Kills: %d",pInfo[playerid][pKills]);
	printf("Deaths: %d",pInfo[playerid][pDeaths]);
	printf("Money: %d",GetPlayerMoney(playerid));
	printf("Score: %d",GetPlayerScore(playerid));
	printf("Vip: %d",pInfo[playerid][pVip]);
	printf("CaptureZones: %d",pInfo[playerid][pCaptureZones]);
	printf("Ecstasy: %d",pInfo[playerid][pEcstasy]);
	printf("Cocaine: %d",pInfo[playerid][pCocaine]);
	printf("Heroin: %d",pInfo[playerid][pHeroin]);
	printf("Mod Shorter: %d",pMod[playerid][ShorterTimeForCapture]);

    format(Query, 450, "UPDATE `users` SET `IP` = '%s', `Admin` = '%d', `Kills` = '%d', `Deaths` = '%d', `Money` = '%d', `Score` = '%d', `Vip` = '%d', `CaptureZones` = '%d', `Ecstasy` = '%d', `Cocaine` = '%d', `Heroin` = '%d', `KillingACH` = '%d', `CapturingACH` = '%d',",
    pIP[playerid], pInfo[playerid][pAdmin], pInfo[playerid][pKills], pInfo[playerid][pDeaths], GetPlayerMoney(playerid), GetPlayerScore(playerid), pInfo[playerid][pVip], pInfo[playerid][pCaptureZones], pInfo[playerid][pEcstasy],pInfo[playerid][pCocaine], pInfo[playerid][pHeroin],
	pInfo[playerid][pKillingACH], pInfo[playerid][pCapturingACH]);

	format(Query, sizeof(Query), "%s `CaptureTime` = '%d', `SkillM4` = '%d', `SkillAK47` = '%d', `SkillDesert` = '%d', `SkillMP5` = '%d', `SkillPistol` = '%d', `SkillSniper` = '%d', `SkillShotgun` = '%d', `SkillSpas` = '%d', `SkillSwan` = '%d' WHERE `UserName` = '%s'",
	Query, pMod[playerid][ShorterTimeForCapture], pInfo[playerid][pSkillM4], pInfo[playerid][pSkillAK47], pInfo[playerid][pSkillDesert], pInfo[playerid][pSkillMP5], pInfo[playerid][pSkillPistol], pInfo[playerid][pSkillSniper], pInfo[playerid][pSkillShotgun], pInfo[playerid][pSkillSpas],
	pInfo[playerid][pSkillSwan], pName[playerid]);
	/*A made the same thing but i puted the string in 2 parts*/
    mysql_query(Query);
    return 1;
}
Reply
#5

Quote:
Originally Posted by Pasa
Посмотреть сообщение
At the start with mysql i had the same problem (to many data in one string)

Try this:

Код:
UpdateAccount(playerid)
{
	new Query[710];
	printf("IP: %s",pIP[playerid]);
	printf("Admin: %d",pInfo[playerid][pAdmin]);
	printf("Kills: %d",pInfo[playerid][pKills]);
	printf("Deaths: %d",pInfo[playerid][pDeaths]);
	printf("Money: %d",GetPlayerMoney(playerid));
	printf("Score: %d",GetPlayerScore(playerid));
	printf("Vip: %d",pInfo[playerid][pVip]);
	printf("CaptureZones: %d",pInfo[playerid][pCaptureZones]);
	printf("Ecstasy: %d",pInfo[playerid][pEcstasy]);
	printf("Cocaine: %d",pInfo[playerid][pCocaine]);
	printf("Heroin: %d",pInfo[playerid][pHeroin]);
	printf("Mod Shorter: %d",pMod[playerid][ShorterTimeForCapture]);

    format(Query, 450, "UPDATE `users` SET `IP` = '%s', `Admin` = '%d', `Kills` = '%d', `Deaths` = '%d', `Money` = '%d', `Score` = '%d', `Vip` = '%d', `CaptureZones` = '%d', `Ecstasy` = '%d', `Cocaine` = '%d', `Heroin` = '%d', `KillingACH` = '%d', `CapturingACH` = '%d',",
    pIP[playerid], pInfo[playerid][pAdmin], pInfo[playerid][pKills], pInfo[playerid][pDeaths], GetPlayerMoney(playerid), GetPlayerScore(playerid), pInfo[playerid][pVip], pInfo[playerid][pCaptureZones], pInfo[playerid][pEcstasy],pInfo[playerid][pCocaine], pInfo[playerid][pHeroin],
	pInfo[playerid][pKillingACH], pInfo[playerid][pCapturingACH]);

	format(Query, sizeof(Query), "%s `CaptureTime` = '%d', `SkillM4` = '%d', `SkillAK47` = '%d', `SkillDesert` = '%d', `SkillMP5` = '%d', `SkillPistol` = '%d', `SkillSniper` = '%d', `SkillShotgun` = '%d', `SkillSpas` = '%d', `SkillSwan` = '%d' WHERE `UserName` = '%s'",
	Query, pMod[playerid][ShorterTimeForCapture], pInfo[playerid][pSkillM4], pInfo[playerid][pSkillAK47], pInfo[playerid][pSkillDesert], pInfo[playerid][pSkillMP5], pInfo[playerid][pSkillPistol], pInfo[playerid][pSkillSniper], pInfo[playerid][pSkillShotgun], pInfo[playerid][pSkillSpas],
	pInfo[playerid][pSkillSwan], pName[playerid]);
	/*A made the same thing but i puted the string in 2 parts*/
    mysql_query(Query);
    return 1;
}
Hmm nice I didn`t know about this trick...Thanks it`s works without errors
Reply
#6

When i can help i wil help ( sry for bad english :/ )
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)