#1

// Fixed.
Reply
#2

The identifiers are case sensitive in PAWN.Capital Letters do matter a lot here.
Just change ReasonMSG to ReasonMsg and its fixed.
Reply
#3

-___- Thx.
Reply
#4

EDIT

When I first tried the command it gave me why I got kicked in the chat.
But now it only gives me the gametextforplayer "KICKED!".

pawn Код:
CMD:kick(playerid, params[])
{
    new PlayerToKick, Reason[128], ReasonMsg[128], Name[24];
    SendAdminText(playerid, "/kick", params);
    if (APlayerData[playerid][LoggedIn] == true)
    {
        if (APlayerData[playerid][PlayerLevel] >= 1)
        {
            if (sscanf(params, "us[128]", PlayerToKick, Reason)) SendClientMessage(playerid, 0xFF0000AA, "Usage: \"/kick [id] [reason]\"");
            else
                if (IsPlayerConnected(PlayerToKick))
                {
                    GameTextForPlayer(playerid,"~r~KICKED!",5000,3);
                    GetPlayerName(playerid, Name, sizeof(Name));
                    GameTextForPlayer(playerid,"~r~KICKED!",5000,3);
                    SendClientMessage(playerid, 0xFF0000, "You have been kicked by an Adminstrator - Reason: %s", ReasonMsg);
                    Kick(PlayerToKick);
                }
                else
                    SendClientMessage(playerid, 0xFF0000FF, "{FF0000}Error: {FFFFFF}No player with that ID!");
        }
        else
            return 0;
    }
    else
        return 0;
    return 1;
}
Reply
#5

You can't give format in SendClientMessage.It doesn't accept the specifiers.So you must use format(string,length,"format",....); then call the SendClientMessage.

https://sampwiki.blast.hk/wiki/Format

And the next issues is all client message will not be shown just before Kick();
So you must use a timer to Kick the player.

Код:
SetTimerEx("KickPlayer",1000,0,"i",playerid);
forward KickPlayer(playerid);
public KickPlayer(playerid)
{
      Kick(playreid);
}
Reply
#6

Still same thing, but it only says 'Server closed the connection.".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)