Vice City: Multiplayer

Server Development => Scripting and Server Management => Topic started by: FinchDon on Aug 20, 2015, 03:35 PM

Title: HP ADDon
Post by: FinchDon on Aug 20, 2015, 03:35 PM
I saw Ksna Random Cash system i so made like that but didn't work :-\

There is Code

randhp <- [ 10, 20, 25, 30, 35, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100 ];
function onPlayerKill( killer, player, weapon, reason )
{
   local a = randhp[rand()% randhp.len()]
   killer.Health + a ;
   ePrivMessage( "Health Add on " + a + ".", killer );
}
Title: Re: Hp Addon
Post by: Stormeus on Aug 20, 2015, 03:37 PM
killer.Health + a should be killer.Health += a. Changing someone's health requires assigning their health a value; all you did was add their health and the random HP without doing anything with it.

What I gave you is the same as doing killer.Health = killer.Health + a;
Title: Re: Hp Addon
Post by: FinchDon on Aug 20, 2015, 04:15 PM
i have to use killer.Health += a; ?
Title: Re: Hp Addon
Post by: Thijn on Aug 20, 2015, 04:18 PM
Quote from: FinchDon on Aug 20, 2015, 04:15 PMi have to use killer.Health += a; ?
....

Why ask when you can easily just test it out? Do we really have to tell you everything before you do some testing yourself?