24.11.2013, 11:53
Hello people,
I have the following problem: when I login or register a player, it doesn't spawn them. You just fill in the password and then it does nothing other than staying in the starting screen of SAMP. So that makes me things that something is wrong in my LoginPlayer function with the spawning of the player. However and I checked (and with my little knowledge I know of this programming/scripting) I couldn't find anything wrong with the code?
I have the following problem: when I login or register a player, it doesn't spawn them. You just fill in the password and then it does nothing other than staying in the starting screen of SAMP. So that makes me things that something is wrong in my LoginPlayer function with the spawning of the player. However and I checked (and with my little knowledge I know of this programming/scripting) I couldn't find anything wrong with the code?
Код:
stock LoginPlayer(playerid) { new query[126]; format(query, sizeof(query), "SELECT * FROM accounts WHERE Name = '%s'", GetName(playerid)); mysql_query(query); mysql_store_result(); while(mysql_fetch_row_format(query,"|")) { mysql_fetch_field_row(query, "id"); Player[playerid][ID] = strval(query); mysql_fetch_field_row(Player[playerid][Name], "Name"); mysql_fetch_field_row(Player[playerid][Password], "Password"); mysql_fetch_field_row(query, "AdminLevel"); Player[playerid][AdminLevel] = strval(query); mysql_fetch_field_row(query, "PlayerPos"); sscanf(query, "fff", Player[playerid][Position][0], Player[playerid][Position][1], Player[playerid][Position][2]); mysql_fetch_field_row(query, "Money"); Player[playerid][Money] = strval(query); } GivePlayerMoney(playerid, Player[playerid][Money]); SetSpawnInfo(playerid, 0, 299, Player[playerid][Position][0], Player[playerid][Position][1], Player[playerid][Position][2], 1, 2, 3, 0, 0, 0, 0, 0, 0, 0); SpawnPlayer(playerid); mysql_free_result(); }