Author Topic: {-SOLVED-} Getting the Cap # With GetPlayerStat {-SOLVED-}  (Read 825 times)

0 Members and 1 Guest are viewing this topic.

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
{-SOLVED-} Getting the Cap # With GetPlayerStat {-SOLVED-}
« on: November 09, 2008, 05:23:05 pm »
I am making a script that shows the number of caps each person has at the end of the round but I cant get GetPlayerStat(ID,'Flags') to work (it always turns up 0).

1) Why won't GetPlayerStat(ID,'Flags') work?

2) Is it possible to change a player var such as health with GetPlayerStat(ID,'Heath') := GetPlayerStat(ID,'Health') + 50

3) Is there an event for the round being over (when it freezes and shows the scores) that I can use instead of OnMapChange?

Thank you. :)
« Last Edit: November 10, 2008, 09:37:11 am by Hacktank »


Offline xmRipper

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 742
    • Personal
Re: Getting the Cap # With GetPlayerStat
« Reply #1 on: November 09, 2008, 05:34:06 pm »
2)
DoDamage. Give negative damage.

3)
Code: [Select]
procedure AppOnIdle(Ticks: integer);
begin
  if TimeLeft = 0 then begin
    // more code here
  end;
end;
Co-Founder / CTO @ Macellan
Founder Turkish Soldat Community

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Getting the Cap # With GetPlayerStat
« Reply #2 on: November 09, 2008, 05:48:55 pm »
Thanks!
I know that the normal hp is 150 but if I did DoDamage(ID,149) would that leave you with 1 hp or is it highly different values like the weapon mod damage?


Offline GSx_Major

  • Major
  • *
  • Posts: 97
Re: Getting the Cap # With GetPlayerStat
« Reply #3 on: November 09, 2008, 05:55:38 pm »
Flags will be in the next server version.

As for the end of round event, there is none. You should check this. Also, just checking if the time is out isn't gonna do it. You need to check score limits and commands too.
...and headbutt the sucker through your banana suit!

Offline chutem

  • Veteran
  • *****
  • Posts: 1119
Re: Getting the Cap # With GetPlayerStat
« Reply #4 on: November 10, 2008, 12:27:32 am »
Thanks!
I know that the normal hp is 150 but if I did DoDamage(ID,149) would that leave you with 1 hp or is it highly different values like the weapon mod damage?
DoDamage(ID,149) does 149 points of damage.
Yes they will have 1 health left.
1NK3FbdNtH6jNH4dc1fzuvd4ruVdMQABvs

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: Getting the Cap # With GetPlayerStat
« Reply #5 on: November 10, 2008, 09:35:08 am »
Ok thanks guys, on to the next addition to the all purpose script :).

@GSx_Major: Thanks but::
1) I dont get crossfunc.
2) Thats to much a pain in the arse.

Problem Solved!


Offline Norbo

  • Camper
  • ***
  • Posts: 338
Re: {-SOLVED-} Getting the Cap # With GetPlayerStat {-SOLVED-}
« Reply #6 on: November 10, 2008, 11:07:25 am »
as for number 1, you should make an array of 32 integers, and on each cap, add 1 to the array[id] for the person that capped

as for 2 and 3, these ware explained

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: {-SOLVED-} Getting the Cap # With GetPlayerStat {-SOLVED-}
« Reply #7 on: November 10, 2008, 12:29:47 pm »
That is exactly what i started doing. :)