SA-MP Forums Archive
Saving player info - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Saving player info (/showthread.php?tid=150682)



Saving player info - hanzen - 27.05.2010

I got problems saving and setting the playerinfo. The thing is that it doesent read from the right column. Anyone has any idea?
Код:
	format(query, sizeof(query), "SELECT * FROM players WHERE name='%s'", PlayerInfo[playerid][pName]);
	mysql_query(query, PLAYER_CONNECT, playerid, SQLPtr);
		new key[32], idx;
			mysql_store_result(SQLPtr);
			mysql_fetch_row_format(string," ",SQLPtr);
			strtok(string, idx);
			strtok(string, idx);
			key = strtok(string, idx);
  			print(string);

			  PlayerInfo[extraid][pLevel] = strval(strtok(string, idx));
			  PlayerInfo[extraid][pSkin] = strval(strtok(string, idx));
			  PlayerInfo[extraid][pMoney] = strval(strtok(string, idx));
			  PlayerInfo[extraid][pBank] = strval(strtok(string, idx));
			  PlayerInfo[extraid][pAdmin] = strval(strtok(string, idx));
			  PlayerInfo[extraid][pInt] = strval(strtok(string, idx));
			  PlayerInfo[extraid][pVirtual] = strval(strtok(string, idx));

				SetPlayerSkin(extraid, PlayerInfo[extraid][pSkin]);
				SetPlayerVirtualWorld(extraid, PlayerInfo[extraid][pVirtual]);
				SetPlayerInterior(extraid, PlayerInfo[extraid][pInt]);

			  OnPlayerUpdate(extraid);
			  SpawnPlayer(extraid);
			  gPlayerLogged[extraid] = 1;



Re: Saving player info - coole210 - 27.05.2010

Код:
format(stringsize, sizeof(stringsize), "SELECT * FROM players, PlayerInfo[playerid][pName]);
I saw this in some guys MySQL FS


Re: Saving player info - hanzen - 27.05.2010

Quote:
Originally Posted by Coole[AG
]
Код:
format(stringsize, sizeof(stringsize), "SELECT * FROM players, PlayerInfo[playerid][pName]);
I saw this in some guys MySQL FS
I don't think there is anything wrong with the query, since it retrieves the info but the money may appear as the level and such.


Re: Saving player info - hanzen - 27.05.2010

When I try to post the stats as text IG, it seems like it fucks up after name.

Edit: