Discard something loaded
#3

Quote:
Originally Posted by PrawkC
Посмотреть сообщение
Heres my load player
pawn Код:
stock LoadPlayer(playerid)
{
    new tmp[200];
    format(tmp, sizeof(tmp), "SELECT * FROM players WHERE username = '%s'", p_data[playerid][name]);
    mysql_query(tmp);
    mysql_store_result();
    if(mysql_num_rows() == 0) return printf("Failed to load data for %s he isn't registered!", p_data[playerid][name]);
    while(mysql_fetch_row_format(tmp,"|"))
    {
        sscanf(tmp, "p<|>i{s[24]s[24]s[24]}i",
        p_data[playerid][SQLID],
        p_data[playerid][admin]);
    }
    return printf("Player %s loaded, values admin = %d | kills = %d", p_data[playerid][name] ,p_data[playerid][admin]);
}
using { } around the fields you dont want to be used (in the sscanf line)
Oh awesome, thanks!
Reply


Messages In This Thread
Discard something loaded - by Scenario - 07.09.2011, 22:13
Re: Discard something loaded - by PrawkC - 07.09.2011, 22:25
Re: Discard something loaded - by Scenario - 07.09.2011, 22:52

Forum Jump:


Users browsing this thread: 1 Guest(s)