i want to insert if statements like if the usr strength is greater than 10, than it will say "This user is kinda strong" and if the user strength is greater than 100 than it will say another thing and so on...
this is my current browse function
mob
verb
Stats()
for(var/mob/M in oview(3))
var/Stats ={"
Stats for [M]
Name: [M]
Race: [M.RACE]
Strength: [M.STR]
Defense: [M.DEF]
"}
usr << browse(Stats, "window=page")
ID:174036
![]() Oct 9 2003, 2:30 pm
|
|
Loduwijk wrote:
> proc/approx_strength(mob/body_builder) I would suggest changing the last two IFs to ELSE IFs. Otherwise you're never going to see the first two messages. :) |
First of all, you are looping through the mobs within close view, and changing Stats each time for each one. You will end up having only the stats of the last one in your browser when the proc ends. If you want to fix that, put in Stats="" as the first line in there, and use Stats += {"[text here] instead of Stats ={"[text here]
I suggest you make an additional proc that will return a text string and embed it within the text string that you are browsing.
example:
With that, you will be able to have conditional statements within your browser. You could also do it by setting a variable to the required text earlier in the proc and imbedding that variable in there the same way, but I prefer doing it this way. You use whichever you like.