[Tutorial] Easy MySQL Register/Login system!
#32

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;
}
I am having some issues with the code above. I tried adding more .. but I get thess errors:

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
I know this has something to do with .. too many charactars/ being too long inside the format function, but I'm no mastermind and can't figure out how to fix it currently. I know it has to be shortened to fix it probably, but I need all of them.
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;
}
Reply


Messages In This Thread
Easy MySQL Register/Login system! (Includes every single step!) - by WackoX - 18.07.2010, 12:24
Re: Easy MySQL Register/Login system! - by Calgon - 18.07.2010, 13:08
Re: Easy MySQL Register/Login system! - by WackoX - 18.07.2010, 14:21
Re: Easy MySQL Register/Login system! - by Kar - 18.07.2010, 15:18
Re: Easy MySQL Register/Login system! - by Lewwy - 18.07.2010, 15:21
Re: Easy MySQL Register/Login system! - by WackoX - 18.07.2010, 16:01
Re: Easy MySQL Register/Login system! - by Lewwy - 18.07.2010, 16:25
Re: Easy MySQL Register/Login system! - by WackoX - 18.07.2010, 17:36
Re: Easy MySQL Register/Login system! - by [HiC]TheKiller - 18.07.2010, 19:32
Re: Easy MySQL Register/Login system! - by Lewwy - 18.07.2010, 19:48
Re: Easy MySQL Register/Login system! - by WackoX - 18.07.2010, 20:12
Re: Easy MySQL Register/Login system! - by [HiC]TheKiller - 19.07.2010, 06:28
Re: Easy MySQL Register/Login system! - by Scenario - 19.07.2010, 06:35
Re: Easy MySQL Register/Login system! - by Яσскѕтая - 21.07.2010, 11:17
Re: Easy MySQL Register/Login system! - by Gforcez - 21.07.2010, 14:31
Re: Easy MySQL Register/Login system! - by Luis_Leone - 31.07.2010, 22:07
Re: Easy MySQL Register/Login system! - by WackoX - 02.08.2010, 16:44
Re: Easy MySQL Register/Login system! - by RealLifeRP - 03.08.2010, 04:41
Re: Easy MySQL Register/Login system! - by Vince - 03.08.2010, 12:37
Re: Easy MySQL Register/Login system! - by WackoX - 03.08.2010, 17:16
Re: Easy MySQL Register/Login system! - by Martin_Santiago - 05.08.2010, 07:39
Re: Easy MySQL Register/Login system! - by WackoX - 05.08.2010, 08:45
Re: Easy MySQL Register/Login system! - by Kyle - 09.08.2010, 19:34
Re: Easy MySQL Register/Login system! - by playbox12 - 17.08.2010, 20:23
Re: Easy MySQL Register/Login system! - by KotoK - 26.12.2010, 21:27
Re: Easy MySQL Register/Login system! - by Anthonyx3' - 08.01.2011, 20:08
Re: Easy MySQL Register/Login system! - by [MWR]Blood - 15.01.2011, 14:26
Re: Easy MySQL Register/Login system! - by Anthonyx3' - 15.01.2011, 14:45
Re: Easy MySQL Register/Login system! - by THE_KNOWN - 15.01.2011, 15:27
Re: Easy MySQL Register/Login system! - by THE_KNOWN - 21.01.2011, 04:35
Re: Easy MySQL Register/Login system! - by HyperZ - 31.01.2011, 07:31
Re: Easy MySQL Register/Login system! - by jesse237 - 05.02.2011, 13:00
Re: Easy MySQL Register/Login system! - by TheLazySloth - 11.10.2011, 12:04
Re : Easy MySQL Register/Login system! - by falor - 22.02.2012, 03:29
Re: Easy MySQL Register/Login system! - by ArmyOps - 22.02.2012, 10:02
Re: Easy MySQL Register/Login system! - by swindle69 - 22.02.2012, 23:43
Respuesta: Easy MySQL Register/Login system! - by ValenRatti - 26.02.2012, 07:48
Re: Easy MySQL Register/Login system! - by x96664 - 19.07.2012, 13:33
Re: Easy MySQL Register/Login system! - by Yashas - 04.12.2012, 00:22
Re: Easy MySQL Register/Login system! - by x96664 - 04.12.2012, 15:00
Re: Easy MySQL Register/Login system! - by Johnson_boy - 05.12.2012, 14:36
Re : Easy MySQL Register/Login system! - by [HRD]Mar1 - 06.12.2012, 12:39
Re: Easy MySQL Register/Login system! - by SAMPHacker - 23.01.2013, 16:20
Re: Easy MySQL Register/Login system! - by Yashas - 05.02.2013, 12:56
Re: Easy MySQL Register/Login system! - by Kiweeh - 30.05.2013, 13:37
Re: Easy MySQL Register/Login system! - by Mr.R - 26.06.2013, 19:19
Re: Easy MySQL Register/Login system! - by Vince - 26.06.2013, 20:52
Re : Easy MySQL Register/Login system! - by TomYeager - 17.08.2013, 22:15
Re: Easy MySQL Register/Login system! - by Dejan12345 - 19.07.2016, 12:14
Re: Easy MySQL Register/Login system! - by Melktert - 11.04.2017, 19:25
Re: Easy MySQL Register/Login system! - by FatihBey - 11.07.2017, 19:16
Re: Easy MySQL Register/Login system! - by coool - 12.07.2017, 07:36

Forum Jump:


Users browsing this thread: 1 Guest(s)