Playerstats loading
#1

Hello,

I have a problem
I want to change the save system etc. to MYSQL but when I put this function into my gamemode
than the gamemode don't load all commands actually my server load nothing
why?

Quote:

stock LoadPlayer(playerid)
{
new Data[100];
new rcnt=1;
new Field[64];
new query[128];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
MySQLCheck();
format(query,sizeof(query),"SELECT * FROM `"TABLENAME"` WHERE Username = '%s'",pname);
mysql_store_result();
mysql_fetch_row(Data);
mysql_strtok(Field, "|", Data);

while (mysql_strtok(Field, "|", "")==1)
{
if(rcnt==2)PlayerInfo[playerid][pID]=strval(Field);
if(rcnt==3)PlayerInfo[playerid][pUsername]=strval(Field);
if(rcnt==4)PlayerInfo[playerid][pKey]=strval(Field);
if(rcnt==5)PlayerInfo[playerid][pMoney]=strval(Field);
if(rcnt==6)PlayerInfo[playerid][pAuto]=strval(Field);
rcnt++;
}
return 1;
}

-Dedi
Reply


Messages In This Thread
Playerstats loading - by Tom_Dedi - 20.12.2009, 11:41
Re: Playerstats loading - by Marcel - 20.12.2009, 15:20
Re: Playerstats loading - by s0nic - 20.12.2009, 15:43
Re: Playerstats loading - by Luka P. - 20.12.2009, 15:54
Re: Playerstats loading - by s0nic - 20.12.2009, 16:02
Re: Playerstats loading - by Luka P. - 20.12.2009, 16:11
Re: Playerstats loading - by Tom_Dedi - 20.12.2009, 17:29

Forum Jump:


Users browsing this thread: 1 Guest(s)