SA-MP Forums Archive
+REP, Change ID. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: +REP, Change ID. (/showthread.php?tid=591222)



+REP, Change ID. - norton2 - 09.10.2015

Sometimes changing player ID without reason. The only change in the game, not in time mysql database.
I make a debug:
Код HTML:
printf("ID: %d", pInfo[playerid][pID]);
.LOG:
Код HTML:
 ID: 48
pInfo[playerid][pID] = 1. Not 48.

Код HTML:
mysql_format(MySQLCon, query, sizeof(query), "SELECT * FROM players WHERE user = '%s'", GetName(playerid));
            mysql_pquery(MySQLCon, query, "OnPlayerLogin", "d", playerid);
Код HTML:
forward OnPlayerLogin(playerid);
public OnPlayerLogin(playerid)
{
    new rows, fields;
    cache_get_data(rows, fields);
    if(rows)
    {
        pInfo[playerid][pID] = cache_get_field_content_int(0, "ID");
    }
.....etc



Re: +REP, Change ID. - faff - 09.10.2015

Updating sscanf and foreach helped for me.


Re: +REP, Change ID. - norton2 - 09.10.2015

ok.. Sscanf Emmett's version?


Re: +REP, Change ID. - Ahmad45123 - 09.10.2015

Quote:
Originally Posted by norton2
Посмотреть сообщение
ok.. Sscanf Emmett's version?
Yeah, Its the latest stable version.


Re: +REP, Change ID. - norton2 - 10.10.2015

Ok, thank you all!