If he has not played any music first, he is punished for begging. otherwise he gets paid a random amount depending on where he is:
mob/proc/Pass_hat(mob/M in oview(hat_distance))
if (busked == 0)
usr << "you have not busked. STOP BEGGING!"
crimes += 1
return..()
if(M.class == "joe_public" && istype(loc.loc,/area/pitch))
var/amount = (rand(1,(M.gold/2))-1)
M.gold -= amount
usr.gold += amount
world << "[usr] hats [M] , getting [amount] Euros!"
busked = 0
return..()
if(istype(loc.loc,/area/police))
usr << "[M] calls the police!"
world << "[usr] is wanted by the police for hatting in a police station"
wanted = "YES"
busked = 0
crimes += 2
return..()
The problem is when he passes the hat there is a box which asks which person to hat. I want him to hat EVERYONE in the distance defined by the hat distance and not just one person. What must I do?
Look up for()
And on a side note;
Non-robust code ftw.
And besides THAT;
No put usr in proc, ungh.