CMD:fcreate(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] > 3 || PlayerInfo[playerid][pGangModerator] == 1)
{
new string[128], family, giveplayerid;
if(sscanf(params, "du", family, giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /fcreate [FamilyNr] [playerid]");
if(family < 1 || family > 14) { SendClientMessageEx(playerid, COLOR_GREY, " Family Slot can't be below 1 or above 14!"); return 1; }
if(IsPlayerConnected(giveplayerid))
{
if(FamilyInfo[family-1][FamilyTaken] == 1)
{
SendClientMessageEx(playerid, COLOR_GREY, " That Family Slot is already taken!" );
return 1;
}
format(string, sizeof(string), "* You've made %s the Leader of Family Slot %d.",GetPlayerNameEx(giveplayerid),family);
SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "* Admin %s has made you a Family Leader.", GetPlayerNameEx(playerid));
SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string);
new sendername[MAX_PLAYER_NAME];
GetPlayerName(giveplayerid, sendername, sizeof(sendername));
format(string, sizeof(string), "%s",sendername);
strmid(FamilyInfo[family-1][FamilyLeader], string, 0, strlen(string), 24);
FamilyInfo[family-1][FamilyMembers] ++;
FamilyInfo[family-1][FamilyTaken] = 1;
PlayerInfo[giveplayerid][pFMember] = family-1;
PlayerInfo[giveplayerid][pRank] = 6;
SaveFamilies();
}
else
{
SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified.");
return 1;
}
}
return 1;
}
"USAGE: /fcreate [FamilyNr] [playerid]" |
CMD:fcreate(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] > 3 || PlayerInfo[playerid][pGangModerator] == 1) { new string[128], family, giveplayerid; if(sscanf(params, "dr", family, giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /fcreate [FamilyNr] [playerid]"); if(family < 1 || family > 14) { SendClientMessageEx(playerid, COLOR_GREY, " Family Slot can't be below 1 or above 14!"); return 1; } if(IsPlayerConnected(giveplayerid)) { if(FamilyInfo[family-1][FamilyTaken] == 1) { SendClientMessageEx(playerid, COLOR_GREY, " That Family Slot is already taken!" ); return 1; } format(string, sizeof(string), "* You've made %s the Leader of Family Slot %d.",GetPlayerNameEx(giveplayerid),family); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Admin %s has made you a Family Leader.", GetPlayerNameEx(playerid)); SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string); new sendername[MAX_PLAYER_NAME]; GetPlayerName(giveplayerid, sendername, sizeof(sendername)); format(string, sizeof(string), "%s",sendername); strmid(FamilyInfo[family-1][FamilyLeader], string, 0, strlen(string), 24); FamilyInfo[family-1][FamilyMembers] ++; FamilyInfo[family-1][FamilyTaken] = 1; PlayerInfo[giveplayerid][pFMember] = family-1; PlayerInfo[giveplayerid][pRank] = 6; SaveFamilies(); } else { SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified."); return 1; } } return 1; }