Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: VC[88]PD on December 28, 2012, 04:09:23 pm

Title: count command by me(not that count down in gups)
Post by: VC[88]PD on December 28, 2012, 04:09:23 pm
[pawn]else if ( strcmp( cmd, "!count", true ) == 0 )
   {
       SetTimer( "CountDowns3", 1000, 0 );
        SetTimer( "CountDowns2", 2000, 0 );
       SetTimer( "CountDowns1", 3000, 0 );
       SetTimer( "FinalCount", 4000, 0 );
      return 1;
   }[/pawn]
and the public:

[pawn]public CountDowns3()
{
   new szMsg[ 16 ];
   format( szMsg, 16, "== 3 ==");
   SendClientMessageToAll( COLOR_GREEN, szMsg );
}
public CountDowns2()
{
   new szMsg[ 16 ];
   format( szMsg, 16, "== 2 ==");
   SendClientMessageToAll( COLOR_GREEN, szMsg );
}
public CountDowns1()
{
   new szMsg[ 16 ];
   format( szMsg, 16, "== 1 ==");
   SendClientMessageToAll( COLOR_GREEN, szMsg );
}

public FinalCount()
{
   SendClientMessageToAll(COLOR_GREEN, "== GO! ==" );
   GameTextForAll("gogogo!!");
}[/pawn]
Here is it ,thanks.
Title: Re: count command by me(not that count down in gups)
Post by: aledark24 on December 28, 2012, 04:18:57 pm
  :o :o
Title: Re: count command by me(not that count down in gups)
Post by: Fuzzy168 on December 29, 2012, 08:11:10 am
Great job but it has been done.. Nothing special about it.
Title: Re: count command by me(not that count down in gups)
Post by: NeskWriter on December 29, 2012, 10:25:37 am
GOD
DAMN
WHAT
IS
IT???    :o :o :o
Title: Re: count command by me(not that count down in gups)
Post by: stormeus on December 29, 2012, 12:56:23 pm
I can't understand why you use format() here:
[pawn]
public CountDowns3()
{
   new szMsg[ 16 ];
   format( szMsg, 16, "== 3 ==");
   SendClientMessageToAll( COLOR_GREEN, szMsg );
}
public CountDowns2()
{
   new szMsg[ 16 ];
   format( szMsg, 16, "== 2 ==");
   SendClientMessageToAll( COLOR_GREEN, szMsg );
}
public CountDowns1()
{
   new szMsg[ 16 ];
   format( szMsg, 16, "== 1 ==");
   SendClientMessageToAll( COLOR_GREEN, szMsg );
}
[/pawn]

But not here:
[pawn]
public FinalCount()
{
   SendClientMessageToAll(COLOR_GREEN, "== GO! ==" );
   GameTextForAll("gogogo!!");
}
[/pawn]
Title: Re: count command by me(not that count down in gups)
Post by: heekz.shadow on December 29, 2012, 01:47:31 pm
on top:
[pawn]new repeat = 0;[/pawn]

command:
[pawn]SetTimer( "CountDown", 1000, 3 );[/pawn]

public:
[pawn]public CountDown()
{
       switch(repeat)
        {
                case 0:
                    SendClientMessageToAll( COLOR_GREEN, "=== 3 ===" );
                        repeat = 1;
                        break;
                case 1:
                         SendClientMessageToAll( COLOR_GREEN, "=== 2 ===" );
                        repeat = 2;
                        break;
                case 2:
                         SendClientMessageToAll( COLOR_GREEN, "=== 1 ===" );
                         repeat = 3;
                         break;
               case 3:
                        SendClientMessageToAll( COLOR_GREEN, "GO! GO! GO!" );
                   GameTextForAll("gogogo!!");
                        repeat = 0;
                       break;
           }
}
                         [/pawn]

Should work better with a single timer, not tested but it should work, long time no see, pawn.
Title: Re: count command by me(not that count down in gups)
Post by: sseebbyy on December 29, 2012, 02:07:55 pm
Great job but it has been done.. Nothing special about it.

Hmm... can you give me a link to *that* count down system released on this forum ?

I like the idea of encouraging all scripters. (who deserve ofc)




So, good job ! But next time, try to use a single timer. (As heekz showed you)

And how Stormeus says ... Why you use format() on all publics but on the last not ? (you should to the same to all publics, not just for the last)

format() is used when you want to get a float (%f), integer (%i), name (%s) or digital (%d), so is useless here.

I will give you an example:

Code: [Select]
else if(strcmp(cmd, "myname", true) == 0) {
new string[256];
format(string,sizeof(string),"This is your name: %s",gPlayers[playerid]);
SendClientMessage(playerid,COLOR_YELLOW,string);
return 1;
}

This command will give you a message with your name.

I hope you will understand, Good Luck !

PS: Next time when you release a script, put it in the corect board. (Pawn ShowRoom (http://forum.vicecitymultiplayer.com/index.php?board=29.0))
Title: Re: count command by me(not that count down in gups)
Post by: VC[88]PD on January 03, 2013, 06:05:44 pm
I don't know how to reply someone but thanks a lot sseebbyy !
Title: Re: count command by me(not that count down in gups)
Post by: sseebbyy on January 03, 2013, 09:26:49 pm
I don't know how to reply someone but thanks a lot sseebbyy !

My pleasure.  ;)

All replies have in top-right an button called *Quote* . Click on it and you will reply to that post.
Title: Re: count command by me(not that count down in gups)
Post by: VC[88]PD on January 04, 2013, 11:08:53 am
I don't know how to reply someone but thanks a lot sseebbyy !

My pleasure.  ;)

All replies have in top-right an button called *Quote* . Click on it and you will reply to that post.
;)Ok,thanks again.