The onest thing I think it could be is that underscore (_) in some programm languages like php, there are sometimes problems with this underscore in a var. I am not a expert in pawn, I just think that is the problem.
Greatz Kayle |
Timer? You don`t need any timer for a mute command ... Only if you want to keep the player muted after he relogs aswell...
Can we see your timer and the command ? |
D:\Games\Gta San Anreas Online\GodFucker\gamemodes\MyGameMode.pwn(1141) : error 076: syntax error in the expression, or invalid function call
if(strcmp(cmd, "/unmute", true) == 0) { new tmp[256]; tmp = strtok(cmdtext,idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOUR_ORANGE, "Usage: /unmute [playerid]"); return 1; } new id; id = strval(tmp); new playername[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername, sizeof(playername)); new playername2[MAX_PLAYER_NAME]; GetPlayerName(id, playername2, sizeof(playername2)); new string[128]; format(string, sizeof(string), "The admin %s unmuted you.", playername); SendClientMessage(playerid, COLOUR_YELLOW, string); KillTimer(Mute_Timer); format(string, sizeof(string), "You unmuted %s.", playername2); SendClientMessage(playerid, COLOUR_YELLOW, string); return 1; }
KillTimer(Mute_Timer);
new bool:ismuted[MAX_PLAYERS];
COMMAND:mute(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(IsPlayerAdmin(playerid))
{
if(!sscanf(params, "u", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "Adminstrator %s has muted you.", name);
SendClientMessage(id, 0xffff00aa, string);
format(string, sizeof(string), "Player %s has been muted.", PlayerName);
SendClientMessage(playerid, 0xffff00aa, string);
ismuted[id] = true;
return 1;
}
else return SendClientMessage(playerid, 0xffff00aa, "Usage:- /Mute (PlayerID/PartOfName).");
}
else return SendClientMessage(playerid, 0x0259EAAA, "You are not an Adminstrator.");
}
else return SendClientMessage(playerid, 0x0259EAAA, "Player is not connected or The ID is incorrect..");
}
COMMAND:unmute(playerid, params[])
{
new id;
if(IsPlayerConnected(id))
{
if(IsPlayerAdmin(playerid))
{
if(!sscanf(params, "u", id))
{
new string[64];
new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
GetPlayerName(id, PlayerName, sizeof(PlayerName));
format(string, sizeof(string), "Adminstrator %s has unmuted you.", name);
SendClientMessage(id, 0xffff00aa, string);
format(string, sizeof(string), "Player %s has been unmuted.", PlayerName);
SendClientMessage(playerid, 0xffff00aa, string);
ismuted[id] = false;
return 1;
}
else return SendClientMessage(playerid, 0xffff00aa, "Usage:- /Unmute (PlayerID/PartOfName).");
}
else return SendClientMessage(playerid, 0xffff00aa, "You are not an Adminstrator.");
}
else return SendClientMessage(playerid, 0x0259EAAA, "Player is not connected or The ID is incorrect.");
}
public OnPlayerText(playerid, text[])
{
if(ismuted[playerid])
{
SendClientMessage(playerid, 0xff0000FF, "You're muted, If you think you were muted wrongly please pm an admin.");
return 0;
}
return 1;
}