22.05.2012, 16:29
Спасибо тем кто пытался помочь...
Проблему решил
Заместо этого mysql_free_result();
Раньше стояло: mysql_query(query);
Проблему решил
PHP код:
public OnPlayerLogin(playerid,password[])
{
new name[MAX_PLAYER_NAME],result[MAX_RESULT], string[256];
GetPlayerName(playerid, name, sizeof(name));
format(query,sizeof(query), "SELECT * FROM `accounts` WHERE `Name` = '%s' AND `Password` = '%s'", name,password);
mysql_query(query);
mysql_store_result();
if(mysql_fetch_row(result))
{
format(query,sizeof(query),"SELECT * FROM `accounts` WHERE `Name` = '%s'",name);
mysql_query(query);
mysql_store_result();
if(!mysql_fetch_row(result)) return 0;
sscanf(result, "p<|>s[24]s[32]iiiiiifffiiiiiiiiiiiii", // i - ид (int), s[размер] - string, ник и пароль.
name, Player[playerid][pPass],Player[playerid][pAdmin], Player[playerid][pTutorial], Player[playerid][pAge],
Player[playerid][pSex], Player[playerid][pOrigin], Player[playerid][pModel], Player[playerid][pCordX],
Player[playerid][pCordY], Player[playerid][pCordZ], Player[playerid][pCarkey], Player[playerid][pCash],
Player[playerid][pBank], Player[playerid][pLeader], Player[playerid][pMember], Player[playerid][pRank],
Player[playerid][pWarns], Player[playerid][pInvWeapon], Player[playerid][pInvWeapon2], Player[playerid][pInvWeapon3],
Player[playerid][pInvAmmo], Player[playerid][pInvAmmo2], Player[playerid][pInvAmmo3]);
if(Player[playerid][pAdmin] > 0)
{
format(string,sizeof(string), "{ffffff}Вы вошли как администратор {03c03c}%d {ffffff}уровня.", Player[playerid][pAdmin]);
SendClientMessage(playerid,COLOR_GRAD1,string);
}
ResetPlayerMoney(playerid);
GivePlayerMoney(playerid,Player[playerid][pCash]);
gPlayerLogged[playerid] = true;
SendClientMessage(playerid,0xFF00000,"Сервер Free Life, делает Stepan23");// Выводим игрок сообщение
mysql_free_result();
SpawnPlayer(playerid);// Спавним игрока
}
Раньше стояло: mysql_query(query);