stock ScythSaveAccount(playerid)
{
new query[10000], Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
ScythSafeUpdating();
format(query, sizeof(query), "UPDATE `users` SET \
`Registered` = %d, \
`RegisterStep` = %d, \
`Gender` = %d, \
`Date1` = %d, \
`Date2` = %d, \
`Date3` = %d, \
`Age` = %d, \
`Origin` = '%s', \
`Dollars` = %d, \
`Cents` = %d, \
`Level` = %d, \
`Health` = %f, \
`Armor` = %f, \
`Clothes` = %d, \
`PosX` = %f, \
`PosY` = %f, \
`PosZ` = %f, \
`PosR` = %f,",
PlayerInfo[playerid][pRegistered],
PlayerInfo[playerid][pRegstep],
PlayerInfo[playerid][pGender],
PlayerInfo[playerid][pDate][0],
PlayerInfo[playerid][pDate][1],
PlayerInfo[playerid][pDate][2],
PlayerInfo[playerid][pAge],
ScythReturnEscaped(PlayerInfo[playerid][pOrigin]),
PlayerInfo[playerid][pDollars],
PlayerInfo[playerid][pCents],
PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pHealth],
PlayerInfo[playerid][pArmor],
PlayerInfo[playerid][pClothes],
PlayerInfo[playerid][pPosX],
PlayerInfo[playerid][pPosY],
PlayerInfo[playerid][pPosZ],
PlayerInfo[playerid][pPosR]
);
format(query, sizeof(query), "%s \
`IP` = '%s', \
`VirtualWorld` = %d, \
`Interior` = %d, \
`AdminLevel` = %d, \
`Account` = %d, \
`Balance1` = %d, \
`Balance2` = %d, \
`Job` = %d, \
`Duty` = %d, \
`Salary1` = %d, \
`Salary2` = %d \
WHERE `Username` = '%s'",
query,
PlayerInfo[playerid][pIP],
PlayerInfo[playerid][pVW],
PlayerInfo[playerid][pInt],
PlayerInfo[playerid][pAdmin],
PlayerInfo[playerid][pAccount],
PlayerInfo[playerid][pBalance][0],
PlayerInfo[playerid][pBalance][1],
PlayerInfo[playerid][pJob],
PlayerInfo[playerid][pDuty],
PlayerInfo[playerid][pSalary][0],
PlayerInfo[playerid][pSalary][1],
Name
);
mysql_query(query);
print("called");
return 1;
}
ScythSafeUpdating();
new query[10000]
new query[150];
Why do you call the function again?
Remove: pawn Код:
pawn Код:
pawn Код:
|
stock ScythSafeUpdating()
{
mysql_query("SET SQL_SAFE_UPDATES=0;");
return 1;
}
stock ScythSaveAccount(playerid)
{
new query[512], query2[512], Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, MAX_PLAYER_NAME);
ScythSafeUpdating();
format(query, sizeof(query), "UPDATE `users` SET \
`Registered` = %d, \
`RegisterStep` = %d, \
`Gender` = %d, \
`Date1` = %d, \
`Date2` = %d, \
`Date3` = %d, \
`Age` = %d, \
`Origin` = '%s', \
`Dollars` = %d, \
`Cents` = %d, \
`Level` = %d, \
`Health` = %f, \
`Armor` = %f, \
`Clothes` = %d, \
`PosX` = %f, \
`PosY` = %f, \
`PosZ` = %f, \
`PosR` = %f,",
PlayerInfo[playerid][pRegistered],
PlayerInfo[playerid][pRegstep],
PlayerInfo[playerid][pGender],
PlayerInfo[playerid][pDate][0],
PlayerInfo[playerid][pDate][1],
PlayerInfo[playerid][pDate][2],
PlayerInfo[playerid][pAge],
ScythReturnEscaped(PlayerInfo[playerid][pOrigin]),
PlayerInfo[playerid][pDollars],
PlayerInfo[playerid][pCents],
PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pHealth],
PlayerInfo[playerid][pArmor],
PlayerInfo[playerid][pClothes],
PlayerInfo[playerid][pPosX],
PlayerInfo[playerid][pPosY],
PlayerInfo[playerid][pPosZ],
PlayerInfo[playerid][pPosR]
);
format(query2, sizeof(query2), "%s \
`IP` = '%s', \
`VirtualWorld` = %d, \
`Interior` = %d, \
`AdminLevel` = %d, \
`Account` = %d, \
`Balance1` = %d, \
`Balance2` = %d, \
`Job` = %d, \
`Duty` = %d, \
`Salary1` = %d, \
`Salary2` = %d \
WHERE `Username` = '%s'",
query,
PlayerInfo[playerid][pIP],
PlayerInfo[playerid][pVW],
PlayerInfo[playerid][pInt],
PlayerInfo[playerid][pAdmin],
PlayerInfo[playerid][pAccount],
PlayerInfo[playerid][pBalance][0],
PlayerInfo[playerid][pBalance][1],
PlayerInfo[playerid][pJob],
PlayerInfo[playerid][pDuty],
PlayerInfo[playerid][pSalary][0],
PlayerInfo[playerid][pSalary][1],
Name
);
strcat(query, query2);
mysql_query(query);
print("called");
return 1;
}
Try this:
Код:
stock ScythSaveAccount(playerid) { new query[512], query2[512], Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, MAX_PLAYER_NAME); ScythSafeUpdating(); format(query, sizeof(query), "UPDATE `users` SET \ `Registered` = %d, \ `RegisterStep` = %d, \ `Gender` = %d, \ `Date1` = %d, \ `Date2` = %d, \ `Date3` = %d, \ `Age` = %d, \ `Origin` = '%s', \ `Dollars` = %d, \ `Cents` = %d, \ `Level` = %d, \ `Health` = %f, \ `Armor` = %f, \ `Clothes` = %d, \ `PosX` = %f, \ `PosY` = %f, \ `PosZ` = %f, \ `PosR` = %f,", PlayerInfo[playerid][pRegistered], PlayerInfo[playerid][pRegstep], PlayerInfo[playerid][pGender], PlayerInfo[playerid][pDate][0], PlayerInfo[playerid][pDate][1], PlayerInfo[playerid][pDate][2], PlayerInfo[playerid][pAge], ScythReturnEscaped(PlayerInfo[playerid][pOrigin]), PlayerInfo[playerid][pDollars], PlayerInfo[playerid][pCents], PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pHealth], PlayerInfo[playerid][pArmor], PlayerInfo[playerid][pClothes], PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ], PlayerInfo[playerid][pPosR] ); format(query2, sizeof(query2), "%s \ `IP` = '%s', \ `VirtualWorld` = %d, \ `Interior` = %d, \ `AdminLevel` = %d, \ `Account` = %d, \ `Balance1` = %d, \ `Balance2` = %d, \ `Job` = %d, \ `Duty` = %d, \ `Salary1` = %d, \ `Salary2` = %d \ WHERE `Username` = '%s'", query, PlayerInfo[playerid][pIP], PlayerInfo[playerid][pVW], PlayerInfo[playerid][pInt], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pAccount], PlayerInfo[playerid][pBalance][0], PlayerInfo[playerid][pBalance][1], PlayerInfo[playerid][pJob], PlayerInfo[playerid][pDuty], PlayerInfo[playerid][pSalary][0], PlayerInfo[playerid][pSalary][1], Name ); strcat(query, query2); mysql_query(query); print("called"); return 1; } |
stock ScythSaveAccount(playerid) { new query[512], query2[512], Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, MAX_PLAYER_NAME); ScythSafeUpdating(); format(query, sizeof(query), "UPDATE `users` SET \ `Registered` = %d, \ `RegisterStep` = %d, \ `Gender` = %d, \ `Date1` = %d, \ `Date2` = %d, \ `Date3` = %d, \ `Age` = %d, \ `Origin` = '%s', \ `Dollars` = %d, \ `Cents` = %d, \ `Level` = %d, \ `Health` = %f, \ `Armor` = %f, \ `Clothes` = %d, \ `PosX` = %f, \ `PosY` = %f, \ `PosZ` = %f, \ `PosR` = %f,", PlayerInfo[playerid][pRegistered], PlayerInfo[playerid][pRegstep], PlayerInfo[playerid][pGender], PlayerInfo[playerid][pDate][0], PlayerInfo[playerid][pDate][1], PlayerInfo[playerid][pDate][2], PlayerInfo[playerid][pAge], ScythReturnEscaped(PlayerInfo[playerid][pOrigin]), PlayerInfo[playerid][pDollars], PlayerInfo[playerid][pCents], PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pHealth], PlayerInfo[playerid][pArmor], PlayerInfo[playerid][pClothes], PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ], PlayerInfo[playerid][pPosR] ); format(query2, sizeof(query2), "`IP` = '%s', \ `VirtualWorld` = %d, \ `Interior` = %d, \ `AdminLevel` = %d, \ `Account` = %d, \ `Balance1` = %d, \ `Balance2` = %d, \ `Job` = %d, \ `Duty` = %d, \ `Salary1` = %d, \ `Salary2` = %d \ WHERE `Username` = '%s'", PlayerInfo[playerid][pIP], PlayerInfo[playerid][pVW], PlayerInfo[playerid][pInt], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pAccount], PlayerInfo[playerid][pBalance][0], PlayerInfo[playerid][pBalance][1], PlayerInfo[playerid][pJob], PlayerInfo[playerid][pDuty], PlayerInfo[playerid][pSalary][0], PlayerInfo[playerid][pSalary][1], Name ); strcat(query, query2); mysql_query(query); print("called"); printf(query); return 1; }
uhm... put
printf(query); and tell me what he writes when the funcition is called EDIT: I haven't seen an error D: check this [code] Код:
stock ScythSaveAccount(playerid) { new query[512], query2[512], Name[MAX_PLAYER_NAME]; GetPlayerName(playerid, Name, MAX_PLAYER_NAME); ScythSafeUpdating(); format(query, sizeof(query), "UPDATE `users` SET \ `Registered` = %d, \ `RegisterStep` = %d, \ `Gender` = %d, \ `Date1` = %d, \ `Date2` = %d, \ `Date3` = %d, \ `Age` = %d, \ `Origin` = '%s', \ `Dollars` = %d, \ `Cents` = %d, \ `Level` = %d, \ `Health` = %f, \ `Armor` = %f, \ `Clothes` = %d, \ `PosX` = %f, \ `PosY` = %f, \ `PosZ` = %f, \ `PosR` = %f,", PlayerInfo[playerid][pRegistered], PlayerInfo[playerid][pRegstep], PlayerInfo[playerid][pGender], PlayerInfo[playerid][pDate][0], PlayerInfo[playerid][pDate][1], PlayerInfo[playerid][pDate][2], PlayerInfo[playerid][pAge], ScythReturnEscaped(PlayerInfo[playerid][pOrigin]), PlayerInfo[playerid][pDollars], PlayerInfo[playerid][pCents], PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pHealth], PlayerInfo[playerid][pArmor], PlayerInfo[playerid][pClothes], PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ], PlayerInfo[playerid][pPosR] ); format(query2, sizeof(query2), "`IP` = '%s', \ `VirtualWorld` = %d, \ `Interior` = %d, \ `AdminLevel` = %d, \ `Account` = %d, \ `Balance1` = %d, \ `Balance2` = %d, \ `Job` = %d, \ `Duty` = %d, \ `Salary1` = %d, \ `Salary2` = %d \ WHERE `Username` = '%s'", PlayerInfo[playerid][pIP], PlayerInfo[playerid][pVW], PlayerInfo[playerid][pInt], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pAccount], PlayerInfo[playerid][pBalance][0], PlayerInfo[playerid][pBalance][1], PlayerInfo[playerid][pJob], PlayerInfo[playerid][pDuty], PlayerInfo[playerid][pSalary][0], PlayerInfo[playerid][pSalary][1], Name ); strcat(query, query2); mysql_query(query); print("called"); printf(query); return 1; } |