CMD:ban(playerid, params[])
{
new targetid, reason[64], string[128], string3[128], string2[MAX_PLAYER_NAME];
if(pInfo[playerid][pAdmin] == 0) return SCM(playerid, COLOR_RED, "You are not admin or you're not authorized.");
if(sscanf(params, "us[64]", targetid, reason)) return SCM(playerid, -1, "{32CD32}Use:{FFFFFF} /ban (playerid) (reason).");
if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_RED, "Player is not connected.");
format(string3, sizeof(string3), "{FF8C00}Admin {DC143C}%s (%d) {FF8C00}has banned {DC143C}%s (%d) {FF8C00}(reason: {DC143C}%s{FF8C00}).", GetName(playerid), playerid, GetName(params[0]), targetid, reason);
SCMToAll(-1, string3);
BanEx(targetid);
return 1;
}
CMD:kick(playerid, params[])
{
new targetid, reason[64], string[128];
if(pInfo[playerid][pAdmin] == 0) return SCM(playerid, COLOR_RED, "You are not admin or you're not authorized.");
if(sscanf(params, "us[64]", targetid, reason)) return SCM(playerid, -1, "{32CD32}Use:{FFFFFF} /kick (playerid) (reason).");
if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_RED, "Player is not connected.");
format(string, sizeof(string), "{FF8C00}Admin {DC143C}%s (%d) {FF8C00}has kicked {DC143C}%s (%d) {FF8C00}(reason: {DC143C}%s{FF8C00}).", GetName(playerid), playerid, GetName(targetid), targetid, reason);
SCMToAll(-1, string);
KickEx(targetid);
return 1;
}
CMD:ban(playerid, params[])
{
new targetid, reason[64], string[128], string3[128], string2[MAX_PLAYER_NAME];
if(pInfo[playerid][pAdmin] == 0) return SCM(playerid, COLOR_RED, "You are not admin or you're not authorized.");
if(sscanf(params, "us[64]", targetid, reason)) return SCM(playerid, -1, "{32CD32}Use:{FFFFFF} /ban (playerid) (reason).");
if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_RED, "Player is not connected.");
format(string3, sizeof(string3), "{FF8C00}Admin {DC143C}%s (%d) {FF8C00}has banned {DC143C}%s (%d) {FF8C00}(reason: {DC143C}%s{FF8C00}).", GetPlayerName(playerid), playerid, GetPlayerName(targetid), targetid, reason);
SCMToAll(-1, string3);
BanEx(targetid);
return 1;
}
CMD:kick(playerid, params[])
{
new targetid, reason[64], string[128];
if(pInfo[playerid][pAdmin] == 0) return SCM(playerid, COLOR_RED, "You are not admin or you're not authorized.");
if(sscanf(params, "us[64]", targetid, reason)) return SCM(playerid, -1, "{32CD32}Use:{FFFFFF} /kick (playerid) (reason).");
if(!IsPlayerConnected(targetid)) return SCM(playerid, COLOR_RED, "Player is not connected.");
format(string, sizeof(string), "{FF8C00}Admin {DC143C}%s (%d) {FF8C00}has kicked {DC143C}%s (%d) {FF8C00}(reason: {DC143C}%s{FF8C00}).", GetPlayerName(playerid), playerid, GetPlayerName(targetid), targetid, reason);
SCMToAll(-1, string);
KickEx(targetid);
return 1;
}
forward KickPublic(playerid);
public KickPublic(playerid) { Kick(playerid); }
stock KickWithMessage(playerid, message[])
{
SendClientMessage(playerid, 0xFF4444FF, message);
SetTimerEx("KickPublic", 1000, 0, "d", playerid); //Delay of 1 second before kicking the player so he recieves the message
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/kickme", true) == 0)
{
//Kicks the player who the executed this command
KickWithMessage(playerid, "You have been kicked.");
return 1;
}
return 0;
}
@jwalker: Lo que tъ dices es que el jugador kickeado no ve el mensaje, pero ese no era el problema, igual gracias.
@Dreyfuz: Solucionado, gracias. |