22.11.2015, 11:18
i am trying to save group color so when the player reconnect it spawns with group saved color but my problem is that the color not saving this is my code
PHP код:
CMD:groupcolor(playerid, params[])
{
static R, G, B;
if (sscanf(params, "iii", R,G,B)) return SendClientMessage(playerid, -1, "/groupcolor [0-255] [0-255] [0-255]");
GroupInfo[PlayerInfo[playerid][pGroupID]][gColor] = GetPlayerColor(playerid);
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(PlayerInfo[i][pGroupID] == PlayerInfo[playerid][pGroupID])
{
SetPlayerColor(i, (R * 16777216) + (G * 65536) + (B*256));
SendClientMessage(i, (R * 16777216) + (G * 65536) + (B*256), "[ Group ]: This is Group new color!");
}
}
return 1;
}
stock SaveGroups(id)
{
new file[64];
format(file, sizeof(file), "Groups/%d.ini", id);
new INI:fHandle = INI_Open(file);
if(fHandle != INI_NO_FILE)
{
INI_SetTag(fHandle, "GroupsData");
INI_WriteString(fHandle, "GroupName", GroupInfo[id][gName]);
INI_WriteString(fHandle, "PresidentName", GroupInfo[id][gPresidentName]);
INI_WriteInt(fHandle,"Active", GroupInfo[id][gActive]);
INI_WriteInt(fHandle,"GroupCash", GroupInfo[id][gCash]);
INI_WriteInt(fHandle,"GroupColor", GroupInfo[id][gColor]);
INI_Close(fHandle);
}
return 1;
}