23.01.2010, 16:40
pawn Код:
case LOGIN_THREAD_ID:
{
if(IsPlayerConnected(LOGIN_PLAYER_ID))
{
mysql_store_result(); new resultline[64],fetch[64];; //adjust it to your needs
if(mysql_fetch_row_format(resultline))
{
mysql_fetch_field_row(fetch,"money"); PlayerInfo[LOGIN_PLAYER_ID][pMoney] = strval(fetch); //your filed name
PlayerInfo[LOGIN_PLAYER_ID][pMoney] = mysql_fetch_int();
GivePlayerMoney(LOGIN_PLAYER_ID,PlayerInfo[LOGIN_PLAYER_ID][pMoney]);
mysql_fetch_field_row(fetch,"deaths"); PlayerInfo[LOGIN_PLAYER_ID][pDeaths] = strval(fetch); //your field name
LoggedIn[LOGIN_PLAYER_ID] = true;
format(string,sizeof(string),">> You have been successfully logged in. (Money: %d, Deaths: %d)",PlayerInfo[LOGIN_PLAYER_ID][pMoney],PlayerInfo[LOGIN_PLAYER_ID][pDeaths]);
SendClientMessage(LOGIN_PLAYER_ID,GREY,string);
mysql_free_result();
}