CMD:fcolor(playerid, params[])
{
new family, colorcode[25], string2[26];
if(sscanf(params, "is[25]", family, colorcode))
{
SendClientMessage(playerid, COLOR_GREY, "/fcolor [familyid] [HEX-Colorcode]");
return 1;
}
format(string2, sizeof(string2), "%s",colorcode);
//strmid(FamilyInfo[family][fColor], string2, 0, 24);
strcpy(FamilyInfo[family][fColor], string2, 25);
format(string, sizeof(string), "You have adjusted Family %d's Color to ID {%s}%s", family,colorcode, FamilyInfo[family][fColor]);
SendClientMessage(playerid, COLOR_WHITE, string);
SaveFamilies();
return 1;
}
for(new i = 0; i < sizeof(FamilyInfo); i++)
{
if(FamilyInfo[i][FamilyTaken] == 1)
{
number ++;
format(string, sizeof(string), "** {%s}%s{F0F0F0} - Led by %s - Current Members: %d - Family Cookies: 0 - Strikes: %d of 3",FamilyInfo[i][fColor], FamilyInfo[i][FamilyName],FamilyInfo[i][FamilyLeader],FamilyInfo[i][FamilyMembers],FamilyInfo[i][fCookies] ,FamilyInfo[i][FStrikes]);
SendClientMessage(playerid, COLOR_GRAD6, string);
}
}
for(new i = 0; i < sizeof(FamilyInfo); i++)
{
if(FamilyInfo[i][FamilyTaken] == 1)
{
number ++;
format(string, sizeof(string), "** {%s} %s{F0F0F0} - Led by %s - Current Members: %d - Family Cookies: 0 - Strikes: %d of 3",FamilyInfo[i][fColor], FamilyInfo[i][FamilyName],FamilyInfo[i][FamilyLeader],FamilyInfo[i][FamilyMembers],FamilyInfo[i][fCookies] ,FamilyInfo[i][FStrikes]);
SendClientMessage(playerid, COLOR_GRAD6, string);
}
}
CMD:fcheckcolor(playerid, params[])
{
new family;
if(sscanf(params, "i", family))
{
SendClientMessage(playerid, COLOR_GREY, "/fcolor [familyid]");
return 1;
}
format(string, sizeof(string), "Family %d's color is ID {%s}%s", family, FamilyInfo[family][fColor], FamilyInfo[family][fColor]);
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
I've created this command for debug:
PHP код:
|
for(new i = 0; i < sizeof(FamilyInfo); i++)
{
if(FamilyInfo[i][FamilyTaken] == 1)
{
number ++;
format(string, sizeof(string), "** {%s}%s %s{F0F0F0} - Led by %s - Current Members: %d - Family Cookies: 0 - Strikes: %d of 3", FamilyInfo[i][fColor], FamilyInfo[i][fColor], FamilyInfo[i][FamilyName], FamilyInfo[i][FamilyLeader], FamilyInfo[i][FamilyMembers], FamilyInfo[i][fCookies], FamilyInfo[i][FStrikes]);
SendClientMessage(playerid, COLOR_GRAD6, string);
}
}
for(new i = 0; i < sizeof(FamilyInfo); i++)
{
if(FamilyInfo[i][FamilyTaken] == 1)
{
number ++;
format(string, sizeof(string), "** {%s}%s %s{F0F0F0} - Led by %s - Current Members: %d - Family Cookies: 0 - Strikes: %d of 3", FamilyInfo[i][fColor], FamilyInfo[i][fColor], FamilyInfo[i][FamilyName], FamilyInfo[i][FamilyLeader], FamilyInfo[i][FamilyMembers], FamilyInfo[i][fCookies], FamilyInfo[i][FStrikes]);
SendClientMessage(playerid, COLOR_GRAD6, string);
}
}
This code:
PHP код:
It's now not displaying the family's name? Because you added one more FamilyINfo[i][fColor] Variable. |
** /*Color Violet*/ C7B1E6 /*Color White*/ SAMP_Family - Led by: pds2k12 - Current Members: 2012 - Family Cookies: 2012 - Strikes: 0 of 3