Help with kick command
#1

Hello, I have problem with kick command. When I tipe /kick it kick the player but don't send him a message.

There is the code:
pawn Код:
CMD:kick(playerid, params[])
    {
        if(PlayerInfo[playerid][pAdmin] == 1)
        {
            new PID;
            new reason[64];
            new str[127];
            new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
            GetPlayerName(playerid, Adminname, sizeof(Adminname));
            GetPlayerName(PID, Playername, sizeof(Playername));
            if(sscanf(params, "us", PID,reason)) return SendClientMessage(playerid, ZALIA, "Naudojimas: /kick [Vardas] [Priezastis]");
            if(!IsPlayerConnected(PID))
                return SendClientMessage(playerid, RAUDONA, "Юaidлjas neprisijunges!");
            format(str, sizeof(str), "[KICK] %s iрmetл %s uю [%s] ", Playername, Adminname, reason);
            kickzinute[playerid] = SendClientMessageToAll(GELTONA, str);
            SetTimer("kickzinutestimeris", 10, false);
            Kick(PID);
         }
         else
         {
            SendClientMessage(playerid, RAUDONA, "Рia komanda gali naudotis tik Administratoriai");
         }
        return 1;
    }
And other:
pawn Код:
forward kickzinutestimeris(playerid);
public kickzinutestimeris(playerid)
{
    SendClientMessageToAll(GELTONA, kickzinute[playerid]);
}
Reply
#2

Код:
stock KickEx(playerid) return SetTimerEx("KickPublic", 1000, 0, "d", playerid);
Код:
forward KickPublic(playerid);
public KickPublic(playerid) Kick(playerid);
And use KickEx(playerid) instead of Kick(playerid)
Reply
#3

Quote:
Originally Posted by LocMax
Посмотреть сообщение
Код:
stock KickEx(playerid) return SetTimerEx("KickPublic", 1000, 0, "d", playerid);
Код:
forward KickPublic(playerid);
public KickPublic(playerid) Kick(playerid);
And use KickEx(playerid) instead of Kick(playerid)
Thanks +Rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)