26.07.2009, 13:21
I have a problem.
This: works correctly.
This not, why?
There is no any errors / warnings. Unmute unmutes me, not ID I want.
This: works correctly.
pawn Код:
if(strcmp(cmdtext, "/mute", true, 5)==0)
{
if(!strlen(cmdtext[6]))
{
SendClientMessage(playerid, COLOR_ORED, "Usage: /mute [playerid]");
return 1;
}
new ID = strval(cmdtext[6]);
new pName[24], str[64];
if(IsPlayerConnected(ID))
{
GetPlayerName(ID, pName, 24);
format(str, 64, "%s has been muted!", pName);
SendClientMessageToAll(COLOR_ORED, str);
format(str, 64, "You have been muted!");
SendClientMessage(ID, COLOR_ORANGE, str);
Muted[ID] = 1;
}
return 1;
}
pawn Код:
if(strcmp(cmdtext, "/unmute", true, 5)==0)
{
if(!strlen(cmdtext[6]))
{
SendClientMessage(playerid, COLOR_ORED, "Usage: /unmute [playerid]");
return 1;
}
new ID = strval(cmdtext[6]);
new pName[24], str[64];
if(IsPlayerConnected(ID))
{
GetPlayerName(ID, pName, 24);
format(str, 64, "%s has been unmuted!", pName);
SendClientMessageToAll(COLOR_ORED, str);
format(str, 64, "You have been unmuted!");
SendClientMessage(ID, COLOR_ORANGE, str);
Muted[ID] = 0;
}
return 1;
}