12.10.2013, 07:21
When admin join server
And you need to ban and kick players i will show you how by RCON admin you can change the variable to your gamemode ones
Ps: this will work only when you are RCON admin , /rcon login [password]
pawn Код:
public OnPlayerSpawn(playerid)
{
if(IsPlayerAdmin(playerid)) SendClientMessageToAll(0xDEEE20FF, "Adminstrator has joined server welcome!");
return 1; //this will work if you are the rcon admin only , not for rest of admins change to your enum data
}
Ps: this will work only when you are RCON admin , /rcon login [password]
pawn Код:
CMD:kick(playerid, params[])
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,"{FF0000}[ERROR]:{FAF5F5}You are not{FF0000} Administrator {FAF5F5}to use this command");
new id, reason[128];
else if(sscanf(params, "us", id, reason))SendClientMessage(playerid, -1, "{FF0000}[SYSTEM USAGE]:{FAF5F5}/kick [playerid][reason]");
else if (id==INVALID_PLAYER_ID)SendClientMessage(playerid,-1,"{FF0000}[ERROR]:{FAF5F5}Player is not connected!");
else {
new Name[MAX_PLAYER_NAME], KickMessage[128];
new Name2[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
GetPlayerName(id, Name2, sizeof(Name2));
format(KickMessage, sizeof(KickMessage), "{FF0000}[Kick]:{FAF5F5}Adminstrator %s has kicked %s from server | reason : {FF0000}%s", Name, Name2,reason);
SendClientMessageToAll(-1, KickMessage);
new string[128];
format(string, sizeof(string), "You have been kicked from the server by adminstrator %s | REASON: %s", Name, Name2,reason);
ShowPlayerDialog(id,132342,DIALOG_STYLE_MSGBOX,"Kicked!",string,"ok","");
Kick(id);
}
return 1;
}