08.05.2013, 19:41
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!".
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;
}