SA-MP Forums Archive
cmd not working properly - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: cmd not working properly (/showthread.php?tid=587683)



cmd not working properly - saffierr - 01.09.2015

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;




Re: cmd not working properly - MarvinPWN - 01.09.2015

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.


Re: cmd not working properly - simo0000 - 01.09.2015

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;
}



Re: cmd not working properly - saffierr - 01.09.2015

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

I've tested it.


Re: cmd not working properly - Bomber07 - 01.09.2015

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 ?



Re: cmd not working properly - saffierr - 01.09.2015

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


Re: cmd not working properly - khRamin78 - 02.09.2015

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


Re: cmd not working properly - benjaminjones - 02.09.2015

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.


Re: cmd not working properly - Roberto80 - 02.09.2015

Just add: PlayerInfo[targetplayer][MemberGSF] = 0;


Re: cmd not working properly - SpaceX - 02.09.2015

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