Official Soldat Forums

Server Talk => Scripting Discussions and Help => Topic started by: Hacktank on November 09, 2008, 05:23:05 pm

Title: {-SOLVED-} Getting the Cap # With GetPlayerStat {-SOLVED-}
Post by: Hacktank 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. :)
Title: Re: Getting the Cap # With GetPlayerStat
Post by: xmRipper on November 09, 2008, 05:34:06 pm
2)
DoDamage (http://enesce.com/help/index.html?Functions/DoDamage.html). Give negative damage.

3)
Code: [Select]
procedure AppOnIdle(Ticks: integer);
begin
  if TimeLeft = 0 then begin
    // more code here
  end;
end;
Title: Re: Getting the Cap # With GetPlayerStat
Post by: Hacktank 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?
Title: Re: Getting the Cap # With GetPlayerStat
Post by: GSx_Major 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 (http://forums.soldat.pl/index.php?topic=26477.0). Also, just checking if the time is out isn't gonna do it. You need to check score limits and commands too.
Title: Re: Getting the Cap # With GetPlayerStat
Post by: chutem 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.
Title: Re: Getting the Cap # With GetPlayerStat
Post by: Hacktank 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!
Title: Re: {-SOLVED-} Getting the Cap # With GetPlayerStat {-SOLVED-}
Post by: Norbo 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
Title: Re: {-SOLVED-} Getting the Cap # With GetPlayerStat {-SOLVED-}
Post by: Hacktank on November 10, 2008, 12:29:47 pm
That is exactly what i started doing. :)