Is that timer for the player only?
#1

Resolved.
Reply
#2

I forgot this is the timer Stuffs :
pawn Код:
forward Silencer();
public Silencer()
{
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(!IsPlayerConnected(i)) continue;
        SecondesMute[i] ++;
        if(SecondesMute[i] == 600)
        {
            SendClientMessage(i,COLOR_WHITE,"10min of mute is done , you can speak.");
            Mute[i]=0;
            SecondesMute[i]=0;
            KillTimer(TuerSilencer);
        }

    }
    return 1;
}
Reply
#3

pawn Код:
if(!params[0]||!(pos=chrfind(' ',params))||!params[pos])
Look up sscanf. That will make that line much tidier.

Quote:

I want it only for the ID i wrote.

Use SetTimerEx, and make the TuerSilencer variable an array for each player (new TuerSilencer[ MAX_PLAYERS ]:
pawn Код:
TuerSilencer[ playerid ] = SetTimerEx( "Silencer", "1000", true, "i", playerid);
Then change the timer function from
pawn Код:
forward Silencer();
public Silencer()
To:
pawn Код:
forward Silencer(playerid);
public Silencer(playerid)
Then remember to remove the loop and use playerid instead of 'i' in your timer function.
Reply
#4

So , the first code I gave , the timer will start for everyone ?

well I did what you said and get that:
Код:
C:\Documents and Settings\PC\Bureau\DATABASE DE ALAE\SND\Votre Destin Role Play\gamemodes\VDRP.pwn(424) : warning 217: loose indentation
C:\Documents and Settings\PC\Bureau\DATABASE DE ALAE\SND\Votre Destin Role Play\gamemodes\VDRP.pwn(557) : warning 217: loose indentation
C:\Documents and Settings\PC\Bureau\DATABASE DE ALAE\SND\Votre Destin Role Play\gamemodes\VDRP.pwn(753) : warning 217: loose indentation
C:\Documents and Settings\PC\Bureau\DATABASE DE ALAE\SND\Votre Destin Role Play\gamemodes\VDRP.pwn(875) : warning 217: loose indentation
C:\Documents and Settings\PC\Bureau\DATABASE DE ALAE\SND\Votre Destin Role Play\gamemodes\VDRP.pwn(1248) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
lines:
1248: TuerSilencer[ playerid ] = SetTimerEx( "Silencer", "1000", "true", "i", playerid);
Reply
#5

The SetTimerEx will only start for the player.
For the error replace the
pawn Код:
new TuerSilencer;
With
pawn Код:
new TuerSilencer[MAX_PLAYERS];
Reply
#6

I have done that , I edited the code look again I have only one error in the line 1248
Reply
#7

Replace this
pawn Код:
TuerSilencer[ playerid ] = SetTimerEx( "Silencer", "1000", "true", "i", playerid);
With this
pawn Код:
TuerSilencer[ playerid ] = SetTimerEx( "Silencer", 1000, true, "i", playerid);
Reply
#8

Quote:
Originally Posted by DaRk_RaiN
Посмотреть сообщение
Replace this
pawn Код:
TuerSilencer[ playerid ] = SetTimerEx( "Silencer", "1000", "true", "i", playerid);
With this
pawn Код:
TuerSilencer[ playerid ] = SetTimerEx( Silencer, "1000", true, "i", playerid);
Ah yes, my bad.
Reply
#9

Thank you for trying, but I get this error :
Код:
C:\Documents and Settings\PC\Bureau\DATABASE DE ALAE\SND\Votre Destin Role Play\gamemodes\VDRP.pwn(1248) : error 076: syntax error in the expression, or invalid function call
Reply
#10

Silly me, i fixed it check it out.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)