SA-MP Forums Archive
MySQL SavePlayer problem - 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: MySQL SavePlayer problem (/showthread.php?tid=540194)



MySQL SavePlayer problem - McGuiness - 03.10.2014

Hey guys,

I have worked with MySQL before but the problem is this code, I have used in a previous script before. Its been giving me these errors and when I remove it but keep the stock part in it compiles. Here are the errors:

Код:
C:\Users\Administrator\Desktop\SA-MP\gamemodes\FCRP_MYSQL.pwn(10724) : error 075: input line too long (after substitutions)
C:\Users\Administrator\Desktop\SA-MP\gamemodes\FCRP_MYSQL.pwn(10725) : error 037: invalid string (possibly non-terminated string)
C:\Users\Administrator\Desktop\SA-MP\gamemodes\FCRP_MYSQL.pwn(10725) : error 017: undefined symbol "UPDATE"
C:\Users\Administrator\Desktop\SA-MP\gamemodes\FCRP_MYSQL.pwn(10725) : error 029: invalid expression, assumed zero
C:\Users\Administrator\Desktop\SA-MP\gamemodes\FCRP_MYSQL.pwn(10725) : fatal error 107: too many error messages on one line

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


5 Errors.
And heres the code its saying errors for:

pawn Код:
SavePlayer(playerid)
{
    new Query[600];
    GetPlayerPos(playerid, PlayerInfo[playerid][PosX], PlayerInfo[playerid][PosY], PlayerInfo[playerid][PosZ]);
    GetPlayerName(playerid, PlayerInfo[playerid][Nick], 24);

    format(Query, sizeof(Query), "UPDATE `playerdata` SET `cash` = '%d', `admin` = '%d', `kills` = '%d', `deaths` = '%d', `sex` = '%d', `age` = '%d', `skin` = '%d', `posx` = '%d', `posy` = '%d', `posz` = '%d', `angle` = '%d', `interior` = '%d', `virtualworld` = '%d', `faction` = '%d', `rank` = '%d', `division` = '%d', `leader` = '%d', `job` = '%d', `facmod` = '%d', `wanted` = '%d', `jailed` = '%d', `jailtime` = '%d', `housekey` = '%d', `number` = '%d', `cell` = '%d', `level` = '%d' WHERE `nick` = '%s' LIMIT 1",
    GetPlayerMoney(playerid),
    PlayerInfo[playerid][pAdmin],
    PlayerInfo[playerid][pKills],
    PlayerInfo[playerid][pDeaths],
    PlayerInfo[playerid][pSex],
    PlayerInfo[playerid][pAge],
    GetPlayerSkin(playerid),
    PlayerInfo[playerid][PosX],
    PlayerInfo[playerid][PosY],
    PlayerInfo[playerid][PosZ],
    PlayerInfo[playerid][Angle],
    PlayerInfo[playerid][Interior],
    PlayerInfo[playerid][VirtualWorld],
    PlayerInfo[playerid][pFaction],
    PlayerInfo[playerid][pRank],
    PlayerInfo[playerid][pDivision],
    PlayerInfo[playerid][pLeader],
    PlayerInfo[playerid][pJob],
    PlayerInfo[playerid][pFacMod],
    PlayerInfo[playerid][pWanted],
    PlayerInfo[playerid][pJailed],
    PlayerInfo[playerid][pJailTime],
    PlayerInfo[playerid][pHouseKey],
    PlayerInfo[playerid][pNumber],
    PlayerInfo[playerid][pCell],
    PlayerInfo[playerid][pLevel],
    PlayerInfo[playerid][Nick]);
    mysql_query(Query);

    format(Query, sizeof(Query), "UPDATE `playerdata` SET `exp` = '%d', `warnings` = '%d', `license` = '%d', `cdl` = '%d', `weplic` = '%d', `weed` = '%d', `crack` = '%d', `materials` = '%d', `weapon1` = '%d', `weapon1a` = '%d', `weapon2` = '%d', `weapon2a` = '%d', `weapon3` = '%d', `weapon3a` = '%d', `weapon4` = '%d', `weapon4a` = '%d', `weapon5` = '%d', `weapon5a` = '%d', `weapon6` = '%d', `weapon6a` = '%d', `weapon7` = '%d', `weapon7a` = '%d', `weapon8` = '%d', `weapon8a` = '%d' WHERE `nick` = '%s' LIMIT 1",
    PlayerInfo[playerid][pExp],
    PlayerInfo[playerid][pWarnings],
    PlayerInfo[playerid][pLicense],
    PlayerInfo[playerid][pCDL],
    PlayerInfo[playerid][pWepLic],
    PlayerInfo[playerid][pWeed],
    PlayerInfo[playerid][pCrack],
    PlayerInfo[playerid][pMaterials],
    PlayerInfo[playerid][Weapon1],
    PlayerInfo[playerid][Weapon1a],
    PlayerInfo[playerid][Weapon2],
    PlayerInfo[playerid][Weapon2a],
    PlayerInfo[playerid][Weapon3],
    PlayerInfo[playerid][Weapon3a],
    PlayerInfo[playerid][Weapon4],
    PlayerInfo[playerid][Weapon4a],
    PlayerInfo[playerid][Weapon5],
    PlayerInfo[playerid][Weapon5a],
    PlayerInfo[playerid][Weapon6],
    PlayerInfo[playerid][Weapon6a],
    PlayerInfo[playerid][Weapon7],
    PlayerInfo[playerid][Weapon7a],
    PlayerInfo[playerid][Weapon8],
    PlayerInfo[playerid][Weapon8a],
    PlayerInfo[playerid][Nick]);
    mysql_query(Query);

    format(Query, sizeof(Query), "UPDATE `playerdata` SET `weapon9` = '%d', `weapon9a` = '%d', `weapon10` = '%d', `weapon10a` = '%d', `weapon11` = '%d', `weapon11a` = '%d', `weapon12` = '%d', `weapon12a` = '%d', `adminname` = '%d', `playername` = '%d', `accent` = '%d', `houseowner` = '%d', `ip` = '%d' WHERE `nick` = '%s' LIMIT 1",
    PlayerInfo[playerid][Weapon9],
    PlayerInfo[playerid][Weapon9a],
    PlayerInfo[playerid][Weapon10],
    PlayerInfo[playerid][Weapon10a],
    PlayerInfo[playerid][Weapon11],
    PlayerInfo[playerid][Weapon11a],
    PlayerInfo[playerid][Weapon12],
    PlayerInfo[playerid][Weapon12a],
    PlayerInfo[playerid][adminname],
    PlayerInfo[playerid][playername],
    PlayerInfo[playerid][accent],
    PlayerInfo[playerid][houseowner],
    PlayerInfo[playerid][ip],
    PlayerInfo[playerid][Nick]);
    mysql_query(Query);
    return 1;
}
I hope someone can find the problem as sometimes when I proofread the codes I will miss at least two or three so just getting you guys to proofread it incase I may have missed something.


Re: MySQL SavePlayer problem - McGuiness - 03.10.2014

Can anyone please help me out with this?


Re: MySQL SavePlayer problem - AMouldyLemon - 03.10.2014

You need to split the first one up into 2, use the same format as the others.