11.09.2015, 00:04
tbh I've got 2 questions,
1: When /kickmember [ID] is being comitted, it doesn't kick the player from the organization, it just sends the player (who is supposed to be kicked) a message with "You have been kicked from the organization" which is not true.
2: When the leader kicks a Non-GSF member, he gets a message with "The player is not in the organization" which is good, BUT, when the leader tries to kick himself, he doesn't get the message with "Why would you kick yourself from bla bla bla"
Code:
1: When /kickmember [ID] is being comitted, it doesn't kick the player from the organization, it just sends the player (who is supposed to be kicked) a message with "You have been kicked from the organization" which is not true.
2: When the leader kicks a Non-GSF member, he gets a message with "The player is not in the organization" which is good, BUT, when the leader tries to kick himself, he doesn't get the message with "Why would you kick yourself from bla bla bla"
Code:
PHP код:
CMD:kickmember(playerid, params[])
{
if(PlayerInfo[playerid][LeaderGSF] != 1) return SendClientMessage(playerid, COLOR_RED, "Error: You aren't the (Co)-Leader of any organization!");
new string[75], targetplayer, pName[MAX_PLAYER_NAME];
if(sscanf(params, "u", targetplayer)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /kickmember [ID]");
if(!IsPlayerConnected(targetplayer)) return SendClientMessage(playerid, COLOR_RED, "Error: Player is not connected!");
if(PlayerInfo[targetplayer][MemberGSF] < 1) return SendClientMessage(playerid, COLOR_RED, "Error: The player is not in the organization.");
if(PlayerInfo[targetplayer][LeaderGSF] == 1) return SendClientMessage(playerid, COLOR_RED, "Error: Why would you kick yourself as a 'Grove Street Families' leader?");
PlayerInfo[playerid][MemberGSF] = 0;
GetPlayerName(targetplayer, pName, MAX_PLAYER_NAME);
format(string, sizeof string, "You have been kicked from the organization by the (Co)-Leader!");
SendClientMessage(targetplayer, COLOR_RED, string);
format(string, sizeof string, "You have kicked %s out of the organization.", pName);
SendClientMessage(playerid, COLOR_RED, string);
return 1;
}