07.09.2010, 13:20
If you got this from my tutorial then do it like this:
add onto the enum:
then OnPlayerConnect add
then OnPlayerText add
then change your command to:
there you go
add onto the enum:
pawn Код:
enum gPInfo
{
Logged,
Regged,
Level,
Muted
}
pawn Код:
PInfo[playerid][Muted] = 0;
pawn Код:
if(PInfo[playerid][Muted] == 1)
{
SendClientMessage(playerid,LIGHTBLUE,"You are muted!
return 0;
}
pawn Код:
dcmd_mute(playerid,params[])
{
new id, 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),"You have been muted by %s",n);
SendClientMessage(playerid,ORANGE,str);
PInfo[id][Muted] = 1;
return 1;
}
