20.12.2009, 11:41
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?
-Dedi
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; } |