Thread Tools Display Modes
Prev Previous Post   Next Post Next
09-18-08, 10:30 PM   #1
Ne0nguy
A Fallenroot Satyr
 
Ne0nguy's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 22
Need help simplifying this

I am trying to create a function that returns True if the player can invite a player to a group or raid but false any other time.

I was able to come up with something but there has to be a way to simplify it.. can anyone give me suggestions?

Code:
function CanInvite()
	if(GetNumRaidMembers() > 0 and IsRaidLeader()) then
		return True;
	elseif(GetNumPartyMembers() > 0 and IsPartyLeader()) then
		return True;
	elseif(GetNumPartyMembers() == 0 and GetNumRaidMembers() == 0) then
		return True;
	else
		return False;
	end
end
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Need help simplifying this


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off