Author Topic: Healing in 5 secs :D  (Read 3553 times)

0 Members and 1 Guest are viewing this topic.

Offline JackDawZ

  • Street Thug
  • *
  • Posts: 23
    • View Profile
Healing in 5 secs :D
« on: November 11, 2012, 11:53:35 pm »
Moderator note: This code does not work with players who have an ID other than 0.
See post: http://forum.vicecitymultiplayer.com/index.php?topic=5276.msg32006#msg32006


Hello guys, and i want to share with you by my little script "Healing in 5 secs" xD
It's very easy:

Command:
[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,0);
          GameTextForPlayer(playerid, "Healing");
      }
      return 1;
      }
   return 1;
}[/pawn]

Timer:
[pawn]}
public Healing(playerid)
{
TogglePlayerControllable(playerid, 1);
SetPlayerHealth( playerid, 100.0 );
SendClientMessage( playerid, COLOR_YELLOW, ">> You have been healed!" );
}[/pawn]

Have fun! ;)
« Last Edit: December 21, 2012, 11:34:22 pm by stormeus »
Proud member of TRC since 28th January of 2013, LGS, XE-Servers, Extreme Addicts Moderator.




Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: Healing in 5 secs :D
« Reply #1 on: November 12, 2012, 12:23:24 am »
I'd like to be the first to point out that
this won't work with player IDs > 0
Do not PM me for support.




Offline [KB]ViceMania

  • Wiseguy
  • **
  • Posts: 53
  • Mega War server administrator
    • View Profile
Re: Healing in 5 secs :D
« Reply #2 on: December 16, 2012, 11:33:43 pm »
So if you do not want to become???  :)

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,0);
                    SetPlayerHealth( playerid, 100.0 );
          GameTextForPlayer(playerid, "Helaed.. ~w~pleace wait.");
      }
      return 1;
      }

public Healing(playerid)
{
TogglePlayerControllable(playerid, 1);
}

Offline stormeus

  • VC:MP Developer
  • VC:MP Veteran
  • *
  • Posts: 1122
    • View Profile
Re: Healing in 5 secs :D
« Reply #3 on: December 21, 2012, 11:33:45 pm »
Alright, I'm about done with this. Both of the above snippets DO NOT WORK PROPERLY. Only players with an ID of 0 will be healed, meaning IDs 1-49 will not be able to heal. Please learn Pawn syntax and semantics before even attempting this.

This thread is locked as the code is useless.
Do not PM me for support.