13.10.2013, 19:25
I need to know, or I need you guys to convert this to a single ZCMD CMD:. So it would be /invite [playerid], /uninvite [playerid] and /giverank [playerid] [rank]. But only r5+, fam members can use it.
Код:
Код:Код:else if(strcmp(choice,"invite",true) == 0) { if(!strlen(opstring)) { SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /adjust invite [player]"); return 1; } new giveplayerid = ReturnUser(opstring); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if (PlayerInfo[giveplayerid][pFMember] == 255) { // No more of this shit, our system is not designed for this /*if(PlayerInfo[giveplayerid][pLeader] == 2 || PlayerInfo[giveplayerid][pMember] == 2 && PlayerInfo[giveplayerid][pDivision] == 2) { if(PlayerInfo[giveplayerid][pGangWarn] >= 3) { SendClientMessageEx(playerid, COLOR_WHITE, "That player can not be invited. They are banned from being in a gang."); return 1; } format(string, sizeof(string), "* You've invited %s to join '%s'.",GetPlayerNameEx(giveplayerid), FamilyInfo[family][FamilyName]); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* %s has invited you to join '%s'. (type /accept family)",GetPlayerNameEx(playerid), FamilyInfo[family][FamilyName]); SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string); InviteFaction[giveplayerid] = 0; InviteOffer[giveplayerid] = playerid; InviteFamily[giveplayerid] = family; }*/ if(PlayerInfo[giveplayerid][pLeader] == 0 && PlayerInfo[giveplayerid][pMember] == 0) { if(PlayerInfo[giveplayerid][pGangWarn] >= 3) { SendClientMessageEx(playerid, COLOR_WHITE, "That player can not be invited. They are banned from being in a gang."); return 1; } format(string, sizeof(string), "* You've invited %s to join '%s'.",GetPlayerNameEx(giveplayerid), FamilyInfo[family][FamilyName]); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* %s has invited you to join '%s'. (type /accept family)",GetPlayerNameEx(playerid), FamilyInfo[family][FamilyName]); SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string); InviteFaction[giveplayerid] = 0; InviteOffer[giveplayerid] = playerid; InviteFamily[giveplayerid] = family; format(string, sizeof(string), "%s invited %s to family %d ", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), family+1); Log("logs/family.log", string); } else { SendClientMessageEx(playerid, COLOR_GREY, "That player is already in a family/faction."); } } else { SendClientMessageEx(playerid, COLOR_GREY, "That player is already in a family/faction."); } return 1; } } else { SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified."); return 1; } } else if(strcmp(choice,"uninvite",true) == 0) { if(!strlen(opstring)) { SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /adjust uninvite [player]"); return 1; } new giveplayerid = ReturnUser(opstring); if(IsPlayerConnected(giveplayerid)) { if(giveplayerid != INVALID_PLAYER_ID) { if(PlayerInfo[giveplayerid][pFMember] != family) { SendClientMessageEx(playerid, COLOR_GREY, "That player isn't in your family."); return 1; } if(PlayerInfo[giveplayerid][pRank] > PlayerInfo[playerid][pRank]) { SendClientMessageEx(playerid, COLOR_GREY, "You can't uninvite higher ranks."); return 1; } format(string, sizeof(string), "* You've kicked %s out of your family.",GetPlayerNameEx(giveplayerid)); SendClientMessageEx(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "* Family leader %s has kicked your out of the family.",GetPlayerNameEx(playerid)); SendClientMessageEx(giveplayerid, COLOR_LIGHTBLUE, string); PlayerInfo[giveplayerid][pFMember] = 255; PlayerInfo[giveplayerid][pRank] = 0; FamilyInfo[family][FamilyMembers] --; SaveFamilies(); format(string, sizeof(string), "%s uninvited %s from family %d ", GetPlayerNameEx(playerid), GetPlayerNameEx(giveplayerid), family+1); Log("logs/family.log", string); return 1; } } else { SendClientMessageEx(playerid, COLOR_GREY, "Invalid player specified."); return 1; } }