19.01.2012, 08:17
Hello friends,my request code player use command and command not mode should "%s not command" thank you.
public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp("/ban", cmdtext, true))
{
if(IsPlayerAdmin(playerid))
{
new id;
if(sscanf(cmdtext, "r", id)) return SendClientMessage(playerid, 0xCC0000AA, "USAGE: /ban <playerid/partofname>");
if(IsPlayerAdmin(id)) return SendClientMessage(playerid, 0xCC0000AA, "You can't ban admins!");
new str[128], name[MAX_PLAYER_NAME], bname[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, bname, sizeof(bname));
format(str,sizeof(str), "%s[%d] has banned %s[%d]", name, playerid, bname, id);
SendClientMessageToAll(0xCC0000AA, str);
BanEx(id, str);
}
return 1;
}
return SendClientMessage(playerid, 0xCC0000AA, "Invalid Command."); //this should work
}
new str[128];
format(str,sizeof(str), "%s is not a valid command!", cmdtext);
return SendClientMessage(playerid, 0xCC0000AA, str);