All pastes #568619 Raw Edit

Something

public lua v1 · immutable
·published 2007-06-15 16:54 UTC
rendered paste body
function trainCheck(xp, cash, plyr, item) --Bring in XP, cash ,Plyr, and Item requirements output table	local myTable = {false, false, false}		if (plyr.getExperience() >= xp) then		myTable[1] = true	end		if (plyr.getCash() >= cash) then		myTable[2] = true	end		if (plyr.inventory_find(item) == 0) then		myTable[3] = true	end		return myTableendfunction Vehicle_OnProduce(vech, plyr, menuitem) -- vehicle, player, integer        local vid = vech:vehicletypeid()        local check		local verify = {true, true, true, true}				g_arena:message("'Vehicle_OnProduce' called by " .. plyr.m_name .. " with vid " .. vid .. " and menu item " .. menuitem)        if (vid == 411) then            if (menuitem == 0) then				plyr:message("Command Training requires 20,000 Experince and 15,000 credits.")				check = trainCheck(20000, 15000, plyr, "Command Training")				plyr:message("check works")				if (check == {true, true, true}) then					plyr:message("Have your Training.");					verify[1] = true				elseif (check == {true, true, false}) then					plyr:message("You have already been trained in this, you cannot learn anything else.")					verify[2] = false				elseif (check == {true, false, false}) then					plyr:message("You need 15,000 Credits, you only have " .. plyr.getCash() .. ".")					verify[3] = false				elseif (check == {false, false, false}) then					plyr:message("You need 20,000 Experience, you only have " .. plyr.getExperience() .. ".")					verify[4] = false				end								if (verify == {true, false, false, false}) then					return true				else					return false				end								elseif (menuitem == 1) then				return true			end		end	return trueend