04.02.2014, 19:19
Firstly, you have such unacceptable condition:
It won't work because all numbers except for 0 will lead to the first 'case' and 0 will lead to the second case. But the first case do not use the timer at all. And in the second case the timer will be triggered after 0 seconds.
Secondly, you don't actually mute the player. You just say that he is muted now. For example, the easiest way is to keep flags iMuted[MAX_PLAYERS] that says if the player is muted, and set it to 1 in mute and set it to 0 in unmute. And then you have to return 0 in the beginning of OnPlayerText and return 1 in the beginning of OnPlayerCommandText if the flag is setted to 1.
pawn Код:
if(seconds != 0)
{
...
}
else if(seconds >= 0)
{
...
}
Secondly, you don't actually mute the player. You just say that he is muted now. For example, the easiest way is to keep flags iMuted[MAX_PLAYERS] that says if the player is muted, and set it to 1 in mute and set it to 0 in unmute. And then you have to return 0 in the beginning of OnPlayerText and return 1 in the beginning of OnPlayerCommandText if the flag is setted to 1.