dcmd_mute(playerid,params[])
{
new id,reason,pName[MAX_PLAYER_NAME],file[128];
if(PInfo[playerid][Level] < 3) return 0;
if(sscanf(params,"us",id,reason)) return SCM(playerid,orange,"USAGE: /mute [id][reason]");
PInfo[id][Muted] = 1;
GetPlayerName(id,pName,sizeof(pName));
format(file,sizeof(file),"MyAdmin/Users/%s.ini",pName);
dini_IntSet(file,"Muted",1);
SendFMessageToAll(red,"MUTED:%s has been muted [reason: %s]",pName,reason);
return 1;
}
dcmd_mute(playerid,params[])
{
new id,reason,pName[MAX_PLAYER_NAME],file[128],string[128];
if(PInfo[playerid][Level] < 3) return 0;
if(sscanf(params,"us",id,reason)) return SCM(playerid,orange,"USAGE: /mute [id][reason]");
else
{
GetPlayerName(id,pName,sizeof(pName));
format(file,sizeof(file),"MyAdmin/Users/%s.ini",pName);
dini_IntSet(file,"Muted",1);
PInfo[id][Muted] = 1;
format(string,sizeof(string),"MUTED:%s has been muted [reason: %s]",pName,reason);
SendFMessageToAll(red, string);
}
return 1;
}
You didn't meet one of the requirements of the IF and you haven't added a statement for the IF and the return below that statement.
|
dcmd(mute,4,cmdtext);
public OnPlayerCommandText(playerid, cmdtext[])
I'm not using dcmd, but I saw a script using it, so I came to think about, did you remember this?:
pawn Код:
pawn Код:
|
dcmd_mute(playerid,params[])
{
new id,reason[128],pName[MAX_PLAYER_NAME],file[128];
if(PInfo[playerid][Level] < 3) return 0;
if(sscanf(params,"is[128]",id,reason)) return SCM(playerid,orange,"USAGE: /mute [id][reason]");
PInfo[id][Muted] = 1;
GetPlayerName(id,pName,sizeof(pName));
format(file,sizeof(file),"MyAdmin/Users/%s.ini",pName);
dini_IntSet(file,"Muted",1);
SendFMessageToAll(red,"MUTED:%s has been muted [reason: %s]",pName,reason);
return 1;
}
public OnPlayerText(playerid,text[])
{
if(PInfo[playerid][Muted]==1) return 0;
//...
return 1;
}