new Muted[MAX_PLAYERS];
CMD:mute(playerid, params[])
{
if(pInfo[playerid][Admin] >= 1)
{
new id,msg1[128],msg2[128];
if(!sscanf(params, "uS[40]", id))
{
if(playerid == id)
{
if(IsPlayerConnected(id))
{
if(isnull(msg1,msg2))
{
new string[200];
new string2[200];
format(string,sizeof(string)," You have been Muted by Admin ( %s ) Reason: No reason specified.",pInfo[playerid][playername]);
format(string2,sizeof(string2),"You have muted Player ( %s ) Reason: No reason specified.",pInfo[id][playername]);
SendClientMessage(id,COLOR_ADMIN,string);
SendClientMessage(playerid,COLOR_ADMIN,string2);
Muted[id] = 1;
} else {
new string[200];
new string2[200]
format(string,sizeof(string),"AdminCMD: You have been Muted by Admin ( %s ) Reason: %s.",pInfo[playerid][playername],msg1);
format(string2,sizeof(string2),"AdminCMD: You have Muted Player ( %s ) Reason: %s.",pInfo[id][playername],msg2);
SendClientMessage(id,COLOR_ADMIN,string);
SendClientMessage(playerid,COLOR_ADMIN,string2);
Muted[id] = 1;
}
} else SendError(playerid, "This player is not Connected!");
} else SendError(playerid, "You can't mute yourself!");
} else SendError(playerid," Syntax: /Mute <playerid> [reason]");
} else SendError(playerid," You don't have enough priviliges");
return 1;
}
admin.pwn(57) : error 001: expected token: ";", but found "-identifier-" admin.pwn(77) : error 033: array must be indexed (variable "Muted")
CMD:mute(playerid, params[])
{
if(pInfo[playerid][Admin] >= 1)
{
new id,msg1[128],msg2[128];
new string[200],string2[200];
if(!sscanf(params, "uS[40]", id))
{
if(playerid == id)
{
if(IsPlayerConnected(id))
{
if(isnull(msg1,msg2))
{
format(string,sizeof(string)," You have been Muted by Admin ( %s ) Reason: No reason specified.",pInfo[playerid][playername]);
format(string2,sizeof(string2),"You have muted Player ( %s ) Reason: No reason specified.",pInfo[id][playername]);
SendClientMessage(id,COLOR_ADMIN,string);
SendClientMessage(playerid,COLOR_ADMIN,string2);
Muted[id] = 1;
} else {
format(string,sizeof(string),"AdminCMD: You have been Muted by Admin ( %s ) Reason: %s.",pInfo[playerid][playername],msg1);
format(string2,sizeof(string2),"AdminCMD: You have Muted Player ( %s ) Reason: %s.",pInfo[id][playername],msg2);
SendClientMessage(id,COLOR_ADMIN,string);
SendClientMessage(playerid,COLOR_ADMIN,string2);
Muted[id] = 1;
}
} else SendError(playerid, "This player is not Connected!");
} else SendError(playerid, "You can't mute yourself!");
} else SendError(playerid," Syntax: /Mute <playerid> [reason]");
} else SendError(playerid," You don't have enough priviliges");
return 1;
}
new string[200];
new string2[200]
pawn Код:
|
if(pInfo[id][Muted] == 1)
admin.pwn(74) : error 033: array must be indexed (variable "Muted")
if(pInfo[id][Muted] == 1)
if(Muted[id] == 1)
Thanks, But i'm still getting the error
pawn Код:
Код:
admin.pwn(74) : error 033: array must be indexed (variable "Muted") |
new Muted[MAX_PLAYERS];
if(Muted[id])
// OR
if(Muted[id] == 1)