if(strcmp(cmd, "/fakeban", true) == 0) // Kicks the player from the server { new reason[128]; if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, ORANGE, "USAGE: /fakeban [playername/id] [reason]"); SendClientMessage(playerid, ORANGE, "FUNCTION: Will kick the specified player."); return 1; } if(giveplayerid != INVALID_PLAYER_ID) { GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername)); GetPlayerName(playerid, sendername, sizeof(sendername)); reason = bigstrtok(cmdtext, idx); if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /fakeban [playername/id] [reason]"); printf("ADMIN: Admin %s kicked %s. Reason: %s", sendername, giveplayername, reason); format(string, sizeof(string), "-| Administrator %s banned %s. [Reason: %s ] |-", sendername, giveplayername, reason); SendClientMessageToAll(ADMIN_RED, string); Kick(giveplayerid); KickLog(string); } else if(giveplayerid == INVALID_PLAYER_ID) { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, RED, string); } } else SendClientMessage(playerid, RED, "You are not an admin with the required level."); return 1; }
if(strcmp(cmd, "/fakeban", true) == 0) // Kicks the player from the server { new reason[128]; if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid)) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, ORANGE, "USAGE: /fakeban [playerid] [reason]"); SendClientMessage(playerid, ORANGE, "FUNCTION: Will kick the specified player."); return 1; } giveplayerid = strval(tmp); reason = bigstrtok(cmdtext, idx); if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /fakeban [playerid] [reason]"); if(IsPlayerConnected(giveplayerid)) { GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername)); GetPlayerName(playerid, sendername, sizeof(sendername)); printf("ADMIN: Admin %s kicked %s. Reason: %s", sendername, giveplayername, reason); format(string, sizeof(string), "-| Administrator %s banned %s. [Reason: %s ] |-", sendername, giveplayername, reason); SendClientMessageToAll(ADMIN_RED, string); Kick(giveplayerid); KickLog(string); } else { format(string, sizeof(string), "%d is not an active player.", giveplayerid); SendClientMessage(playerid, RED, string); } } else SendClientMessage(playerid, RED, "You are not an admin with the required level."); return 1; }
new cmd[128],idx,tmp[128]; cmd = strtok(cmdtext,idx);
Originally Posted by Jefff
Do U have on top commandtext
Код:
new cmd[128],idx,tmp[128]; cmd = strtok(cmdtext,idx); |
dcmd_fakeban(playerid,params[])
{
if(!AccountInfo[playerid][AdminLevel]) return SendClientMessage(playerid,color,"You are not an admin.");
new
id,
reason[64],
pName[MAX_PLAYER_NAME],
pName2[MAX_PLAYER_NAME];
if(sscanf(params,"us",id,reason)) return SendClientMessage(playerid,color,"Usage: /fakeban [playerid/name] [reason]");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,color,"That player ain't connected.");
GetPlayerName(playerid,pName,sizeof(pName));
GetPlayerName(id,pName2,sizeof(pName2));
printf("ADMIN: Admin %s kicked %s. Reason: %s",pName,pName2,reason);
format(string,sizeof(string),"-| Administrator %s banned %s. [Reason: %s ] |-",pName,pName2,reason);
SendClientMessageToAll(ADMIN_RED, string);
Kick(id);
KickLog(string);
return 1;
}
Originally Posted by MenaceX^
Quote:
pawn Код:
|
Originally Posted by Mowgli
just copy /ban but take out the ban(playerid) and the printf stuff
|