function Vehicle_OnProduce(vech, plyr, menuitem) -- vehicle, player, integer local vendor = vech:vehicletypeid() local player = plyr local menu = menuitem g_arena:messsage("vendor = " .. vendor .. " menu = " .. menu) --Training Vendor if (vendor == 411 and menu == 1) then --check if they are trying to get Command Training player:message("Command Training requires 25,000 Experience and 10,000 Credits.") if (player:getExperience() < 25000) then -- Check if they have less than 25000 experioence player:message("You need 25,000 Experience, you only have " .. player:getExperience() .. ". Go train some more!") return false elseif (player:getCash() < 10000) then --Check if they have less than 10,000 cash player:message("You need 10,000 Credits, you only have " .. player:getCash() .. ". Go train some more!") return false elseif (player:inventory_find("Command Training") >= 1) then --Check if they already have the medal player:message("You already have been trained in basic Command skills. You can learn nothing from me!") return false else -- If they meet all those requirements... give them the medal Cause thats the nice thing to do... player:modCash(-10000) player:modExperience(-25000) return true --return boolean (whether to allow the produce or not) end else return false end if (vendor == 411 and menu == 2) then -- Check if they are trying to get Mental Training player:message("Mental Training requires 30,000 Experience and 15,000 Credits.") if (player:getExperience() < 30000) then player:message("You need 30,000 Experience, you only have " .. player:getExperience() .. ". Go train some more!") return false elseif (player:getCash() < 15000) then player:message(" You need 15,000 Credits, you only have " .. player:getCash() .. ". Go train some more!") return false elseif (player:inventory_find("Mental Training") >= 1) then player:message("You already ahve been trained in basic Mental Skills. You can learn nothing from me!") return false else -- Meet requirements player:modCash(-15000) player:modExperience(-30000) return true end else return false end if (vendor == 411 and menu == 3) then -- Check if they are trying to get Unknown Training player:message("Unknown Training requires 50,000 Experience and 30,000 Credits.") if (player:getExperience() < 50000) then player:message("You need 50,000 Experience, you only have " .. player:getExperience() .. ". Go train some more!") return false elseif (player:getCash() < 30000) then player:message(" You need 30,000 Credits, you only have " .. player:getCash() .. ". Go train some more!") return false elseif (player:inventory_find("Unknown Training") >= 1) then player:message("You already ahve been trained in basic Unknown Skills. You can learn nothing from me!") return false else -- Meet requirements player:modCash(-30000) player:modExperience(-50000) return true end else return false end --Certificate Dealer if (vendor == 400 and menu == 1) then -- Check if they are ttrying to get Command Certification player:message("In order to get your Command Certification you must share 25,000 Experience and 10,000 Credits") if (player:getExperience() < 25000) then -- Check if they have less than 25000 experioence player:message("You need 25,000 Experience, you only have " .. player:getExperience() .. ". Go train some more!") return false elseif (player:getCash() < 10000) then --Check if they have less than 10,000 cash player:message("You need 10,000 Credits, you only have " .. player:getCash() .. ". Go train some more!") return false elseif (player:inventory_find("Command Certification") >= 1) then --Check if they already have the medal player:message("You already have been certified in Command Skills. You can learn nothing from me!") return false else -- If they meet all those requirements... give them the medal Cause thats the nice thing to do... player:modCash(-10000) player:modExperience(-25000) return true --return boolean (whether to allow the produce or not) end else return false end if (vendor == 400 and menu == 2) then -- Check if they are trying to get Mental Certification player:message("In order to get your Mental Certification you must share 30,000 Experience and 15,000 Credits") if (player:getExperience() < 30000) then -- Check if they have less than 25000 experioence player:message("You need 30,000 Experience, you only have " .. player:getExperience() .. ". Go train some more!") return false elseif (player:getCash() < 15000) then --Check if they have less than 10,000 cash player:message("You need 15,000 Credits, you only have " .. player:getCash() .. ". Go train some more!") return false elseif (player:inventory_find("Mental Certification") >= 1) then --Check if they already have the medal player:message("You already have been certified in Command Skills. You can learn nothing from me!") return false else -- If they meet all those requirements... give them the medal Cause thats the nice thing to do... player:modCash(-15000) player:modExperience(-30000) return true --return boolean (whether to allow the produce or not) end else return false end if (vendor == 400 and menu == 3) then -- Check if they are trying to get Unknown Certification player:message("In order to get your Missing Certification you must share 50,000 Experience and 30,000 Credits") if (player:getExperience() < 50000) then -- Check if they have less than 25000 experioence player:message("You need 30,000 Experience, you only have " .. player:getExperience() .. ". Go train some more!") return false elseif (player:getCash() < 30000) then --Check if they have less than 10,000 cash player:message("You need 15,000 Credits, you only have " .. player:getCash() .. ". Go train some more!") return false elseif (player:inventory_find("Missing Certification") >= 1) then --Check if they already have the medal player:message("You already have been certified in Unknown Skills. You can learn nothing from me!") return false else -- If they meet all those requirements... give them the medal Cause thats the nice thing to do... player:modCash(-30000) player:modExperience(-50000) return true --return boolean (whether to allow the produce or not) end else return false end end