issue. -
alexanderjb918 - 10.03.2016
Код:
C:\Users\juhieuwhiewuj\Desktop\New Folder\gamemodes\prp.pwn(5737) : error 075: input line too long (after substitutions)
C:\Users\juhieuwhiewuj\Desktop\New Folder\gamemodes\prp.pwn(5738) : error 037: invalid string (possibly non-terminated string)
C:\Users\juhieuwhiewuj\Desktop\New Folder\gamemodes\prp.pwn(5738) : error 017: undefined symbol "UPDATE"
C:\Users\juhieuwhiewuj\Desktop\New Folder\gamemodes\prp.pwn(5738) : error 017: undefined symbol "ACCOUNTS"
C:\Users\juhieuwhiewuj\Desktop\New Folder\gamemodes\prp.pwn(5738) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
5 Errors.
Код:
stock SavePlayer(playerid)
{
new Query[100000], logstring[100];
PlayerInfo[pid][pSkin] = GetPlayerSkin(pid);
PlayerInfo[pid][pCash] = GetPlayerMoney(pid);
PlayerInfo[pid][pLevel] = GetPlayerScore(pid);
PlayerInfo[pid][pName] = GetName(pid);
format(Query, sizeof(Query), "UPDATE ACCOUNTS SET PASSWORD = '%s', CASH = %d, NAME = '%s', ADMIN = %d, DEV = %d, HELPER = %d, VIP = %d, LEVEL = %d, XPOS = %4f, YPOS = %4f, ZPOS = %4f, NUMBER = %d, PTIME = %d, BANNED = %d, SEX = %d, TUT = %d, FACTION = %d, FACLEVEL = %d, FACRANK = '%s', PAYCHECK = %d, PAYDAY = %d, HOURS = %d, JAILED = %d, MASK = %d, JOB = %d, LICENSE = %d, CARKEY = %d, CARKEY2 = %d, CARKEY3 = %d, GUNLICENSE = %d, ARRESTED = %d, WALKIE = %d, BANREASON = '%s', BANADMIN = '%s', BANDATE = '%s', SKIN = %d, BANK = %d WHERE ID = %d");
PlayerInfo[pid][pPassword], PlayerInfo[pid][pCash], PlayerInfo[pid][pName], PlayerInfo[pid][pAdmin], PlayerInfo[pid][pDev], PlayerInfo[pid][pHelper], PlayerInfo[pid][pVIP], PlayerInfo[pid][pLevel], PlayerInfo[pid][pPos_x], PlayerInfo[pid][pPos_y], PlayerInfo[pid][pPos_z], PlayerInfo[pid][pPnumber], PlayerInfo[pid][pCelltime], PlayerInfo[pid][pBanned], PlayerInfo[pid][pSex],
PlayerInfo[pid][pTut], PlayerInfo[pid][pFaction], PlayerInfo[pid][pFLevel], PlayerInfo[pid][pFRank], PlayerInfo[pid][pPaycheck], PlayerInfo[pid][pPayday],
PlayerInfo[pid][pHours], PlayerInfo[pid][pJailed], PlayerInfo[pid][pMask], PlayerInfo[pid][pJob], PlayerInfo[pid][pDrivLic],
PlayerInfo[pid][pCarkey], PlayerInfo[pid][pCarkey2], PlayerInfo[pid][pCarkey3], PlayerInfo[pid][pGunLic], PlayerInfo[pid][pArrested], PlayerInfo[pid][pWalkie], PlayerInfo[pid][pBanReason], PlayerInfo[pid][pBanAdmin], PlayerInfo[pid][pBanDate], PlayerInfo[pid][pSkin], PlayerInfo[pid][pBank], PlayerInfo[pid][pID]);
mysql_query(Query);
format(logstring, sizeof(logstring), "%s's info saved.", GetName(pid));
print(logstring);
return 1;
}
Re: issue. -
Kimble - 10.03.2016
This ...
PHP код:
format(Query, sizeof(Query), "UPDATE ACCOUNTS SET PASSWORD = '%s', CASH = %d, NAME = '%s', ADMIN = %d, DEV = %d, HELPER = %d, VIP = %d, LEVEL = %d, XPOS = %4f, YPOS = %4f, ZPOS = %4f, NUMBER = %d, PTIME = %d, BANNED = %d, SEX = %d, TUT = %d, FACTION = %d, FACLEVEL = %d, FACRANK = '%s', PAYCHECK = %d, PAYDAY = %d, HOURS = %d, JAILED = %d, MASK = %d, JOB = %d, LICENSE = %d, CARKEY = %d, CARKEY2 = %d, CARKEY3 = %d, GUNLICENSE = %d, ARRESTED = %d, WALKIE = %d, BANREASON = '%s', BANADMIN = '%s', BANDATE = '%s', SKIN = %d, BANK = %d WHERE ID = %d");
... is too long for Pawno to handle, you have to break it up in to smaller strings then merge it again.
Re: issue. -
thegamer355 - 10.03.2016
Код:
format(Query, sizeof(Query), "UPDATE ACCOUNTS SET PASSWORD = '%s', CASH = %d, NAME = '%s', ADMIN = %d, DEV = %d, HELPER = %d, VIP = %d, LEVEL = %d, XPOS = %4f, YPOS = %4f, ZPOS = %4f, NUMBER = %d, PTIME = %d, BANNED = %d, SEX = %d, TUT = %d, FACTION = %d, FACLEVEL = %d, FACRANK = '%s', PAYCHECK = %d, PAYDAY = %d, HOURS = %d, JAILED = %d, MASK = %d, JOB = %d, LICENSE = %d, CARKEY = %d, CARKEY2 = %d, CARKEY3 = %d, GUNLICENSE = %d, ARRESTED = %d, WALKIE = %d, BANREASON = '%s', BANADMIN = '%s', BANDATE = '%s', SKIN = %d, BANK = %d WHERE ID = %d");
remove the ); at the end and change it into a ,
So the values listed below there are being used as value
And as said before, break it into smaller strings
Re: issue. -
jlalt - 10.03.2016
https://sampwiki.blast.hk/wiki/Strcat
PHP код:
stock SavePlayer(playerid)
{
new Handle[3500],Query[6500], logstring[100];
PlayerInfo[pid][pSkin] = GetPlayerSkin(pid);
PlayerInfo[pid][pCash] = GetPlayerMoney(pid);
PlayerInfo[pid][pLevel] = GetPlayerScore(pid);
PlayerInfo[pid][pName] = GetName(pid);
format(Handle, sizeof(Handle), "UPDATE ACCOUNTS SET PASSWORD = '%s', CASH = %d, NAME = '%s', ADMIN = %d, DEV = %d, HELPER = %d, VIP = %d, LEVEL = %d, XPOS = %4f, YPOS = %4f",
PlayerInfo[pid][pPassword], PlayerInfo[pid][pCash], PlayerInfo[pid][pName], PlayerInfo[pid][pAdmin], PlayerInfo[pid][pDev], PlayerInfo[pid][pHelper], PlayerInfo[pid][pVIP], PlayerInfo[pid][pLevel], PlayerInfo[pid][pPos_x], PlayerInfo[pid][pPos_y]);
strcat(Query, Handle);
format(Handle, sizeof(Handle), ", ZPOS = %4f, NUMBER = %d, PTIME = %d, BANNED = %d, SEX = %d, TUT = %d, FACTION = %d, FACLEVEL = %d, FACRANK = '%s', PAYCHECK = %d, PAYDAY = %d",
PlayerInfo[pid][pPos_z], PlayerInfo[pid][pPnumber], PlayerInfo[pid][pCelltime], PlayerInfo[pid][pBanned], PlayerInfo[pid][pSex],PlayerInfo[pid][pTut], PlayerInfo[pid][pFaction], PlayerInfo[pid][pFLevel], PlayerInfo[pid][pFRank], PlayerInfo[pid][pPaycheck], PlayerInfo[pid][pPayday]);
strcat(Query, Handle);
format(Handle, sizeof(Handle), ", HOURS = %d, JAILED = %d, MASK = %d, JOB = %d, LICENSE = %d, CARKEY = %d, CARKEY2 = %d, CARKEY3 = %d, GUNLICENSE = %d, ARRESTED = %d, WALKIE = %d, BANREASON = '%s', BANADMIN = '%s', BANDATE = '%s', SKIN = %d, BANK = %d WHERE ID = %d",
PlayerInfo[pid][pHours], PlayerInfo[pid][pJailed], PlayerInfo[pid][pMask], PlayerInfo[pid][pJob], PlayerInfo[pid][pDrivLic],PlayerInfo[pid][pCarkey], PlayerInfo[pid][pCarkey2], PlayerInfo[pid][pCarkey3],
PlayerInfo[pid][pGunLic], PlayerInfo[pid][pArrested], PlayerInfo[pid][pWalkie], PlayerInfo[pid][pBanReason], PlayerInfo[pid][pBanAdmin], PlayerInfo[pid][pBanDate], PlayerInfo[pid][pSkin], PlayerInfo[pid][pBank], PlayerInfo[pid][pID]);
strcat(Query, Handle);
mysql_query(Query);
format(logstring, sizeof(logstring), "%s's info saved.", GetName(pid));
print(logstring);
return 1;
}