13.03.2014, 00:04
(
Последний раз редактировалось Phil_Cutcliffe; 13.03.2014 в 01:17.
)
I think this is loading the file more than once.. I want to debug to check that.. Unless some one can see that it is by reading my code. If so how would I stop it doing it more than once? Thanks
pawn Код:
forward SaveToys(playerid);
public SaveToys(playerid)
{
if(IsPlayerConnected(playerid) && PLogged[playerid])
{
new stringtoy[55];
new value[256];
format(stringtoy, sizeof(stringtoy), "South-WestRP/PlayerToys/%s.ini", GetPlayerNameEx(playerid));
if(!dini_Exists(stringtoy)) dini_Create(stringtoy);
for(new x = 0; x < MAX_TOYS; x++)
{
format(value, sizeof(value), "tCreated[%d]", x);
dini_IntSet(stringtoy, value, ToyInfo[playerid][x][tCreated]);
format(value, sizeof(value), "tEquipped[%d]", x);
dini_IntSet(stringtoy, value, ToyInfo[playerid][x][tEquipped]);
format(value, sizeof(value), "tName[%d]", x);
dini_Set(stringtoy, value, ToyInfo[playerid][x][tName]);
format(value, sizeof(value), "tIndexID[%d]", x);
dini_IntSet(stringtoy, value, ToyInfo[playerid][x][tIndexID]);
format(value, sizeof(value), "tModelID[%d]", x);
dini_IntSet(stringtoy, value, ToyInfo[playerid][x][tModelID]);
format(value, sizeof(value), "tBoneID[%d]", x);
dini_IntSet(stringtoy, value, ToyInfo[playerid][x][tBoneID]);
format(value, sizeof(value), "tOffsetX[%d]", x);
dini_FloatSet(stringtoy, value, ToyInfo[playerid][x][tOffsetX]);
format(value, sizeof(value), "tOffsetY[%d]", x);
dini_FloatSet(stringtoy, value, ToyInfo[playerid][x][tOffsetY]);
format(value, sizeof(value), "tOffsetZ[%d]", x);
dini_FloatSet(stringtoy, value, ToyInfo[playerid][x][tOffsetZ]);
format(value, sizeof(value), "tRotX[%d]", x);
dini_FloatSet(stringtoy, value, ToyInfo[playerid][x][tRotX]);
format(value, sizeof(value), "tRotY[%d]", x);
dini_FloatSet(stringtoy, value, ToyInfo[playerid][x][tRotY]);
format(value, sizeof(value), "tRotZ[%d]", x);
dini_FloatSet(stringtoy, value, ToyInfo[playerid][x][tRotZ]);
format(value, sizeof(value), "tScaleX[%d]", x);
dini_FloatSet(stringtoy, value, ToyInfo[playerid][x][tScaleX]);
format(value, sizeof(value), "tScaleY[%d]", x);
dini_FloatSet(stringtoy, value, ToyInfo[playerid][x][tScaleY]);
format(value, sizeof(value), "tScaleZ[%d]", x);
dini_FloatSet(stringtoy, value, ToyInfo[playerid][x][tScaleZ]);
}
}
return 1;
}
forward LoadToys(playerid);
public LoadToys(playerid)
{
new stringtoy[55];
new value[256];
format(stringtoy, sizeof(stringtoy), "South-WestRP/PlayerToys/%s.ini", GetPlayerNameEx(playerid));
if(!dini_Exists(stringtoy)) return 0;
for(new x = 0; x < MAX_TOYS; x++)
{
format(value, sizeof(value), "tCreated[%d]", x);
ToyInfo[playerid][x][tCreated] = dini_Int(stringtoy, value);
format(value, sizeof(value), "tEquipped[%d]", x);
ToyInfo[playerid][x][tEquipped] = dini_Int(stringtoy, value);
format(value, sizeof(value), "tName[%d]", x);
strmid(ToyInfo[playerid][x][tName], dini_Get(stringtoy, value), 0, strlen(dini_Get(stringtoy, value)), 128);
format(value, sizeof(value), "tIndexID[%d]", x);
ToyInfo[playerid][x][tIndexID] = dini_Int(stringtoy, value);
format(value, sizeof(value), "tModelID[%d]", x);
ToyInfo[playerid][x][tModelID] = dini_Int(stringtoy, value);
format(value, sizeof(value), "tBoneID[%d]", x);
ToyInfo[playerid][x][tBoneID] = dini_Int(stringtoy, value);
format(value, sizeof(value), "tOffsetX[%d]", x);
ToyInfo[playerid][x][tOffsetX] = dini_Float(stringtoy, value);
format(value, sizeof(value), "tOffsetY[%d]", x);
ToyInfo[playerid][x][tOffsetY] = dini_Float(stringtoy, value);
format(value, sizeof(value), "tOffsetZ[%d]", x);
ToyInfo[playerid][x][tOffsetZ] = dini_Float(stringtoy, value);
format(value, sizeof(value), "tRotX[%d]", x);
ToyInfo[playerid][x][tRotX] = dini_Float(stringtoy, value);
format(value, sizeof(value), "tRotY[%d]", x);
ToyInfo[playerid][x][tRotY] = dini_Float(stringtoy, value);
format(value, sizeof(value), "tRotZ[%d]", x);
ToyInfo[playerid][x][tRotZ] = dini_Float(stringtoy, value);
format(value, sizeof(value), "tScaleX[%d]", x);
ToyInfo[playerid][x][tScaleX] = dini_Float(stringtoy, value);
format(value, sizeof(value), "tScaleY[%d]", x);
ToyInfo[playerid][x][tScaleY] = dini_Float(stringtoy, value);
format(value, sizeof(value), "tScaleZ[%d]", x);
ToyInfo[playerid][x][tScaleZ] = dini_Float(stringtoy, value);
}
return 1;
}