Please help with Mysql data load
#1

Hi, I have mysql data loading problem. Code:
Quote:

forward MysqlLoad(playerid);
public MysqlLoad(playerid)
{
new query[100], pname[MAX_PLAYER_NAME], savingstring[50];
GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
format(query,sizeof(query),"SELECT Pinigai, Patirtis, PosX, PosY, PosZ, PosA, Naujokas, Lytis FROM pinfo WHERE Name = '%s'",pname);
mysql_query(query);
mysql_store_result();
while(mysql_fetch_row_format(query,"|"))
{
mysql_fetch_field_row(savingstring, "Pinigai"); PlayerInfo[playerid][Pinigai] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Patirtis"); PlayerInfo[playerid][Patirtis] = strval(savingstring);
mysql_fetch_field_row(savingstring, "PosX"); PlayerInfo[playerid][PosX] = strval(savingstring);
mysql_fetch_field_row(savingstring, "PosY"); PlayerInfo[playerid][PosY] = strval(savingstring);
mysql_fetch_field_row(savingstring, "PosZ"); PlayerInfo[playerid][PosZ] = strval(savingstring);
mysql_fetch_field_row(savingstring, "PosA"); PlayerInfo[playerid][PosA] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Naujokas"); PlayerInfo[playerid][Naujokas] = strval(savingstring);
mysql_fetch_field_row(savingstring, "Lytis"); PlayerInfo[playerid][Lytis] = strval(savingstring);
}
mysql_free_result();
}

and here i load data(here only to the position of stacking):
Quote:

public OnPlayerSpawn(playerid)
{
if(Death[playerid] == 1)
{
SetPlayerPos(playerid, -197.3941,-1770.4453,675.7687);
SetPlayerInterior(playerid, 3);
Death[playerid] = 0;
}
else
{
SetPlayerPos(playerid, PlayerInfo[playerid][PosX],PlayerInfo[playerid][PosY],PlayerInfo[playerid][PosZ]);
SetPlayerFacingAngle(playerid, PlayerInfo[playerid][PosA]);
}
return 1;
}

but code does not work no pawno errors
I would be grateful for the help.
Sorry for my bad English, I live in Lithaunia.
Reply


Messages In This Thread
Please help with Mysql data load - by edvardass - 13.11.2014, 19:15
Re: Please help with Mysql data load - by Dziugsas - 13.11.2014, 19:21
Re: Please help with Mysql data load - by TakeiT - 13.11.2014, 19:25
Re: Please help with Mysql data load - by edvardass - 13.11.2014, 20:39
Re: Please help with Mysql data load - by Runn3R - 13.11.2014, 20:59
Re: Please help with Mysql data load - by TakeiT - 13.11.2014, 21:03
Re: Please help with Mysql data load - by Runn3R - 13.11.2014, 21:44
Re: Please help with Mysql data load - by sammp - 13.11.2014, 21:57

Forum Jump:


Users browsing this thread: 1 Guest(s)