ID:180561
 
here it is..


mob/human
var/iconpick/=rand(1,7)
proc/IcoN()
if iconpick=1
icon = '1.dmi'
if iconpick=2
icon = '2.dmi'
if iconpick=3
icon = '3.dmi'
if iconpick=4
icon = '4.dmi'
if iconpick=5
icon = '5.dmi'
if iconpick=6
icon = '6.dmi'
if iconpick=7
icon = '7.dmi'

why is this not working?

var/iconpick/=rand(1,7)

You don't need a slash after iconpick.



if iconpick=1

You have to put parentheses around the comparison expression.
On 5/16/01 4:32 pm jobe wrote:
here it is..


mob/human
var/iconpick/=rand(1,7)
proc/IcoN()
if iconpick=1
icon = '1.dmi'
if iconpick=2
icon = '2.dmi'
if iconpick=3
icon = '3.dmi'
if iconpick=4
icon = '4.dmi'
if iconpick=5
icon = '5.dmi'
if iconpick=6
icon = '6.dmi'
if iconpick=7
icon = '7.dmi'

why is this not working?

Your "if" statements need to look like <nobr><code>if (iconpick == 1)</code></nobr>. Also, there is an extra / in the "var/iconpick =" statement. Another (slightly more efficient) way of doing the same thing would be:

proc/IcoN()
switch (iconpick)
if (1)
icon = '1.dmi'
if (2)
icon = '2.dmi'
if (3)
icon = '3.dmi'
if (4)
icon = '4.dmi'
if (5)
icon = '5.dmi'
if (6)
icon = '6.dmi'
if (7)
icon = '7.dmi'


Yet another way, completely getting rid of the iconpick variable, would be:

proc/IcoN()
icon = pick('2.dmi', '3.dmi', '4.dmi', '5.dmi', '6.dmi', '7.dmi')
In response to Air Mapster
On 5/16/01 4:40 pm Air Mapster wrote:
On 5/16/01 4:32 pm jobe wrote:
here it is..


mob/human
var/iconpick/=rand(1,7)
proc/IcoN()
if iconpick=1
icon = '1.dmi'
if iconpick=2
icon = '2.dmi'
if iconpick=3
icon = '3.dmi'
if iconpick=4
icon = '4.dmi'
if iconpick=5
icon = '5.dmi'
if iconpick=6
icon = '6.dmi'
if iconpick=7
icon = '7.dmi'

why is this not working?

Your "if" statements need to look like <nobr><code>if (iconpick == 1)</code></nobr>. Also, there is an extra / in the "var/iconpick =" statement. Another (slightly more efficient) way of doing the same thing would be:

proc/IcoN()
switch (iconpick)
if (1)
icon = '1.dmi'
if (2)
icon = '2.dmi'
if (3)
icon = '3.dmi'
if (4)
icon = '4.dmi'
if (5)
icon = '5.dmi'
if (6)
icon = '6.dmi'
if (7)
icon = '7.dmi'


Yet another way, completely getting rid of the iconpick variable, would be:

proc/IcoN()
icon = pick('2.dmi', '3.dmi', '4.dmi', '5.dmi', '6.dmi', '7.dmi')

thanks guys......