23.10.2014, 11:32
Hey all, i have some problem when load player data from database.
Please help me, i can't fix it.
There's the script.
Can you help me to fix it?
Thanks
Please help me, i can't fix it.
There's the script.
Код:
stock LoadPlayerInfo(playerid) { new Query[67],dkills, ddeaths, dmoney, dlevel, dexp, dexpL, pname[16]; mysql_real_escape_string(pName(playerid), pname); format(Query, sizeof(Query), "SELECT `kills`,`deaths`,`money`,`Level`,`EXP`,`EXP_L` FROM `playerinfo` WHERE `user` = '%s'", pname); mysql_query(Query); mysql_store_result(); if(mysql_num_rows() > 0) { while(mysql_fetch_row(Query)) { sscanf(Query, "p<|>iffff", dkills, ddeaths, dmoney, dlevel, dexp, dexpL); PVar[playerid][pKills] = dkills; PVar[playerid][pDeaths] = ddeaths; GivePlayerMoney(playerid, dmoney); PVar[playerid][pLevel] = dlevel; PVar[playerid][pExp] = dexp; PVar[playerid][pExpL] = dexpL; } } format(Msg, sizeof(Msg), "DATA : %d %d %d %d %d %d", dkills, ddeaths, dmoney, dlevel, dexp, dexpL); SendClientMessage(playerid, COLOR_CADETBLUE, Msg); mysql_free_result(); return 1; }
Thanks