13.11.2014, 19:15
Hi, I have mysql data loading problem. Code:
and here i load data(here only to the position of stacking):
but code does not work no pawno errors
I would be grateful for the help.
Sorry for my bad English, I live in Lithaunia.
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(); } |
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; } |
I would be grateful for the help.
Sorry for my bad English, I live in Lithaunia.