Help Little help
#1

Here is muted commands to apply the command you want

playerid + reason

Код:
dcmd_mute(playerid,params[])
{
	new
	    Reason[256],
	    pID;
    if(Player[playerid][admin] < 1){
	 	return SendClientMessage(playerid, COLOR_RED, "Bad Command! Type /command for right commands");
 		}
	if(sscanf(params,"us",pID,Reason)){
		return SendClientMessage(playerid,COLOR_GREY,"Usage: /mute [playerid] [reason] ");
		}
	if(!IsPlayerConnected(pID)) {
	    return SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID");
	    }
 	if(playerid == pID){
		return SendClientMessage(playerid,COLOR_RED,"You Can Not Mute Yourself");
		}
	if(Player[playerid][admin] < Player[pID][admin]){
		return SendClientMessage(playerid,COLOR_RED,"You Can Not Mute A High Ranked Admin");
		}
	if(Muted[pID] == 1)
	    return SendClientMessage(playerid,COLOR_RED,"This player is already muted");

	new
 	name[24],aname[24],
 	string1[128], string2[128], string3[128], string4[128];
	GetPlayerName(pID,name,sizeof(name));
	GetPlayerName(playerid,aname,sizeof(aname));
	format(string1,sizeof(string1),"**(ADMIN MUTE)** %s(%d) %s",name,pID,Reason);
	format(string2,sizeof(string4),"%s %s(%d) Has Mute %s(%d) For Reason: %s",gAdminRanks[Player[playerid][admin]],aname,playerid,name,pID,Reason);
	format(string3,sizeof(string2),"You Have Been Muted By %s For Reason: %s",gAdminRanks[Player[playerid][admin]],Reason);
	format(string4, sizeof(string3), "You Have Mute %s(%d) For Reason: %s",name, pID, Reason);
	SendClientMessageToAll(COLOR_GOLD,string1);
	SendClientMessage(pID,0xFF7F50AA,string2);
	SendClientMessage(playerid,COLOR_GREEN,string3);
	SendAdminMessage(COLOR_YELLOW,string4);
	SaveToFile("Mutes",string4); Muted[pID] = 1;
  	return 1;
}

Now what i want is how i can make this apply when someone enter an playerid only and forget reason for mute to Send him ClientMessage Say "You forget to put reason"
Reply
#2

pawn Код:
dcmd_mute(playerid,params[])
{
    new pID,[128],
    if(Player[playerid][admin] < 1) return SendClientMessage(playerid, COLOR_RED, "Bad Command! Type /command for right commands");
    if(sscanf(params,"uS(default_reason)[128]",pID,Reason)) SendClientMessage(playerid,COLOR_GREY,"Usage: /mute [playerid] [reason] ");
    else if(!IsPlayerConnected(pID)) SendClientMessage(playerid,COLOR_RED,"Nobody is connected with this ID");
    else if(!strcmp(Reason,"default_reason")) SendClientMessage(playerid,COLOR_RED,"You forget to put reason");
    else if(playerid == pID) SendClientMessage(playerid,COLOR_RED,"You Can Not Mute Yourself");
    else if(Muted[pID] == 1) SendClientMessage(playerid,COLOR_RED,"This player is already muted");
    else if(Player[playerid][admin] < Player[pID][admin]) SendClientMessage(playerid,COLOR_RED,"You Can Not Mute A High Ranked Admin");
    else{
        new name[24],aname[24],string[128];
        GetPlayerName(pID,name,sizeof(name));
        GetPlayerName(playerid,aname,sizeof(aname));
        format(string,sizeof(string),"**(ADMIN MUTE)** %s(%d) %s",name,pID,Reason);
        SendClientMessageToAll(COLOR_GOLD,string);
        format(string,sizeof(string),"%s %s(%d) Has Mute %s(%d) For Reason: %s",gAdminRanks[Player[playerid][admin]],aname,playerid,name,pID,Reason);
        SendAdminMessage(COLOR_YELLOW,string);
        SaveToFile("Mutes",string);
        format(string,sizeof(string),"You Have Been Muted By %s For Reason: %s",gAdminRanks[Player[playerid][admin]],Reason);
        SendClientMessage(pID,0xFF7F50AA,string);
        format(string, sizeof(string), "You Have Mute %s(%d) For Reason: %s",name, pID, Reason);
        SendClientMessage(playerid,COLOR_GREEN,string);
        Muted[pID] = 1;
    }
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)