ID:142065
 
Code:
        Buy_Recruits()
alert("Currently, recruits cost $[troopcost].")
var/troop = input("How many recruits do you want to buy?") as null|num
var/mon = troop*src.troopcost
if(troop >= 1||!findtext(".",troop))
if(mon > src.money)
src <<"You don't have enough money for that many recruits."
else
if(src.civ >= troop)
src.money -= mon
src.troops += troop
src.civ -= troop
if(src.firsttut == 1)
src <<"Great. Now press Train Recruits and train 10 infantry."
src.sectut = 1
src.firsttut = 0
else
src <<"You don't have enough civilians."
else
src <<"I don't think you want a cripple in the army."


Problem description:

With the current code, people can buy 2.1 recruits or -109238094832094830219843920 of them.
if(troop >= 0)(or >; depends on how you want it) and round(input(blah blah) as/in blah).
In response to Jeff8500
Thanks.