admin commands
#2

Here is a command to kick a player.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
new cmd[256], idx;
cmd = strtok(cmdtext, idx);
if(strcmp("/kick", cmd, true) == 0)
{
if(AdminLevel[playerid] < 1) return 0;
new tmp[256];
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, COLOR_PDRIVER, "[ ! ] USAGE : /kick <ID du joueur>");
if(!isNumeric(tmp)) return SendClientMessage(playerid, COLOR_RED, "[ ! ] ID du joueur invalide !");
new otherid = strval(tmp);
if(!IsPlayerConnected(otherid)) return SendClientMessage(playerid, COLOR_RED, "[ ! ] Ce joueur n'est pas connectй !");
if(otherid == playerid) return SendClientMessage(playerid, COLOR_RED, "[ ! ] Vous ne pouvez pas vous kicker vous mкme !");
if(AdminLevel[otherid] - AdminLevel[playerid] >= 0) return SendClientMessage(playerid, COLOR_RED, "[ ! ] Vous n'avez pas le droit de kicker ce joueur !");
new AdminName[MAX_PLAYER_NAME], KickedName[MAX_PLAYER_NAME];
GetPlayerName(playerid, AdminName, sizeof(AdminName));
GetPlayerName(otherid, KickedName, sizeof(KickedName));
new string[256];
format(string, 256,"[ ! ] %s a йtй kickй par %s !", KickedName,AdminName);
TogglePlayerControllable(otherid,0);
SendClientMessageToAll( 0xff6348ff, string);
SendClientMessage(otherid,0xff6348ff, "[ ! ] Vous кtes kickй pour ( VOUS ETES KICKЙ DU SERVEUR !!! )");
new Float: x, Float: y, Float: z;
GetPlayerPos(otherid,x,y,z);
SetPlayerPos(otherid,x,y,z);
Kick(otherid);
return 1;
}
return 0;
}
Reply


Messages In This Thread
admin commands - by laserhel50 - 28.12.2009, 10:52
Re: admin commands - by Alice[WS] - 28.12.2009, 11:10
Re: admin commands - by Ironboy500 - 28.12.2009, 11:18
Re: admin commands - by Andy_McKinley - 28.12.2009, 11:49
Re: admin commands - by laserhel50 - 28.12.2009, 13:24
Re: admin commands - by JoeDaDude - 28.12.2009, 15:42
Re: admin commands - by laserhel50 - 28.12.2009, 18:29
Re: admin commands - by JoeDaDude - 28.12.2009, 18:34
Re: admin commands - by DeltaAirlines12 - 28.12.2009, 19:06

Forum Jump:


Users browsing this thread: 1 Guest(s)