Vice City Multiplayer

VC:MP 0.3 => mIRC/pawn Scripting => Snippet Showroom => Topic started by: mrockxkingbutt on February 08, 2013, 02:54:29 pm

Title: Work 100% Heal Cmd in 5 seconds
Post by: mrockxkingbutt on February 08, 2013, 02:54:29 pm
for begin
[pawn]new Medic[MAX_PLAYERS];[/pawn]
cmd
[pawn]    else if ( strcmp( cmd, "!heal", true ) == 0 )
   {
      new Float:Health; GetPlayerHealth( playerid, Health );
        if ( Health >= 100 ) SendClientMessage( playerid, COLOR_YELLOW, ">> Error: You are healthy." );
      else
      {
          TogglePlayerControllable(playerid,0);
          SetTimer("healing", 5000, false);
          DecPlayerHandCash(playerid,200);
          GameTextForPlayer(playerid, "Healing");
      Medic[playerid] = 1;
      }
      return 1;
      }[/pawn]
timer stock workable
[pawn]public healing() {
    for(new i = 0; i < MAX_PLAYERS; i++) {
        if(IsPlayerConnected(i)) {
       if(Medic == 1) {
TogglePlayerControllable(i, 1);
SetPlayerHealth( i, 100.0 );
SendClientMessage( i, COLOR_YELLOW, ">> You have been healed!" );
             }
           }
         }
       }[/pawn]
Title: Re: Work 100% Heal Cmd in 5 seconds
Post by: NeskWriter on February 08, 2013, 03:01:52 pm
Shit man will u stop this?
Title: Re: Work 100% Heal Cmd in 5 seconds
Post by: mrockxkingbutt on February 08, 2013, 03:06:13 pm
Quote
Shit man will u stop this?
what happend this is workable heal in 5 seconds
it is workable not like other timers
Title: Re: Work 100% Heal Cmd in 5 seconds
Post by: NeskWriter on February 08, 2013, 04:30:50 pm
Quote
Shit man will u stop this?
what happend this is workable heal in 5 seconds
it is workable not like other timers

maybe, but aren't u bored of posting that several times?
make it in SQL or above the timer.
Title: Re: Work 100% Heal Cmd in 5 seconds
Post by: mrockxkingbutt on February 08, 2013, 04:32:54 pm
man i didnot post this serval times
that i to help that guy
and this is workable
in 5 seconds
Title: Re: Work 100% Heal Cmd in 5 seconds
Post by: NeskWriter on February 08, 2013, 04:47:13 pm
man i didnot post this serval times
that i to help that guy
and this is workable
in 5 seconds

several times is not 1, 000, 000 times
Title: Re: Work 100% Heal Cmd in 5 seconds
Post by: stormeus on February 08, 2013, 10:49:52 pm
SetTimer("healing", 5000, false);

Every time a player uses the healing command, ANOTHER timer is created. Eventually, not only will 100 timers be running, but the timers will interfere with each other, causing it to run what seems to be every tenth of a second. Put that line of code in OnGameModeInit and don't put it in a command, and it'll work okay, except that if a player heals a second before the timer runs, it only takes one second for them to heal.
Title: Re: Work 100% Heal Cmd in 5 seconds
Post by: USA.Ghost on February 23, 2013, 01:59:54 pm
SetTimer("healing", 5000, false);

Every time a player uses the healing command, ANOTHER timer is created. Eventually, not only will 100 timers be running, but the timers will interfere with each other, causing it to run what seems to be every tenth of a second. Put that line of code in OnGameModeInit and don't put it in a command, and it'll work okay, except that if a player heals a second before the timer runs, it only takes one second for them to heal.

Use killtimer when it ends
Title: Re: Work 100% Heal Cmd in 5 seconds
Post by: sseebbyy on February 23, 2013, 05:00:46 pm
SetTimer("healing", 5000, false);

Every time a player uses the healing command, ANOTHER timer is created. Eventually, not only will 100 timers be running, but the timers will interfere with each other, causing it to run what seems to be every tenth of a second. Put that line of code in OnGameModeInit and don't put it in a command, and it'll work okay, except that if a player heals a second before the timer runs, it only takes one second for them to heal.

Use killtimer when it ends

But if 40 players wants to heal in the same time ? => 5 sec x40
Title: Re: Work 100% Heal Cmd in 5 seconds
Post by: stormeus on February 23, 2013, 05:30:40 pm
Use killtimer when it ends
Put that line of code in OnGameModeInit and don't put it in a command, and it'll work okay, except that if a player heals a second before the timer runs, it only takes one second for them to heal.

sigh
Title: Re: Work 100% Heal Cmd in 5 seconds
Post by: USA.Ghost on February 23, 2013, 06:40:44 pm
SetTimer("healing", 5000, false);

Every time a player uses the healing command, ANOTHER timer is created. Eventually, not only will 100 timers be running, but the timers will interfere with each other, causing it to run what seems to be every tenth of a second. Put that line of code in OnGameModeInit and don't put it in a command, and it'll work okay, except that if a player heals a second before the timer runs, it only takes one second for them to heal.

Use killtimer when it ends

But if 40 players wants to heal in the same time ? => 5 sec x40
disable cmd until the healing player heals
Title: Re: Work 100% Heal Cmd in 5 seconds
Post by: NeskWriter on February 23, 2013, 06:50:30 pm
One lol guy has seen heal system which takes 5 secs to heal...and...they're still posting shit. Can u make healsys above the timer? What is the zest of giving player hps after 5 secs of saying !healme by em? Remove that shit and make normal system, this  will be the most perfect thing.
Title: Re: Work 100% Heal Cmd in 5 seconds
Post by: USA.Ghost on February 23, 2013, 09:09:37 pm
One lol guy has seen heal system which takes 5 secs to heal...and...they're still posting shit. Can u make healsys above the timer? What is the zest of giving player hps after 5 secs of saying !healme by em? Remove that shit and make normal system, this  will be the most perfect thing.

Its because of anti-abuse
Title: Re: Work 100% Heal Cmd in 5 seconds
Post by: NeskWriter on February 23, 2013, 11:08:16 pm
One lol guy has seen heal system which takes 5 secs to heal...and...they're still posting shit. Can u make healsys above the timer? What is the zest of giving player hps after 5 secs of saying !healme by em? Remove that shit and make normal system, this  will be the most perfect thing.

Its because of anti-abuse

WHAT
THE
ANTI
ABUSE?


Calm down. -stormeus
Title: Re: Work 100% Heal Cmd in 5 seconds
Post by: USA.Ghost on February 26, 2013, 04:04:13 pm
One lol guy has seen heal system which takes 5 secs to heal...and...they're still posting shit. Can u make healsys above the timer? What is the zest of giving player hps after 5 secs of saying !healme by em? Remove that shit and make normal system, this  will be the most perfect thing.

Its because of anti-abuse


WHAT
THE
ANTI
ABUSE?

'

so players wont heal when they for example, are being shot
Title: Re: Work 100% Heal Cmd in 5 seconds
Post by: mrockxkingbutt on March 18, 2014, 04:46:42 pm
stromeus move it to snippet