Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: umar4911 on Dec 08, 2017, 06:11 AM

Title: unmute timer stop
Post by: umar4911 on Dec 08, 2017, 06:11 AM
I have mute system in which player mutes are 3 continues spam and a timer which unmutes it after 30 sec. when I use /unmute cmd, the player gets unmuted but when the timer ends, it again says player unmuted. How to make the timer stop.

P.S the name of function is unmute
Title: Re: unmute timer stop
Post by: =RK=MarineForce on Dec 08, 2017, 07:38 AM
Time Finished?

Example Umar4911 has been unmuted Reason Time Expire
Title: Re: unmute timer stop
Post by: umar4911 on Dec 08, 2017, 09:45 AM
Quote from: =RK=MarineForce on Dec 08, 2017, 07:38 AMTime Finished?

Example Umar4911 has been unmuted Reason Time Expire
You did not understand
Suppose I am spamming chat. I am muted for spamming. Admin unmutes me using /unmute. After 30 sec, the Timer which was made for spamming again says Player Unmuted. I want a code that also breakes that timer
Title: Re: unmute timer stop
Post by: ! on Dec 08, 2017, 10:58 AM
You need to see this

http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/Timer.Delete

Method#1
Delete the timer while applying unmute command
For Method#2
Post your function which is used in timer when player's muted.

Title: Re: unmute timer stop
Post by: Mohamed Boubekri on Dec 08, 2017, 12:23 PM
Me To Ihave Mute System But i Dont Have That's Problem But Try Thi:
else if ( cmd == "umute" )
{
if ( pstats[ player.ID ].Level < 5 ) MessagePlayer( "[#FF0000][INFO][#ffffff] You Are Not Authorized To use This Command", player );
else if ( !text ) MessagePlayer("[#ff0000][INFO][#ffffff] /umute <Player>",player);
else {
local plr = FindPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Error - Unknown player.", player);
else if ( pstats[ player.ID ].Level < 5 ) MessagePlayer( "[#FF0000][INFO][#ffffff] You Are Not Authorized To use This Command", player );
else
{
Message( "[#fff123]Administrator[#ffffff] " + player.Name + " Unmuted " + plr.Name + "" );
IsMuted[ plr.ID ] = false;
}
}
return 0;
}
else if ( cmd == "mute" )
{
if ( pstats[ player.ID ].Level < 5 ) MessagePlayer( "[#FF0000][INFO][#ffffff] You Are Not Authorized To use This Command", player );
else if ( !text ) MessagePlayer("[#ff0000][INFO][#ffffff] /mute <Player>",player);
else {
local plr = FindPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Error - Unknown player.", player);
else if( pstats[ player.ID ].Level < pstats[ plr.ID ].Level ) MessagePlayer("[#ff0000][ERROR][#ffffff] You Cannot Give Any Admin Higher Level Than You", player);
else
{
local reason = GetTok( text, " ", 2 );
if ( !reason ) reason = "None";
Message( "[#fff123]Administrator[#ffffff] " + player.Name + " Muted " + plr.Name + " Reason: " + reason + "" );
IsMuted[ plr.ID ] = true;
}
}
return 0;
}
If Dont Work Tell Me i WIll try to Help You :P
Title: Re: unmute timer stop
Post by: ! on Dec 08, 2017, 04:40 PM
Quote from: Mohamed on Dec 08, 2017, 12:23 PMMe To Ihave Mute System But i Dont Have That's Problem But Try Thi:
else if ( cmd == "umute" )
{
if ( pstats[ player.ID ].Level < 5 ) MessagePlayer( "[#FF0000][INFO][#ffffff] You Are Not Authorized To use This Command", player );
else if ( !text ) MessagePlayer("[#ff0000][INFO][#ffffff] /umute <Player>",player);
else {
local plr = FindPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Error - Unknown player.", player);
else if ( pstats[ player.ID ].Level < 5 ) MessagePlayer( "[#FF0000][INFO][#ffffff] You Are Not Authorized To use This Command", player );
else
{
Message( "[#fff123]Administrator[#ffffff] " + player.Name + " Unmuted " + plr.Name + "" );
IsMuted[ plr.ID ] = false;
}
}
return 0;
}
else if ( cmd == "mute" )
{
if ( pstats[ player.ID ].Level < 5 ) MessagePlayer( "[#FF0000][INFO][#ffffff] You Are Not Authorized To use This Command", player );
else if ( !text ) MessagePlayer("[#ff0000][INFO][#ffffff] /mute <Player>",player);
else {
local plr = FindPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Error - Unknown player.", player);
else if( pstats[ player.ID ].Level < pstats[ plr.ID ].Level ) MessagePlayer("[#ff0000][ERROR][#ffffff] You Cannot Give Any Admin Higher Level Than You", player);
else
{
local reason = GetTok( text, " ", 2 );
if ( !reason ) reason = "None";
Message( "[#fff123]Administrator[#ffffff] " + player.Name + " Muted " + plr.Name + " Reason: " + reason + "" );
IsMuted[ plr.ID ] = true;
}
}
return 0;
}
If Dont Work Tell Me i WIll try to Help You :P
Thanks for showing your interest towards this topic you saved someone's day.Everyone raise your hands and clap for this man.

Quote from: Mohamed on Dec 08, 2017, 12:23 PMIf Dont Work Tell Me i WIll try to Help You :P
Caption it
Title: Re: unmute timer stop
Post by: umar4911 on Dec 09, 2017, 07:01 AM
Quote from: ! on Dec 08, 2017, 10:58 AMYou need to see this

http://wiki.vc-mp.org/wiki/Scripting/Squirrel/Functions/Timer.Delete

Method#1
Delete the timer while applying unmute command
For Method#2
Post your function which is used in timer when player's muted.


Fixed by editing function
Solved.
Title: Re: unmute timer stop
Post by: ! on Dec 09, 2017, 05:30 PM
if ( Stats[ player.ID ].Mute == false ) return;
:D
Title: Re: unmute timer stop
Post by: umar4911 on Dec 10, 2017, 09:50 AM
Quote from: ! on Dec 09, 2017, 05:30 PMif ( Stats[ player.ID ].Mute == false ) return;
:D
I did this in my function xD
Title: Re: unmute timer stop
Post by: =RK=MarineForce on Dec 10, 2017, 11:24 AM
i think its not working for me

else if ( cmd == "umute" )
{
if ( pstats[ player.ID ].Level < 5 ) MessagePlayer( "[#FF0000][INFO][#ffffff] You Are Not Authorized To use This Command", player );
else if ( !text ) MessagePlayer("[#ff0000][INFO][#ffffff] /umute <Player>",player);
else {
local plr = FindPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Error - Unknown player.", player);
else if ( pstats[ player.ID ].Level < 5 ) MessagePlayer( "[#FF0000][INFO][#ffffff] You Are Not Authorized To use This Command", player );
else
{
Message( "[#fff123]Administrator[#ffffff] " + player.Name + " Unmuted " + plr.Name + "" );
IsMuted[ plr.ID ] = false;
}
}
return 0;
}
else if ( cmd == "mute" )
{
if ( pstats[ player.ID ].Level < 5 ) MessagePlayer( "[#FF0000][INFO][#ffffff] You Are Not Authorized To use This Command", player );
else if ( !text ) MessagePlayer("[#ff0000][INFO][#ffffff] /mute <Player>",player);
else {
local plr = FindPlayer( GetTok( text, " ", 1 ) );
if ( !plr ) MessagePlayer( "Error - Unknown player.", player);
else if( pstats[ player.ID ].Level < pstats[ plr.ID ].Level ) MessagePlayer("[#ff0000][ERROR][#ffffff] You Cannot Give Any Admin Higher Level Than You", player);
else
{
local reason = GetTok( text, " ", 2 );
if ( !reason ) reason = "None";
Message( "[#fff123]Administrator[#ffffff] " + player.Name + " Muted " + plr.Name + " Reason: " + reason + "" );
IsMuted[ plr.ID ] = true;
}
}
return 0;
}
Title: Re: unmute timer stop
Post by: Mohamed Boubekri on Dec 10, 2017, 11:26 AM
@=RK=MarineForce If You Want it To Work
You Need To Download That's System
http://forum.vc-mp.org/?topic=1717.0Then The /mute And /umute Will Work.
Title: Re: unmute timer stop
Post by: =RK=MarineForce on Dec 10, 2017, 11:33 AM
ITS Nice Working .

Thankx ask kakan

solved