Quote:
Originally Posted by [AC
Etch ]
Quote:
Originally Posted by NPTechStudios
Do you want a command that can Ban and or Kick a Player?
If so, use this,
Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/ban (playerid)", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid)) // This makes only RCON admins allowed to use this command.
{
Ban(playerid); //Bans the player.
}
else // If the person using command is not RCON
{
SendClientMessage(playerid, /*Your Color Here*/ , "The command entered is for RCON admins only!"); // Message sent if not RCON
return 1;
}
}
return 0;
}
if (strcmp("/kick (playerid)", cmdtext, true, 10) == 0)
{
if(IsPlayerAdmin(playerid)) // This makes only RCON admins allowed to use this command.
{
Kick(playerid); //Bans the player.
}
else // If the person using command is not RCON
{
SendClientMessage(playerid, /*Your Color Here*/ , "The command entered is for RCON admins only!"); // Message sent if not RCON
return 1;
}
}
return 0;
}
Hope this helps... I think there is 1 error in the code, but its an easy fix.
|
that will ban/kick the player who write the command
|
Ahh. Okay. Wow, I guess I wasn't thinking clearly.