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


Messages In This Thread
Saving player info - by hanzen - 27.05.2010, 13:09
Re: Saving player info - by coole210 - 27.05.2010, 13:12
Re: Saving player info - by hanzen - 27.05.2010, 13:16
Re: Saving player info - by hanzen - 27.05.2010, 13:33

Forum Jump:


Users browsing this thread: 1 Guest(s)