kickmember
#1

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:
PHP код:
CMD:kickmember(playeridparams[])
{
    if(
PlayerInfo[playerid][LeaderGSF] != 1) return SendClientMessage(playeridCOLOR_RED"Error: You aren't the (Co)-Leader of any organization!");
    new 
string[75], targetplayerpName[MAX_PLAYER_NAME];
    if(
sscanf(params"u"targetplayer)) return SendClientMessage(playeridCOLOR_WHITE"Usage: /kickmember [ID]");
    if(!
IsPlayerConnected(targetplayer)) return SendClientMessage(playeridCOLOR_RED"Error: Player is not connected!");
    if(
PlayerInfo[targetplayer][MemberGSF] < 1) return SendClientMessage(playeridCOLOR_RED"Error: The player is not in the organization.");
    if(
PlayerInfo[targetplayer][LeaderGSF] == 1) return SendClientMessage(playeridCOLOR_RED"Error: Why would you kick yourself as a 'Grove Street Families' leader?");
    
PlayerInfo[playerid][MemberGSF] = 0;
    
GetPlayerName(targetplayerpNameMAX_PLAYER_NAME);
    
format(stringsizeof string"You have been kicked from the organization by the (Co)-Leader!");
    
SendClientMessage(targetplayerCOLOR_REDstring);
    
format(stringsizeof string"You have kicked %s out of the organization."pName);
    
SendClientMessage(playeridCOLOR_REDstring);
    return 
1;

Reply
#2

As for 1.
pawn Код:
PlayerInfo[targetplayer][MemberGSF] = 0;
You were demoting the player that typed the command instead of the target id.

As for 2.

I might be over looking it, but if's not working, a simple
pawn Код:
if(targetplayer == playerid) return SencClientMessage.....
If the check to see if they are a leader isn't failing, unless I'm actually overlooking this, the check to see if it's the same player typing the command shouldn't be failing.
Reply
#3

Oh thanks for your first answer, Didn't notice that.

For you second answer, Did you use ****** translator lol. I can't understand you at all.
Reply
#4

Oh no lol, English is my first language, probably just typed faster than I thought haha.

Something more readable:

If the check to see if the player using the command is a leader is working, then the check to see if the player using the command on himself should be working also, lol.
Reply
#5

Dude I don't know if my english is bad as fuck, but I just don't understand what you mean.
Reply
#6

I really don't want to double post, but I need help with this, this is not solved yet.

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: check the first post.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)