05.02.2011, 13:00
Code:
SavePlayer(playerid)
{
if(!PlayerLogged[playerid])
return 0;
UserStats[playerid][Money] = GetPlayerMoney(playerid);
CheckMySQL();
new string[256];
format(string, sizeof(string), "UPDATE Users SET Password='%s',Admin='%d',Money='%d' WHERE Name='%s'", UserStats[playerid][Password], UserStats[playerid][Admin], UserStats[playerid][Money], UserStats[playerid][Name]);
mysql_query(string);
return 1;
}
Code:
C:\SA-MP servers\The Roleplay Server\gamemodes\MySQL.pwn(1183) : error 075: input line too long (after substitutions) C:\SA-MP servers\The Roleplay Server\gamemodes\MySQL.pwn(1184) : error 037: invalid string (possibly non-terminated string) C:\SA-MP servers\The Roleplay Server\gamemodes\MySQL.pwn(1184) : error 017: undefined symbol "UPDATE" C:\SA-MP servers\The Roleplay Server\gamemodes\MySQL.pwn(1184) : error 029: invalid expression, assumed zero C:\SA-MP servers\The Roleplay Server\gamemodes\MySQL.pwn(1184) : fatal error 107: too many error messages on one line
my code:
Code:
stock SavePInfo(playerid)
{
if(GetPVarInt(playerid, "LoggedIN") == 1)
{
new Query[600];
format(Query, sizeof(Query), "UPDATE `playerinfo` SET `kills` = %d, `deaths` = %d, `money` = %d, `Level` = %d, `Last Pos X` = %f, `Last Pos Y` = %f, `Last Pos Z` = %f, `Interior` = %d, `PMstatus` = %d, `Phonenumber` = %d, `Strength` = %d, `Jailtime` = %d, `Prisontime` = %d, `FactionID` = %d, `FactionRank` = %d, `FactionName` = %s, `RadioFreq` = %d, `PaycheckTime` = %d, `Gun0` = %d, `Gun1` = %d, `Gun2` = %d, `Gun3` = %d, `Gun4` = %d WHERE `user` = '%s'", // Also remember to update this...
PVar[playerid][pKills],
PVar[playerid][pDeaths],
GetPlayerMoney(playerid),
PVar[playerid][pAdminLevel],
PVar[playerid][pLastX],
PVar[playerid][pLastY],
PVar[playerid][pLastZ],
GetPlayerInterior(playerid),
PVar[playerid][pPMstatus],
PVar[playerid][pPhoneNumber],
PVar[playerid][pStrentgh],
PVar[playerid][pJailtime],
PVar[playerid][pPrisontime],
PVar[playerid][pFaction],
PVar[playerid][pFactionRank],
PVar[playerid][pFactionName],
PVar[playerid][pRadioFrequency],
PVar[playerid][pPaycheckTime],
PVar[playerid][pGun0],
PVar[playerid][pGun1],
PVar[playerid][pGun2],
PVar[playerid][pGun3],
PVar[playerid][pGun4],
pName(playerid));
new Query2[600];
format(Query, sizeof(Query), "UPDATE `playerinfo` SET `Ammo0` = %d, `Ammo1` = %d, `Ammo2` = %d, `Ammo3` = %d, `Ammo4` = %d, `IDnumber` = %d, `CarKey1` = %d, `Carkey2` = %d, `Carkey3` = %d,`WeaponLicense` = %d, `DrivingLicense` = %d, `Origin` = %d, `Sex` = %d, `BankPin` = %d, `Housekey1` = %d, `Housekey2` = %d, `Housekey3` = %d, `Bizkey1` = %d, `Bizkey2` = %d, `Bizkey3` = %d, `Rentkey` = %d, `Job` = %d, `Phonecontact1` = %d, `Phonecontact2` = %d, `Phonecontact3` = %d, `Phonecontact4` = %d WHERE `user` = '%s'", // Also remember to update this...
PVar[playerid][pAmmo0],
PVar[playerid][pAmmo1],
PVar[playerid][pAmmo2],
PVar[playerid][pAmmo3],
PVar[playerid][pAmmo4],
PVar[playerid][pIDnumber],
PVar[playerid][pCarkey1],
PVar[playerid][pCarkey2],
PVar[playerid][pCarkey3],
PVar[playerid][pWeaponLicense],
PVar[playerid][pDrivingLicense],
PVar[playerid][pOrigin],
PVar[playerid][pSex],
PVar[playerid][pBankpin],
PVar[playerid][pHousekey1],
PVar[playerid][pHousekey2],
PVar[playerid][pHousekey3],
PVar[playerid][pBizkey1],
PVar[playerid][pBizkey2],
PVar[playerid][pBizkey3],
PVar[playerid][pRentkey],
PVar[playerid][pJob],
PVar[playerid][pPhoneContact1],
PVar[playerid][pPhoneContact2],
PVar[playerid][pPhoneContact3],
PVar[playerid][pPhoneContact4],
pName(playerid));
new Query3[600];
format(Query3, sizeof(Query3), "UPDATE `playerinfo` SET , `Phonecontact5` = %d, `Phonecontact6` = %d, `Phonecontact7` = %d, `Phonecontact8` = %d, `Phonecontact9` = %d, `Phonecontact10` = %d, `Phonecontact1` = %d, `Phonecontact11` = %d, `Phonecontact12` = %d, `Phonecontact13` = %d, `Phonecontact14` = %d, `Phonecontact15` = %d, `Jobcheckpoints` = %d, `Accent` = %d, `Virtualworld` = %d WHERE `user` = '%s'", // Also remember to update this...
PVar[playerid][pPhoneContact5],
PVar[playerid][pPhoneContact6],
PVar[playerid][pPhoneContact7],
PVar[playerid][pPhoneContact8],
PVar[playerid][pPhoneContact9],
PVar[playerid][pPhoneContact10],
PVar[playerid][pPhoneContact11],
PVar[playerid][pPhoneContact12],
PVar[playerid][pPhoneContact13],
PVar[playerid][pPhoneContact14],
PVar[playerid][pPhoneContact15],
PVar[playerid][pJobCheckpoints],
PVar[playerid][pAccent],
PVar[playerid][pVirtualWorld],
pName(playerid));
mysql_query(Query);
mysql_query(Query2);
mysql_query(Query3);
mysql_free_result();
return 1;
}
else return 0;
}

