12.03.2014, 18:09
(
Последний раз редактировалось Phil_Cutcliffe; 12.03.2014 в 18:49.
)
Have I written this correctly?
pawn Код:
forward SaveToys(playerid);
public SaveToys(playerid)
{
if(IsPlayerConnected(playerid) && PLogged[playerid])
{
new stringtoy[55];
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++)
{
dini_IntSet(stringtoy, "tCreated", ToyInfo[playerid][x][tCreated]);
dini_IntSet(stringtoy, "tEquipped", ToyInfo[playerid][x][tEquipped]);
dini_Set(stringtoy, "tName", ToyInfo[playerid][x][tName]);
dini_IntSet(stringtoy, "tIndexID", ToyInfo[playerid][x][tIndexID]);
dini_IntSet(stringtoy, "tModelID", ToyInfo[playerid][x][tModelID]);
dini_IntSet(stringtoy, "tBoneID", ToyInfo[playerid][x][tBoneID]);
dini_FloatSet(stringtoy, "tOffsetX", ToyInfo[playerid][x][tOffsetX]);
dini_FloatSet(stringtoy, "tOffsetY", ToyInfo[playerid][x][tOffsetY]);
dini_FloatSet(stringtoy, "tOffsetZ", ToyInfo[playerid][x][tOffsetZ]);
dini_FloatSet(stringtoy, "tRotX", ToyInfo[playerid][x][tRotX]);
dini_FloatSet(stringtoy, "tRotY", ToyInfo[playerid][x][tRotY]);
dini_FloatSet(stringtoy, "tRotZ", ToyInfo[playerid][x][tRotZ]);
dini_FloatSet(stringtoy, "tScaleX", ToyInfo[playerid][x][tScaleX]);
dini_FloatSet(stringtoy, "tScaleY", ToyInfo[playerid][x][tScaleY]);
dini_FloatSet(stringtoy, "tScaleZ", ToyInfo[playerid][x][tScaleZ]);
}
}
return 1;
}
forward LoadToys(playerid);
public LoadToys(playerid)
{
new stringtoy[55];
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++)
{
ToyInfo[playerid][x][tCreated] = dini_Int(stringtoy, "tCreated");
ToyInfo[playerid][x][tEquipped] = dini_Int(stringtoy, "tEquipped");
strmid(ToyInfo[playerid][x][tName], dini_Get(stringtoy, "tName"), 0, strlen(dini_Get(stringtoy, "tName")), 128);
ToyInfo[playerid][x][tIndexID] = dini_Int(stringtoy, "tIndexID");
ToyInfo[playerid][x][tModelID] = dini_Int(stringtoy, "tModelID");
ToyInfo[playerid][x][tBoneID] = dini_Int(stringtoy, "tBoneID");
ToyInfo[playerid][x][tOffsetX] = dini_Float(stringtoy, "tOffsetX");
ToyInfo[playerid][x][tOffsetY] = dini_Float(stringtoy, "tOffsetY");
ToyInfo[playerid][x][tOffsetZ] = dini_Float(stringtoy, "tOffsetZ");
ToyInfo[playerid][x][tRotX] = dini_Float(stringtoy, "tRotX");
ToyInfo[playerid][x][tRotY] = dini_Float(stringtoy, "tRotY");
ToyInfo[playerid][x][tRotZ] = dini_Float(stringtoy, "tRotZ");
ToyInfo[playerid][x][tScaleX] = dini_Float(stringtoy, "tScaleX");
ToyInfo[playerid][x][tScaleY] = dini_Float(stringtoy, "tScaleY");
ToyInfo[playerid][x][tScaleZ] = dini_Float(stringtoy, "tScaleZ");
}
return 1;
}