golmakov
Дебютант
Здравствуйте форумчане, можете помочь?
Не могу понять, ломаю мозг, почему не создается объект на скине после авторизации/регистрации
Прошу прощения за возможно "быдлокод",
у new
Код в LoadPlayerData
в @load_face and hirts
ну и соответственно когда ты создаешь объект его данные записываются в пивары.
Просто не создаются объекты.
Не могу понять, ломаю мозг, почему не создается объект на скине после авторизации/регистрации
Прошу прощения за возможно "быдлокод",
у new
PHP:
enum object_hirts
{
oName[30],
oModelid,
Float:oCoords[9]
}
new Objecthirts[MAX_PLAYERS][object_hirts];
enum object_face
{
oName[30],
oModelid,
Float:oCoords[9]
}
new Objectface[MAX_PLAYERS][object_face];
PHP:
mysql_query_string[0] = EOS;
format(mysql_query_string,512,"SELECT * FROM "T_FACE" WHERE name = '%s'", pInfo[playerid][pName]);
mysql_tquery(dbHandle, mysql_query_string, "@load_face" , "i", playerid);
mysql_query_string[0] = EOS;
format(mysql_query_string,512,"SELECT * FROM "T_HIRTS" WHERE name = '%s'", pInfo[playerid][pName]);
mysql_tquery(dbHandle, mysql_query_string, "@load_hirts" , "i", playerid);
PHP:
@load_face(playerid);
@load_face(playerid)
{
new rows;
cache_get_row_count(rows);
if(rows)
{
cache_get_value_index(0, 1, Objectface[playerid][oName], 30);
cache_get_value_index_int(0, 2, Objectface[playerid][oModelid]);
cache_get_value_index_float(0, 3, Objectface[playerid][oCoords][0]);
cache_get_value_index_float(0, 4, Objectface[playerid][oCoords][1]);
cache_get_value_index_float(0, 5, Objectface[playerid][oCoords][2]);
cache_get_value_index_float(0, 6, Objectface[playerid][oCoords][3]);
cache_get_value_index_float(0, 7, Objectface[playerid][oCoords][4]);
cache_get_value_index_float(0, 8, Objectface[playerid][oCoords][5]);
cache_get_value_index_float(0, 9, Objectface[playerid][oCoords][6]);
cache_get_value_index_float(0, 10, Objectface[playerid][oCoords][7]);
cache_get_value_index_float(0, 11, Objectface[playerid][oCoords][8]);
SetPlayerAttachedObject(playerid,0,Objectface[playerid][oModelid],2,Objectface[playerid][oCoords][0],Objectface[playerid][oCoords][1],Objectface[playerid][oCoords][2],Objectface[playerid][oCoords][3],Objectface[playerid][oCoords][4],Objectface[playerid][oCoords][5],Objectface[playerid][oCoords][6],Objectface[playerid][oCoords][7],Objectface[playerid][oCoords][8]);
}
else
{
mysql_query_string[0] = EOS;
format(mysql_query_string, 1000, "INSERT INTO "T_FACE" (name,modelid,x,y,z,x1,y1,z1,x2,y2,z2) \
VALUES \
('%s','%d','%f','%f','%f','%f','%f','%f','%f','%f','%f')",
pInfo[playerid][pName], GetPVarInt(playerid, "playerhaveface"),
GetPVarFloat(playerid, "X"),
GetPVarFloat(playerid, "Y"),
GetPVarFloat(playerid, "Z"),
GetPVarFloat(playerid, "X1"),
GetPVarFloat(playerid, "Y1"),
GetPVarFloat(playerid, "Z1"),
GetPVarFloat(playerid, "X2"),
GetPVarFloat(playerid, "Y2"),
GetPVarFloat(playerid, "Z2"));
mysql_tquery(dbHandle, mysql_query_string, "", "");
SetPlayerAttachedObject(playerid,0,GetPVarInt(playerid, "playerhaveface"),2,GetPVarFloat(playerid, "X"),GetPVarFloat(playerid, "Y"),GetPVarFloat(playerid, "Z"),GetPVarFloat(playerid, "X1"),GetPVarFloat(playerid, "Y1"),GetPVarFloat(playerid, "Z1"),GetPVarFloat(playerid, "X2"),GetPVarFloat(playerid, "Y2"),GetPVarFloat(playerid, "Z2"));
}
return 1;
}
@load_hirts(playerid);
@load_hirts(playerid)
{
new rows;
cache_get_row_count(rows);
if(rows)
{
cache_get_value_index(0, 1, Objecthirts[playerid][oName], 24);
cache_get_value_index_int(0, 2, Objecthirts[playerid][oModelid]);
cache_get_value_index_float(0, 3, Objecthirts[playerid][oCoords][0]);
cache_get_value_index_float(0, 4, Objecthirts[playerid][oCoords][1]);
cache_get_value_index_float(0, 5, Objecthirts[playerid][oCoords][2]);
cache_get_value_index_float(0, 6, Objecthirts[playerid][oCoords][3]);
cache_get_value_index_float(0, 7, Objecthirts[playerid][oCoords][4]);
cache_get_value_index_float(0, 8, Objecthirts[playerid][oCoords][5]);
cache_get_value_index_float(0, 9, Objecthirts[playerid][oCoords][6]);
cache_get_value_index_float(0, 10, Objecthirts[playerid][oCoords][7]);
cache_get_value_index_float(0, 11, Objecthirts[playerid][oCoords][8]);
SetPlayerAttachedObject(playerid,1,Objecthirts[playerid][oModelid],2,Objecthirts[playerid][oCoords][0],Objecthirts[playerid][oCoords][1],Objecthirts[playerid][oCoords][2],Objecthirts[playerid][oCoords][3],Objecthirts[playerid][oCoords][4],Objecthirts[playerid][oCoords][5],Objecthirts[playerid][oCoords][6],Objecthirts[playerid][oCoords][7],Objecthirts[playerid][oCoords][8]);
}
else
{
mysql_query_string[0] = EOS;
format(mysql_query_string, 1000, "INSERT INTO "T_HIRTS" (name,modelid,x,y,z,x1,y1,z1,x2,y2,z2) \
VALUES \
('%s','%d','%f','%f','%f','%f','%f','%f','%f','%f','%f')",
pInfo[playerid][pName], GetPVarInt(playerid, "playerhavehair"),
GetPVarFloat(playerid, "XS"),
GetPVarFloat(playerid, "YS"),
GetPVarFloat(playerid, "ZS"),
GetPVarFloat(playerid, "X1S"),
GetPVarFloat(playerid, "Y1S"),
GetPVarFloat(playerid, "Z1S"),
GetPVarFloat(playerid, "X2S"),
GetPVarFloat(playerid, "Y2S"),
GetPVarFloat(playerid, "Z2S"));
mysql_tquery(dbHandle, mysql_query_string, "", "");
SetPlayerAttachedObject(playerid,1,GetPVarInt(playerid, "playerhavehair"),2,GetPVarFloat(playerid, "XS"),GetPVarFloat(playerid, "YS"),GetPVarFloat(playerid, "ZS"),GetPVarFloat(playerid, "X1S"),GetPVarFloat(playerid, "Y1S"),GetPVarFloat(playerid, "Z1S"),GetPVarFloat(playerid, "X2S"),GetPVarFloat(playerid, "Y2S"),GetPVarFloat(playerid, "Z2S"));
}
return 1;
}
Просто не создаются объекты.
Последнее редактирование модератором:
