Setting players money / skin / level to 0 upon registering.
#1

So, I have this really weird bug.. well to me it is :/ still a noob in SQL. I have try'd to fix it but raged every time.

pawn Код:
MySQL_Register(playerid, passwordstring[])
{
    new query[ 150 ], pname[ 150 ];
    GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
    format(query,sizeof(query),"INSERT INTO PlayerInfo (user, password) VALUES ('%s', ('%s'));",pname, passwordstring);
    mysql_query(query);
    SendClientInfo(playerid, "Congradulations, you have now registed. You will be spawned at LV train Station");
    PLAYERLIST_authed[playerid] = true;
    SpawnPlayer(playerid);
    printf("%s's account created.",PlayerName(playerid));
        mysql_fetch_field_row(savingstring, "bank"); PlayerInfo[playerid][bank] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "curmoney"); PlayerInfo[playerid][curmoney] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "curmoney"); SetPlayerMoney(playerid, strval(savingstring));
        mysql_fetch_field_row(savingstring, "playerlvl"); PlayerInfo[playerid][playerlvl] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "playerlvl"); SetPlayerScore(playerid, strval(savingstring));
        mysql_fetch_field_row(savingstring, "rpoints"); PlayerInfo[playerid][rpoints] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "playertime"); PlayerInfo[playerid][playertime] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "jail"); PlayerInfo[playerid][jail] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "jailreason"); PlayerInfo[playerid][jailreason] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "jailtime"); PlayerInfo[playerid][jailtime] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "banned"); PlayerInfo[playerid][banned] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "banreason"); PlayerInfo[playerid][banreason] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "whobannedme"); PlayerInfo[playerid][whobannedme] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "whenigotbanned"); PlayerInfo[playerid][whenigotbanned] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "Skin"); PlayerInfo[playerid][Skin] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "Skin"); SetPlayerSkin(playerid, strval(savingstring));
        mysql_fetch_field_row(savingstring, "pranklvl"); PlayerInfo[playerid][ranklvl] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "rentprice"); PlayerInfo[playerid][rentprice] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "driverlic"); PlayerInfo[playerid][driverlic] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "flylic"); PlayerInfo[playerid][flylic] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "boatlic"); PlayerInfo[playerid][boatlic] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "weaplic"); PlayerInfo[playerid][weaplic] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "jobtime"); PlayerInfo[playerid][jobtime] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "jobskill"); PlayerInfo[playerid][jobskill] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "totalpayt"); PlayerInfo[playerid][totalpayt] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "kills"); PlayerInfo[playerid][kills] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "housenum"); PlayerInfo[playerid][housenum] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "loan"); PlayerInfo[playerid][loan] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "drugs"); PlayerInfo[playerid][drugs] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "guns"); PlayerInfo[playerid][guns] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "sguns"); PlayerInfo[playerid][sguns] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "sdrugs"); PlayerInfo[playerid][sdrugs] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "nreports"); PlayerInfo[playerid][nreports] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "power"); PlayerInfo[playerid][power] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "spawnX"); PlayerInfo[playerid][spawnX] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "spawnY"); PlayerInfo[playerid][spawnY] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "spawnZ"); PlayerInfo[playerid][spawnZ] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "spawnInter"); PlayerInfo[playerid][spawnInter] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "factnumber"); PlayerInfo[playerid][factnumber] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "head"); PlayerInfo[playerid][head] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "headby"); PlayerInfo[playerid][headby] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "famnumber"); PlayerInfo[playerid][famnumber] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "female"); PlayerInfo[playerid][female] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "bail"); PlayerInfo[playerid][bail] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "premium"); PlayerInfo[playerid][premium] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "gotphone"); PlayerInfo[playerid][gotphone] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "phonenumber"); PlayerInfo[playerid][phonenumber] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "phonebook"); PlayerInfo[playerid][phonebook] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "laptop"); PlayerInfo[playerid][laptop] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "virworld"); PlayerInfo[playerid][virworld] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "age"); PlayerInfo[playerid][age] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "premiumexpire"); PlayerInfo[playerid][premiumexpire] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "playerteam"); PlayerInfo[playerid][playerteam] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "playerBarrierKeys"); PlayerInfo[playerid][playerBarrierKeys] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "radio"); PlayerInfo[playerid][radio] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "freq1"); PlayerInfo[playerid][freq1] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "freq2"); PlayerInfo[playerid][freq2] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "freq3"); PlayerInfo[playerid][freq3] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "tutorial"); PlayerInfo[playerid][tutorial] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "tbanned"); PlayerInfo[playerid][tbanned] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "city"); PlayerInfo[playerid][city] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "married"); PlayerInfo[playerid][married] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "family"); PlayerInfo[playerid][family] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "faction"); PlayerInfo[playerid][faction] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "PTeamName"); PlayerInfo[playerid][PTeamName] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "job"); PlayerInfo[playerid][job] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "totalruns"); PlayerInfo[playerid][totalruns] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "fpay"); PlayerInfo[playerid][fpay] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "warns"); PlayerInfo[playerid][warns] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "helper"); PlayerInfo[playerid][helper] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "curfreq"); PlayerInfo[playerid][curfreq] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "rankname"); PlayerInfo[playerid][rankname] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "pdspawn"); PlayerInfo[playerid][pdspawn] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "phonechanges"); PlayerInfo[playerid][phonechanges] = strval(savingstring);
        mysql_fetch_field_row(savingstring, "lastonline"); PlayerInfo[playerid][lastonline] = strval(savingstring);
    mysql_free_result();
    GivePlayerMoney(playerid, PlayerInfo[playerid][curmoney]);
    SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
    SetPlayerScore(playerid, PlayerInfo[playerid][playerlvl]);
    mysql_store_result();
    return 1;
}
When you spawn upon registering, it sets your skin to: 0 (CJ) - Money to 0 - Score to 0.

Can someone please help me <3
Reply


Messages In This Thread
Setting players money / skin / level to 0 upon registering. - by Brandon_More - 17.11.2013, 20:54
Re: Setting players money / skin / level to 0 upon registering. - by StuartD - 17.11.2013, 21:00
Re: Setting players money / skin / level to 0 upon registering. - by Brandon_More - 17.11.2013, 21:06
Re: Setting players money / skin / level to 0 upon registering. - by DeStunter - 17.11.2013, 21:25

Forum Jump:


Users browsing this thread: 1 Guest(s)