stock LoadAttacheplayer(playerid)
{
new aname[MAX_PLAYER_NAME]; new file[100];new strText[15];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
format(file, sizeof(file), PASTA_ACESSORIOS, aname);
if(DOF2::FileExists(file))
{
for(new i = 0; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
{
format(strText, 15, "%d_Index",i);
if(DOF2::GetInt(file,strText))
{
format(strText, 15, "%d_Index", i);
new index = DOF2::GetInt(file, strText);
format(strText, 15, "%d_Modelo", i);
new modelid = DOF2::GetInt(file, strText);
format(strText, 15, "%d_Boneid", i);
new boneid = DOF2::GetInt(file, strText);
format(strText, 15, "%d_pX", i);
new Float:fOffsetX = DOF2::GetFloat(file, strText);
format(strText, 15, "%d_pY", i);
new Float:fOffsetY = DOF2::GetFloat(file, strText);
format(strText, 15, "%d_pZ", i);
new Float:fOffsetZ = DOF2::GetFloat(file, strText);
format(strText, 15, "%d_rX", i);
new Float:fRotX = DOF2::GetFloat(file, strText);
format(strText, 15, "%d_rY", i);
new Float:fRotY = DOF2::GetFloat(file, strText);
format(strText, 15, "%d_rZ", i);
new Float:fRotZ = DOF2::GetFloat(file, strText);
format(strText, 15, "%d_eX", i);
new Float:fScaleX = DOF2::GetFloat(file, strText);
format(strText, 15, "%d_eY", i);
new Float:fScaleY = DOF2::GetFloat(file, strText);
format(strText, 15, "%d_eZ", i);
new Float:fScaleZ = DOF2::GetFloat(file, strText);
return SetPlayerAttachedObject(playerid,index,modelid,boneid,fOffsetX,fOffsetY,fOffsetZ,fRotX,fRotY,fRotZ,fScaleX,fScaleY,fScaleZ);
}
}
}
return 1;
}
tente colocar: for(new i = -1; i < MAX_PLAYER_ATTACHED_OBJECTS; i++)
|
if(DOF2::GetInt(file,strText))
Se vocк imprimir o valor de 'i' vai ver que comeзa do 0 sim, algo estб errado em seus arquivos.
|
Desculpe, nгo percebi de primeira vista, й o que o Dolby falou, se o que estб setado na chave "%d_Index" for 0 seu bloco nгo serб executado, pois a expressгo 'if(DOF2::GetInt(file,strText))' nгo checa se estб setado, checa se retorna um valor positivo, para saber se estб setado use DOF2::IsSet.
|