23.03.2014, 12:58
i tried making a /mute command like this:
CMD:mute(playerid, params[])
{
new string[128];
new pname[MAX_PLAYER_NAME];
new name[MAX_PLAYER_NAME];
if(sscanf(params, "ui",muteID, mutlaikas)) return SendClientMessage(playerid, PILKA, "Teisingas Naudojimas: /mute [ZaidejoVardas/ID] [Laikas] !");
if(!IsPlayerConnected(muteID)) return SendClientMessage(playerid, PILKA, "Zaidejas Neegzistuoja !");
if(Stats[muteID][mute] == 1) return SendClientMessage(playerid,PILKA, "Asmuo Jau Yra Uztildytas");
mutetimer[muteID] = SetTimerEx("BMute", mutlaikas[muteID]*1000, false, "i", muteID);
GetPlayerName(muteID, name, sizeof(name));
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "Just Uztildete Zaideja %s %i Sekundziu !", name, mutlaikas[playerid]);
SendClientMessage(playerid, PILKA, string);
format(string, sizeof(string), "Jus Buvote Uztilditas Administratorio %s %i Sekundziu !", pname, mutlaikas[playerid]);
SendClientMessage(muteID, PILKA, string);
Stats[muteID][mute] = 1;
return 1;
}
and i made this
public OnPlayerText(playerid, text[])
{
if(Stats[playerid][mute] == 1)
{
new string[200];
format(string, sizeof(string), "Jums Liko Dar %i Sekundziu Uztildimo!", mutetimer[playerid]);
SendClientMessage(playerid, 0xFFFFFFFFF, string);
return 0;
}
return 1;
}
it all compiles great but when i mute someone and that someone types something it shows that it was muted 2 seconds instead of the value of the mute time left.
can someone help?
CMD:mute(playerid, params[])
{
new string[128];
new pname[MAX_PLAYER_NAME];
new name[MAX_PLAYER_NAME];
if(sscanf(params, "ui",muteID, mutlaikas)) return SendClientMessage(playerid, PILKA, "Teisingas Naudojimas: /mute [ZaidejoVardas/ID] [Laikas] !");
if(!IsPlayerConnected(muteID)) return SendClientMessage(playerid, PILKA, "Zaidejas Neegzistuoja !");
if(Stats[muteID][mute] == 1) return SendClientMessage(playerid,PILKA, "Asmuo Jau Yra Uztildytas");
mutetimer[muteID] = SetTimerEx("BMute", mutlaikas[muteID]*1000, false, "i", muteID);
GetPlayerName(muteID, name, sizeof(name));
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "Just Uztildete Zaideja %s %i Sekundziu !", name, mutlaikas[playerid]);
SendClientMessage(playerid, PILKA, string);
format(string, sizeof(string), "Jus Buvote Uztilditas Administratorio %s %i Sekundziu !", pname, mutlaikas[playerid]);
SendClientMessage(muteID, PILKA, string);
Stats[muteID][mute] = 1;
return 1;
}
and i made this
public OnPlayerText(playerid, text[])
{
if(Stats[playerid][mute] == 1)
{
new string[200];
format(string, sizeof(string), "Jums Liko Dar %i Sekundziu Uztildimo!", mutetimer[playerid]);
SendClientMessage(playerid, 0xFFFFFFFFF, string);
return 0;
}
return 1;
}
it all compiles great but when i mute someone and that someone types something it shows that it was muted 2 seconds instead of the value of the mute time left.
can someone help?