Command /healall is not healing anyone, in addition /getall works on all players, and uses code from
/healall. When I'm alone, nothing is showing up, but when there is 2 persons or more, in console are showing up errors.
else if (c=="getall")
{
if (IsNoob(p,c)) return 0;
else if (!p.Spawned) MessagePlayer("** Musisz sie zrespic aby uzyc tej komendy!",p,255,0,0);
else
{
Message("*** "+p.Name+" teleportowal wszystkich graczy do siebie!",0,200,0);
for ( local count = GetPlayers(), id = 0, max = GetMaxPlayers(), plrs; count && id < max; id++ )
{
if ( !( plrs = FindPlayer( id ) ) ) continue;
if (plrs.Spawned) plrs.Pos = p.Pos;
--count;
}
}
}
else if (c=="healall")
{
if (IsNoob(p,c)) return 0;
else if (!p.Spawned) MessagePlayer("** Musisz sie zrespic aby uzyc tej komendy!",p,255,0,0);
else
{
Message("*** "+p.Name+" uzdrowil wszystkich graczy!",0,200,0);
for ( local count = GetPlayers(), id = 0, max = GetMaxPlayers(), plrs; count && id < max; id++ )
{
if ( !( plrs = FindPlayer( id ) ) ) continue;
if (plrs.Spawned) plrs.Health = 100;
--count;
}
}
}
Error is this line
if (plrs.Spawned) plrs.Health = 100;
This script from my old vcmp server.