cmd not working properly
#1

The problem is, the cmd doesn't kick the member. It does send the player a message with "You have been kicked from the organization by the (Co)-Leader" but it doesn't really kick the player... What's wrong about it?
PHP код:
CMD:kickmember(playeridparams[])
{
    if(
PlayerInfo[playerid][LeaderGSF] >= 1)
    {
        new 
targetplayer;
        if(
sscanf(params"i"targetplayer)) return SendClientMessage(playeridCOLOR_WHITE"Usage: /kickmember [ID]");
        
PlayerInfo[targetplayer][MemberGSF] = 0;
        
SendClientMessage(targetplayerCOLOR_RED"You have been kicked from the organization by the (Co)-Leader");
        
SendClientMessage(playeridCOLOR_RED"You kicked the specified member from your Organization");
    }
    else
    {
        
SendClientMessage(playeridCOLOR_RED"Error: You aren't the (Co)-Leader of any organization!");
    }
    return 
1;

Reply
#2

PHP код:
Kick(targetid); 
Put this after the message.

Maybe you should use "u" instead of "i", then you can also give the name instead of only the id.
Reply
#3

try this
pawn Код:
CMD:kickmember(playerid, params[])
{
    if(PlayerInfo[playerid][LeaderGSF] >= 1)
    {
        new targetplayer;
        if(sscanf(params, "d", targetplayer)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /kickmember [ID]");
        PlayerInfo[targetplayer][MemberGSF] = 0;
        SendClientMessage(targetplayer, COLOR_RED, "You have been kicked from the organization by the (Co)-Leader");
        SendClientMessage(playerid, COLOR_RED, "You kicked the specified member from your Organization");
        Kick(targetplayer);
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "Error: You aren't the (Co)-Leader of any organization!");
    }
    return 1;
}
Reply
#4

Nope lol, that will kick the player from the server haha, not from the organization .

I've tested it.
Reply
#5

Quote:
Originally Posted by saffierr
Посмотреть сообщение
Nope lol, that will kick the player from the server haha, not from the organization .

I've tested it.
you mean kick from what ?
Reply
#6

Quote:
Originally Posted by Bomber07
Посмотреть сообщение
you mean kick from what ?
It should kick the player from the organization not from the server.
Reply
#7

maybe you are not using
PlayerInfo[targetplayer][MemberGSF]
correctly in other place's so it wont limit player ability az member or ...
Reply
#8

pawn Код:
CMD:kickmember(playerid, params[])
{
    if(PlayerInfo[playerid][LeaderGSF] >= 1)
    {
        new string[128], targetplayer;
        if(sscanf(params, "u", targetplayer)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /kickmember [ID]");
        PlayerInfo[targetplayer][MemberGSF] = 0;
        SendClientMessage(targetplayer, COLOR_RED, "You have been kicked from the organization by the (Co)-Leader");
        SendClientMessage(playerid, COLOR_RED, "You kicked the specified member from your Organization");
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "Error: You aren't the (Co)-Leader of any organization!");
    }
    return 1;
}
Go ahead and try this one and tell me, If its working.
Reply
#9

Just add: PlayerInfo[targetplayer][MemberGSF] = 0;
Reply
#10

Quote:
Originally Posted by Roberto80
Посмотреть сообщение
Just add: PlayerInfo[targetplayer][MemberGSF] = 0;
He already included that line in his code...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)