Pawn Compiler Quits -
Mattakil - 07.12.2013
It appears that pawn wont compile this script, it just stops responding. If I comment out the 2 lines that are commented here, it compiles with no errors, though I looked through the variables and didnt see anything...
pawn Код:
stock SavePlayer(playerid)
{
new Query[1000] 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', GASCAN = %d, BANADMIN = '%s', BANDATE = '%s', SKIN = %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][pNumber], 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][GunLic], PlayerInfo[pid][pArrested], PlayerInfo[pid][Walkie], PlayerInfo[pid][BanReason], PlayerInfo[pid][pGascan], PlayerInfo[pid][BanAdmin], PlayerInfo[pid][pBanDate], PlayerInfo[pid][pSkin], PlayerInfo[pid][pID]);
mysql_query(Query);
format(logstring, sizeof(logstring), "%s's info saved.", GetName(pid));
print(logstring);
return 1;
}
Re: Pawn Compiler Quits -
Voxel - 07.12.2013
I think those lines might be to long lol, not sure though!
Try putting it under each other
Re: Pawn Compiler Quits -
Mitchy - 07.12.2013
Pawn has a glitch where you can only have 512 characters per line i believe. Just put a new line under eachother
e.g
pawn Код:
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 // and so on
EDIT: Make sure that string is big enough too!!
Re: Pawn Compiler Quits -
Mattakil - 07.12.2013
Lol, I thought splitting it once would work...guess not :P I split it 2 more times and its good! Thanks!
repped both
Re: Pawn Compiler Quits -
Mitchy - 07.12.2013
No problem mate. Cheers for the rep, means alot :P
Re: Pawn Compiler Quits -
Jebster - 07.12.2013
PHP код:
stock SavePlayer(playerid)
{
new Query[1000] 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',\ GASCAN = %d, BANADMIN = '%s', BANDATE = '%s', SKIN = %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][pNumber], 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][GunLic], PlayerInfo[pid][pArrested], PlayerInfo[pid][Walkie], PlayerInfo[pid][BanReason], PlayerInfo[pid][pGascan], PlayerInfo[pid][BanAdmin], PlayerInfo[pid][pBanDate], PlayerInfo[pid][pSkin], PlayerInfo[pid][pID]);
mysql_query(Query);
printf ("%s's info saved.", GetName(pid));
return 1;
}
Re: Pawn Compiler Quits -
Mattakil - 07.12.2013
How do I split the Query? scrcat dont work, and neither did using 2 queries
Re: Pawn Compiler Quits -
MaxTheMapper - 07.12.2013
Developing the query is tough it takes atleast 25-30 lines but if you put them all together that may work
Re: Pawn Compiler Quits -
Mitchy - 07.12.2013
You don't need to. At some points in the query make a new line and it should solve the problem.
Re: Pawn Compiler Quits -
Mitchy - 07.12.2013
pawn Код:
stock SavePlayer(playerid)
{
new Query[1000];
PlayerInfo[pid][pSkin] = GetPlayerSkin[pid];
PlayerInfo[pid][pCash] = GetPlayerMoney[pid];
PlayerInfo[pid][pLevel] = GetPlayerScore[pid];
PlayerInfo[pid][pName] = GetName(pid);
/* This should work just fine! If it isn't increase the variable sizes. */
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', GASCAN = %d, BANADMIN = '%s', BANDATE = '%s', SKIN = %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][pNumber], 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][GunLic], PlayerInfo[pid][pArrested],
PlayerInfo[pid][Walkie], PlayerInfo[pid][BanReason], PlayerInfo[pid][pGascan], PlayerInfo[pid][BanAdmin], PlayerInfo[pid][pBanDate], PlayerInfo[pid][pSkin], PlayerInfo[pid][pID]);
mysql_query(Query);
printf("%s's info saved.", GetName(pid));
return 1;
}