Retrieving Evolve Immunity Levels

I need to retrieve players’ Evolve immunity levels. I’ve been digging through ev_framework.lua for an hour and I cannot find the code needed to grab a rank’s immunity level, and there’s no official documentation anywhere. Anyone have anything that could help?

[lua]local plyImmunity = tonumber( evolve.ranks[ ply:EV_GetRank() ].Immunity )[/lua]

Snippet I found from the bans plugin. It looks like there’s no proper API for finding it.

This code produced:


attempt to call method 'plyImmunity' (a nil value)


The code that I am using is:


function PANEL:HigherOrLower( row )

local plyImmunity = tonumber( evolve.ranks[ self.Player:EV_GetRank() ].Immunity )

	if ( !self.Player:IsValid() || self.Player:Team() == TEAM_CONNECTING ) then return false end
	if ( !row.Player:IsValid() || row.Player:Team() == TEAM_CONNECTING ) then return true end

	    return self.Player:plyImmunity() < row.Player:plyImmunity()

end

You’re assigning plyImmunity to a variable, it’s not a metamethod you can call on the self.Player object.

You have to find the immunity of each player and assign it to a variable, then compare the variables. You already have one player’s immunity being assigned to plyImmunity, now you just need the second one. And to change that last line, the “return xxx” line to use those variables instead of what it’s currently doing.

Sorry for the late reply and posting in the wrong area; your post fixed me problem. Thanks!