Little help with MySQL
#5

Ok all things is work fine now i have fixed anything and just a little more problem is how can i load player data...

i maded this

pawn Код:
stock MySQL_Login(playerid)
{
    new Query[300],pname[24],savestr[50];
    GetPlayerName(playerid,pname,sizeof(pname));
    format(Query,sizeof(Query),"SELECT * FROM accounts WHERE user = '%s'",pname);
    mysql_query(Query);
    mysql_store_result();
    while(mysql_fetch_row_format(Query,"|"))
    {
        mysql_fetch_field_row(savestr, "money"); MoneyGiven[playerid] = strval(savestr);
    }
    mysql_free_result();
    SendClientMessage(playerid,-1,"SERVER BOT: You have been logged in!");
    Logged[playerid] = 1;
    return 1;
}
And
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(MoneyGiven[playerid] != -1)
    {
        GivePlayerMoney(playerid, MoneyGiven[playerid]);
        MoneyGiven[playerid] = -1;
    }
    return 1;
}
But it don't give me the money...
Reply


Messages In This Thread
Little help with MySQL - by xganyx - 09.09.2013, 02:54
Re: Little help with MySQL - by Eyce - 09.09.2013, 04:16
Re: Little help with MySQL - by xganyx - 10.09.2013, 00:43
Re: Little help with MySQL - by Eyce - 10.09.2013, 00:56
Re: Little help with MySQL - by xganyx - 10.09.2013, 01:24
Re: Little help with MySQL - by xganyx - 11.09.2013, 01:25
Re: Little help with MySQL - by ViruZz - 11.09.2013, 01:33
Re: Little help with MySQL - by xganyx - 11.09.2013, 03:24

Forum Jump:


Users browsing this thread: 3 Guest(s)