Allways 1hp
#1

Hey!

What script makes player to have 1hp allways? Even if you get damaged you will have 1hp allways.
Reply
#2

pawn Код:
public OnGameModeInit()
{
  SetTimer("HPT", 1, true);
  return 1;
}

forward HPT();
public HPT()
{
  for(new i=0; i<GetMaxPlayers(); i++)
  {
    if(IsPlayerConnected(i))
      SetPlayerHealth(i, 1.0);
  }
  return 1;
}
(yes I know, this causes lags and isn't a good way to code, although the standart of the code fits to the standart of the question ; -)
Reply
#3

@Sascha Why did you set 1ms to interval update? It's enough 1000 or less to update the timer.
Reply
#4

Someone can get punched and die in less than a second
Reply
#5

I think that the player would die anyway, no matter if you setplayerhealth each second.
Try jumping from a building or loose health
Reply
#6

Phanto is perfectly right. I would to say that 1000ms = 1second 1ms = 0.1 second why it could be checked in 1ms? It doesn't change anything in this case.
Reply
#7

Why the hell do you need this lol
Reply
#8

Quote:
Originally Posted by TheArcher
Посмотреть сообщение
Phanto is perfectly right. I would to say that 1000ms = 1second 1ms = 0.1 second why it could be checked in 1ms? It doesn't change anything in this case.
if you guys read my post you would know why....



Hint:
"(yes I know, this causes lags and isn't a good way to code, although the standart of the code fits to the standart of the question ; -)"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)