Author Topic: SetPlayerStat doesn't work?  (Read 631 times)

0 Members and 1 Guest are viewing this topic.

Offline Akinaro

  • Flagrunner
  • ****
  • Posts: 749
SetPlayerStat doesn't work?
« on: September 25, 2013, 06:17:42 am »
.
« Last Edit: November 11, 2013, 04:53:22 am by Akinaro »

Offline skrX

  • Soldier
  • **
  • Posts: 112
  • x ye.
Re: SetPlayerStat doesn't work?
« Reply #1 on: September 25, 2013, 11:57:41 am »
Quote
So how can I set player health?

Code: [Select]

function SpawnObject(X, Y: single; ObjType: byte): integer;

Parameter Info:
 X (Single): X position that the object will spawn.
 Y (Single): Y position that the object will spawn.
 ObjType (Byte): ID of the object to be spawned. See below for details


Example:

Code: [Select]
SpawnObject(GetPlayerStat(ID,'X'),GetPlayerStat(ID,'Y'),16);
« Last Edit: September 25, 2013, 12:06:24 pm by skrX »

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: SetPlayerStat doesn't work?
« Reply #2 on: September 25, 2013, 12:26:07 pm »
If you know ID you wanted to pass to SetPlayerStat then i see no reason why you wouldn't know ID you want to pass to DoDamage. It's the same one.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Silnikos

  • Soldier
  • **
  • Posts: 129
Re: SetPlayerStat doesn't work?
« Reply #3 on: September 25, 2013, 05:27:19 pm »
Ah, I figure out about ID and spawn object after hour xD but forum was down and I couldn't write it(lobby in soldat was off too)...

Script work well, but still it would be better to set player health instead of spawning First Aid Kid, its looks a bit... "bad" when you have full health and you leave behind med kid.
Just use DoDamage with negative value then.

DoDamage(ID,-20);