MessageAdmin cause error

Started by rww, Jul 07, 2015, 11:45 AM

Previous topic - Next topic

rww

I have this problem on Liberty Unleashed, but here is more people, who can help me.

When i use this function

function MessageAdmin(t1,r,g,b)
{
for (local i = 0; i <= GetMaxPlayers(); i++)
{
local p = FindPlayer(i);
if (Level[p.ID] >= 3) MessagePlayer(t1,p,r,g,b);
}
}

I have a error:

<07/07/2015 - 13:12:24>
AN ERROR HAS OCCURED [the index 'ID' does not exist]
<07/07/2015 - 13:12:24>
CALLSTACK
<07/07/2015 - 13:12:24> *FUNCTION [MessageAdmin()] Scripts/Glowny/Funkcje.nut line [24]
<07/07/2015 - 13:12:24> *FUNCTION [onPlayerCommand()] Scripts/Glowny/Komendy.nut line [4789]
<07/07/2015 - 13:12:24>
LOCALS
<07/07/2015 - 13:12:24> [i] INSTANCE
<07/07/2015 - 13:12:24> [ b ] 255
<07/07/2015 - 13:12:24> [g] 255
<07/07/2015 - 13:12:24> [r] 255
<07/07/2015 - 13:12:24> [t1] "[#ff0000]@ [#ffffff][0] ^YLC^RwwpL.[#ffffff]: test"
<07/07/2015 - 13:12:24> [this] TABLE
<07/07/2015 - 13:12:24> [veh] NULL
<07/07/2015 - 13:12:24> [plr] NULL
<07/07/2015 - 13:12:24> [t] "test"
<07/07/2015 - 13:12:24> [c] "a"
<07/07/2015 - 13:12:24> [p] INSTANCE
<07/07/2015 - 13:12:24> [this] TABLE
Join to Irrelevant Club Discord: https://discord.gg/MsPPZ5uV4X

ℛḝξ☂

function MessageAdmin(t1,r,g,b)
{
 for (local i = 0; i <= GetMaxPlayers(); i++)
 {
  local p = FindPlayer(i);
  if (p && Level[i] >= 3) MessagePlayer(t1,p,r,g,b);
 }
}
TRY... Untested.
I may be a slow walker but I am always walking.

rww

Quote from: Sentral on Jul 07, 2015, 11:50 AMfunction MessageAdmin(t1,r,g,b)
{
 for (local i = 0; i <= GetMaxPlayers(); i++)
 {
  local p = FindPlayer(i);
  if (p && Level[i] >= 3) MessagePlayer(t1,p,r,g,b);
 }
}
TRY... Untested.


Thanks...
Join to Irrelevant Club Discord: https://discord.gg/MsPPZ5uV4X