mute command fail. need help
#1

so i tried to create a /mute command that would work like /mute [playerid] [time] but i failed
can anyone help ?
the lines are:


CMD:mute(playerid, params[])
{
new string[128];
new pname[MAX_PLAYER_NAME];
new name[MAX_PLAYER_NAME];
if(sscanf(params, "ui",muteID, mutelaikas)) return SendClientMessage(playerid, 0xFFFFFFFFF, "Teisingas Naudojimas: /mute [ZaidejoVardas/ID] [Laikas] !");
if(!IsPlayerConnected(muteID)) return SendClientMessage(playerid, 0xFFFFFFFFF, "Zaidejas Neegzistuoja !");
SetTimerEx("BMute", mutelaikas[muteID], false, "i", playerid);
GetPlayerName(muteID, name, sizeof(name));
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "Just Uzmutinote Zaideja %s %i Sekundziu !", name, mutelaikas[playerid]);
SendClientMessage(playerid, 0xFFFFFFFFF, string);
format(string, sizeof(string), "Jus Buvote Uzmutintas Administratorio %s %i Sekundziu !", pname, mutelaikas[playerid]);
SendClientMessage(muteID, 0xFFFFFFFFF, string);
Stats[muteID][mute] = 1;
mutelaikas[muteID] = mutelaikas[muteID];
return 1;
}

and

public BMute(playerid)
{
Stats[muteID][mute] = 0;
return 1;
}

i forwarded it but i cant see whats wrong with the code , can anyone help me with this problem ?
Reply
#2

It will help if you use [code] tags. Also, all the timers are in milliseconds, if you are doing something like /mute 0 60 , the player will be unmuted 60 MS after that (which is 1/16.67th of a second)

Another thing..

Код:
mutelaikas[muteID] = mutelaikas[muteID];
That makes no sense, you're setting the variable it's same value. It's like doing 5 = 5.
Reply
#3

how can i make so if i type /mute id 1 would mute the player 1 sec instead of 1milisecond ?
Reply
#4

and also how can i fix the whole script ?
Reply
#5

1000 ms = 1 sec
Reply
#6

When setting a timer, multiply the seconds by 1000.

Also the timer is pretty fucked up. You are using playerid, while you are going to unmute the entered id..
Reply
#7

Quote:
Originally Posted by karolis11234
Посмотреть сообщение
how can i make so if i type /mute id 1 would mute the player 1 sec instead of 1milisecond ?
Standard prefixes for the SI units of measure

Код:
deci-    d   10^-1
centi-   c   10^-2
milli-   m   10^-3
micro-   μ   10^-6
Check how much is 10^-3 in the calculator (or even ******). That's 1/1000 of a second.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)