Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Topic started by: [Akatsuki]Itachi on July 07, 2013, 04:09:26 am

Title: set timer help
Post by: [Akatsuki]Itachi on July 07, 2013, 04:09:26 am
These few day, i want to set timer like when you type !heal, need to wait 5 sec, but when i put timer and type 5000 so it must be 5 sec, but it just past away in 1 sec, how to set it so it will be 5 sec ?
Title: Re: set timer help
Post by: Doom on July 07, 2013, 03:14:23 pm
http://forum.vicecitymultiplayer.com/index.php?topic=5517.0

Seriously....
Title: Re: set timer help
Post by: dynavolt71 on July 07, 2013, 03:45:18 pm
MAKE your own if some error tell us !!!
Title: Re: set timer help
Post by: aledark24 on July 07, 2013, 03:52:31 pm
http://forum.vicecitymultiplayer.com/index.php?topic=5517.0

Seriously....


seriously doom??? is very easy repair the mistake and work the command... "but" is more players use the command whit a different of second... not work well.  now i turn on my computer for show the solution
Title: Re: set timer help
Post by: dynavolt71 on July 07, 2013, 03:59:46 pm
I dont know what you mean alejandro
Title: Re: set timer help
Post by: aledark24 on July 07, 2013, 04:29:39 pm
[pawn]new Heal[MAX_PLAYERS];[/pawn]


[pawn]              else if ( strcmp( cmd, "!heal", true ) == 0 )
   {
            tmp = strtok( cmdtext, idx );
            SendClientMessage(playerid,0x333AFFF,"Healing in 5 seconds for prevent death-evade.");
            SetTimer( "Healing", 5000,false);
         Heal[playerid] = 1;
      return 1;
   }[/pawn]


[pawn]//==============================================================================
public Healing() {
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
       if(Heal == 1) {
GameTextForPlayer(i,"Healed");
SetPlayerHealth(i,100);
Heal = 0;
      }
  }
      }
}
//==============================================================================[/pawn]
Title: Re: set timer help
Post by: Doom on July 07, 2013, 07:09:00 pm
oh boy you're a Genius man...


how about if player 1 type heal and only 3 seconds passed, another player type !heal then the i loop will check all players with Heal == 1 so the player 2 just had to wait 2 secs for heal Bravo!
Title: Re: set timer help
Post by: NeskWriter on July 07, 2013, 08:48:51 pm
oh boy you're a Genius man...

I wuz the first to discover passing functions for specific player using variables :P

how about if player 1 type heal and only 3 seconds passed, another player type !heal then the i loop will check all players with Heal == 1 so the player 2 just had to wait 2 secs for heal Bravo!

lol how does it matter, if the player has to wait 3 secs or 2 secs?
Title: Re: set timer help
Post by: aledark24 on July 07, 2013, 08:49:35 pm
oh boy you're a Genius man...


how about if player 1 type heal and only 3 seconds passed, another player type !heal then the i loop will check all players with Heal == 1 so the player 2 just had to wait 2 secs for heal Bravo!

yeah is right but i put in my command if player have $400 xD not all players have money for heal :D
IF YOU HAVE ANOTHER IDEA OF A COMMAND WHIT TIMER, PLEASE TELL US
Title: Re: set timer help
Post by: Doom on July 09, 2013, 09:10:58 am
Yeah here is a perfect idea:

Wait for a good release which can support to pass player id in timer.


lol how does it matter, if the player has to wait 3 secs or 2 secs?

i think 2 secs are enough to evade death.
Title: Re: set timer help
Post by: heekz.shadow on July 09, 2013, 02:14:35 pm
I wuz the first to discover passing functions for specific player using variables :P

No you weren't, there were lots of scripters who done that before you.



oh boy you're a Genius man...


how about if player 1 type heal and only 3 seconds passed, another player type !heal then the i loop will check all players with Heal == 1 so the player 2 just had to wait 2 secs for heal Bravo!

yeah is right but i put in my command if player have $400 xD not all players have money for heal :D
IF YOU HAVE ANOTHER IDEA OF A COMMAND WHIT TIMER, PLEASE TELL US

You could store the tickcount for the player at heal and then compare with the one in the healing function. If it is over 4000 or 3000, then you can heal him. However I am not sure if pawn can do that.
Title: Re: set timer help
Post by: NeskWriter on July 09, 2013, 06:45:11 pm
nah I wuz, all rights r reserved