SphereCommunity
problem.. - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: problem.. (/Thread-problem--3222)



problem.. - Pidrila - 02-07-2014 06:25 PM

whats the problem in here??

Code:
IF (<src.tag.factioncolor>=1)
src.tag.colornamefaction = blue
elif (<src.tag.factioncolor>=2)
src.tag.colornamefaction = red
elif (<src.tag.factioncolor>=3)
src.tag.colornamefaction = yellow
endif

i get an error
10:24:ERROR:(status.scp,25)Undefined symbol ''
10:24:ERROR:(status.scp,27)Undefined symbol ''
10:24:ERROR:(status.scp,29)Undefined symbol ''


RE: problem.. - pinku - 02-07-2014 07:14 PM

Can you try...

IF (<src.tag0.factioncolor>=1)
src.tag.colornamefaction = blue
elif (<src.tag0.factioncolor>=2)
src.tag.colornamefaction = red
elif (<src.tag0.factioncolor>=3)
src.tag.colornamefaction = yellow
endif


RE: problem.. - darksun84 - 02-07-2014 07:46 PM

also == not = in the if Ranting


RE: problem.. - Pidrila - 02-07-2014 10:27 PM

I also tried this == but i get error..

Sent from my PAP4055DUO using Tapatalk


RE: problem.. - Shidhun - 02-07-2014 10:53 PM

tag.factioncolor = 01 --> it is 1
tag.factioncolor = 02 --> it is 2
tag.factioncolor = 04 --> it is 3

you are checking a hex-value agains a decimal-value


RE: problem.. - Pidrila - 02-07-2014 11:12 PM

okey resolved with tag0.

thanks Pinku


RE: problem.. - Alaric - 02-08-2014 04:05 AM

(02-07-2014 10:53 PM)Shidhun Wrote:  tag.factioncolor = 01 --> it is 1
tag.factioncolor = 02 --> it is 2
tag.factioncolor = 04 --> it is 3

you are checking a hex-value agains a decimal-value
in if statements value should be evaluated.


RE: problem.. - pinku - 02-08-2014 06:53 AM

(02-07-2014 11:12 PM)Pidrila Wrote:  okey resolved with tag0.

thanks Pinku

You're welcome!
Had the same problem before! Tongue

I got here this simple explanation why this happens, Coruja wrote it a while ago on my thread.

(08-04-2013 10:50 AM)Coruja Wrote:  if the <SRC.ACCOUNT.TAG.VOTE> doesn't exists it will return a null value, so the sphere will read the script like this !( == 1) instead !(0 == 1)
to avoid it you must use TAG0 instead of TAG, because TAG0 automatically returns a 0 value if the tag is empty