ID:169056
 
Well first off heres my code for mining:
turf
Rock
icon='mining.dmi'
icon_state="rock"
density=1
verb
Mine()
if(!usr.mining)
usr.mining=1
var/obj/pickaxe=locate(/obj/Tools/Pickaxe)in usr.contents
if(pickaxe)
var/chance=rand(1,75)
if(chance >=1 && <=35)
usr << "\red <b><small>Nothing was found...."
mining=0
else
if(chance >=36 && <=45)
usr << "\blue <b><small>You found ore!"
usr.contents += new/obj/ore
mining=0
else
if(chance >=46 && <= 55)
usr << "\blue <b><small>You found an emerald!"
usr.contents += new/obj/emerald
mining=0
else
if(chance >=56 <=60)
if(usr.mining >=35)
usr << "\blue <b><small>You found a sapphire!"
usr.contents += new/obj/sapphire
mining=0
else
usr << "\red <b><small>You find a gem, but accidentally lose hold of it!"
mining=0
<\DM>

Problem is, when i compile, i get the error

Missing left hand argument to <=

on the line where it says if(chance >=1 && <= 35)

it comes up three times to. Can someone help me out?
--Reinhart.
i think you need to have:
if(chance >=1 && chance <= 35)
In response to Popisfizzy
thanx. to the best of my knowledge its fixed.
You can't do that. You need to say:

if((chance>=10) && (chance<=20))
.

Or, to make it easier:

#define Between(a,b,c) ((a>=b)&&(a<=c))

Put stuff here.

mob/verb/Test()
if(Between(chance,10,20)) src << "Chance is between 10 and twenty!"


I think that will work.
In response to Jp
Are you sure? Cause i left it as
if(chance >= 1 && chance <= 30)
and the errors are gone.
In response to Reinhartstar
That works, the define is just an attempt to make it easier. I'm curious now, does the define work?