22.01.2010, 18:44
Code:
case LOGIN_THREAD_ID:
{
if(IsPlayerConnected(LOGIN_PLAYER_ID))
{
mysql_store_result();
if(mysql_num_rows() == 1)
{
PlayerInfo[LOGIN_PLAYER_ID][Money] = mysql_fetch_int();
GivePlayerMoney(LOGIN_PLAYER_ID,PlayerInfo[LOGIN_PLAYER_ID][Money]);
LoggedIn[LOGIN_PLAYER_ID] = true;
format(string,sizeof(string),">> You have been successfully logged in. (Money: %d, Deaths: %d)",PlayerInfo[LOGIN_PLAYER_ID][Money], PlayerInfo[LOGIN_PLAYER_ID][Deaths]);
SendClientMessage(LOGIN_PLAYER_ID,GREY,string);
mysql_free_result();
}
else
{
Wrongattempt[LOGIN_PLAYER_ID]++;
printf("Bad log in attempt by %s (Total attempts: %d)",pName,Wrongattempt[LOGIN_PLAYER_ID]);
if(Wrongattempt[LOGIN_PLAYER_ID] >= 3)
{
SendClientMessage(LOGIN_PLAYER_ID,RED,">> You have been kicked.( 3 times wrong pass )");
mysql_free_result();
return Kick(LOGIN_PLAYER_ID);
}
mysql_free_result();
SendClientMessage(LOGIN_PLAYER_ID,RED,">> Wrong Password");
}
}
Есть массив для убийств PlayerInfo[LOGIN_PLAYER_ID][Deaths]
Если делать для него то же самое, что и для денег (PlayerInfo[LOGIN_PLAYER_ID][Money] = mysql_fetch_int();
GivePlayerMoney(LOGIN_PLAYER_ID,PlayerInfo[LOGIN_PLAYER_ID][Money]);
PlayerInfo[LOGIN_PLAYER_ID][Deaths] = mysql_fetch_int();)
То как я понимаю, точнее как написано в описании мускульного плагина
Code:
mysql_fetch_int() Use this instead of mysql_fetch_row if you want the result as a single integer

