Author Topic: Variables and treatment  (Read 2438 times)

0 Members and 1 Guest are viewing this topic.

Offline dominikkk26

  • Camper
  • ***
  • Posts: 404
    • PMGsite
Variables and treatment
« on: March 15, 2011, 11:05:07 am »
Problem polega na tym że to jest jako + i nie leczy tylko zabija.
The problem is that this is a + and not only heals kills.
Here are chunks of code:

Code: [Select]
var
MaxHP: byte; // do medkit

procedure Reset;
begin
  if Command('/realistic') = 1 then MaxHP:=65 else MaxHP:=150;
end;

if regExpMatch('^/(buy-2|buy2|buy 2|buy med|buy medkit|buy apteczka)$',lowercase(Text)) then begin
      if Player[ID].Pkasa >= med then begin
          Player[ID].Pkasa := Player[ID].Pkasa - med;
          DoDamage(ID, GetPlayerStat(ID, 'Health')-MaxHP);
end else  WriteConsole(ID, 'You do not have enough money',red);
end;

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
Re: Variables and treatment
« Reply #1 on: March 15, 2011, 11:20:43 am »
Speak Polish or English...not Polenglish...cause I can barely understand you.
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline SoldatFire

  • Soldier
  • **
  • Posts: 224
Re: Variables and treatment
« Reply #2 on: March 15, 2011, 11:31:43 am »
Speak Polish or English...not Polenglish...cause I can barely understand you.
He can only speak english on this forum no polish or should i "and every other talk on their language " glup si kao bidon i sigurno neznas sta pisem jer si toliko glup..
And i dont understand what he wants to say
I'm drunk right now. I feel compelled to go to battle. This lamp in front of me has no chance. Die lamp die. Your light is gone. I have won.

Offline dominikkk26

  • Camper
  • ***
  • Posts: 404
    • PMGsite
Re: Variables and treatment
« Reply #3 on: March 19, 2011, 09:20:01 am »
DISTRICT TO WHAT IS THE ERROR?

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
Re: Variables and treatment
« Reply #4 on: March 19, 2011, 09:43:22 am »
To heal just make negative value in DoDamage. And I don't see a point here "GetPlayerStat(ID, 'Health')-MaxHP" - IIRC you can't give some one more HP than maximum value...
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Variables and treatment
« Reply #5 on: March 19, 2011, 09:54:15 am »
To heal just make negative value in DoDamage. And I don't see a point here "GetPlayerStat(ID, 'Health')-MaxHP" - IIRC you can't give some one more HP than maximum value...
Damaging the player by the value of "GetPlayerStat(ID, 'Health')-MaxHP" will heal him to the amount MaxHP is set. Also you can heal up to 200HP with scripts.

Speak Polish or English...not Polenglish...cause I can barely understand you.
Tell that his translator tool >_>

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
Re: Variables and treatment
« Reply #6 on: March 19, 2011, 10:40:08 am »
To heal just make negative value in DoDamage. And I don't see a point here "GetPlayerStat(ID, 'Health')-MaxHP" - IIRC you can't give some one more HP than maximum value...
Damaging the player by the value of "GetPlayerStat(ID, 'Health')-MaxHP" will heal him to the amount MaxHP is set. Also you can heal up to 200HP with scripts.

Speak Polish or English...not Polenglish...cause I can barely understand you.
Tell that his translator tool >_>
Dominikkk26's translating tool I'm telling you!
K, I forgot it could be healed up to 200HP. Anyway, it should be negative, shouldn't it?
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Variables and treatment
« Reply #7 on: March 19, 2011, 10:44:59 am »
Let's say MaxHP is 200 and the player has 50 health left -> 50 - 200 = -150
There you go with the negative damage  ;)

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
Re: Variables and treatment
« Reply #8 on: March 19, 2011, 11:06:33 am »
Let's say MaxHP is 200 and the player has 50 health left -> 50 - 200 = -150
There you go with the negative damage  ;)
Yeah, true. My bad. So I really don't know what is he asking for. Only thing I can come up with is wrongly checked gamemode.
Code: [Select]
procedure Reset;
begin
  if Command('/realistic') = 1 then MaxHP:=65 else MaxHP:=150;
end;
The above part...
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Variables and treatment
« Reply #9 on: March 19, 2011, 11:19:44 am »
that regex isn't even inside an event |:

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Variables and treatment
« Reply #10 on: March 19, 2011, 11:21:22 am »
that regex isn't even inside an event |:
Because he just copied a few parts from his script dnmr  :| (Atleast i think so xD)

Offline dnmr

  • Camper
  • ***
  • Posts: 315
  • emotionally handicapped
Re: Variables and treatment
« Reply #11 on: March 19, 2011, 11:45:42 am »
that regex isn't even inside an event |:
Because he just copied a few parts from his script dnmr  :| (Atleast i think so xD)
seems like he copied a few parts from somebody else's script...

Offline Furai

  • Administrator
  • Veteran
  • *****
  • Posts: 1908
    • TransHuman Design
Re: Variables and treatment
« Reply #12 on: March 19, 2011, 11:51:16 am »
that regex isn't even inside an event |:
Because he just copied a few parts from his script dnmr  :| (Atleast i think so xD)
seems like he copied a few parts from somebody else's script...

Yeah, more likely. He tries to combine 2 scripts together...
"My senses are so powerful that I can hear the blood pumping through your veins."

Offline dominikkk26

  • Camper
  • ***
  • Posts: 404
    • PMGsite
Re: Variables and treatment
« Reply #13 on: March 19, 2011, 12:06:10 pm »
1. You say that the script should work fine? But rather than treat it kills, but what? This is my question.
2. I want to detect the type of game, whether it is realistic or normal. And then were treated as much hp which assigns mode.

From: March 19, 2011, 12:07:01 pm
Let's say MaxHP is 200 and the player has 50 health left -> 50 - 200 = -150
There you go with the negative damage  ;)
I know how it works!

Offline Swompie

  • Camper
  • ***
  • Posts: 390
Re: Variables and treatment
« Reply #14 on: March 19, 2011, 02:51:18 pm »
that regex isn't even inside an event |:
Because he just copied a few parts from his script dnmr  :| (Atleast i think so xD)
seems like he copied a few parts from somebody else's script...

Yeah, more likely. He tries to combine 2 scripts together...
@dnmr: Lol'd  ;D I forgot about that...
@Wookash: That too, probably.

Anyways, the script should work fine, probably you fucked something else up dominikkk26.