Saving player info
#1

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;
Reply
#2

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

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.
Reply
#4

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

Edit:

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)