07.09.2010, 12:22
I have a problem with my Mute Command.
Command:
OnPlayerText:
No Idea what i did wrong.
Command:
pawn Код:
dcmd_mute(playerid,params[])
{
new id,file[256],n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
new tmp[256], Index, str[49];
tmp = strtok(params,Index), id = strval(tmp);
GetPlayerName(id,on,sizeof(on));
GetPlayerName(playerid,n,sizeof(n));
if(PInfo[playerid][Level] < 3) return SendClientMessage(playerid,ORANGE,"You need to be level 3 to use this command!");
if(!strlen(params)) return SendClientMessage(playerid,GREY,"USAGE: /mute <ID> ");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid,GREY,"Invalid ID");
format(str,sizeof(str),"%s has Muted %s",n,on);
SendClientMessageToAll(LIGHTBLUE,str);
dini_IntSet(file,"Mute",1);
return 1;
}
pawn Код:
public OnPlayerText(playerid, text[])
{
if(PInfo[playerid][Mute] == 1) return SendClientMessage(playerid,YELLOW,"(INFO) You have been Muted and Can't talk, Contact an Admin!");
return 1;
}