how do i check to if a player has too many of one item?
Code:
[TRIG 1751]
// TEST
ONTRIGGER=DCLICK
IF (<SRC.RESTEST 0xx77> < 6) && (<SRC.TARG.DISTANCE> < 2)
SRC.NEWITEM=0xx77
SRC.ACT.BOUNCE // put it in your pack.
RETURN 1
ELSE
SRC.SYSMESSAGE=You have too many that item or are too far away.
ENDIF
whats the right way to do this?
if you have more than 5 of item 0xx77
"you have too many of that item"
if you are too far away
"you are too far away"
know what im sayin?
thx
I don`t understand your question, because your function is working:
[itemdef teste]
defname=teste
id=i_robe
name= teste
// TEST
type=t_normal
ON=@DCLICK
IF (<SRC.RESTEST i_robe> < 1) && (<SRC.TARG.DISTANCE> < 2)
SRC.NEWITEM=i_robe
SRC.ACT.BOUNCE // put it in your pack.
RETURN 1
ELSE
SRC.SYSMESSAGE=You have too many that item or are too far away.
return 1
ENDIF
It seems that itis a 51a script
[TRIG 1751] <-- old code
// TEST
ONTRIGGER=DCLICK <-- old code
While I understand the frustration at the limited assistance available for the 51a the fact remains that this version is ancient and not officially supported.
There have been so many changes since 51a that anyone still around who has used (I am one who has) may not even necessarily remember much to do with it (Though im my case senility is equally likely)
We have a forum for the 51a emulator, as I know you are aware, so please do not bring 51a questions to the 56b section as it will only lead to confusion.
Moving thread to 51a forum
why don't you just restest for 5 items of that type and if its true then stop the trigger?
Code:
IF (<SRC.RESTEST 5 0xx77>)
will proc if u have 5, 50 or million
as long as no one brings up FUNCTION, alot of the syntax is still the same...
thats why it went in the 56b section
this is what i was getting at...
Code:
[TRIG 1751]
// TEST
ONTRIGGER=DCLICK
IF <SRC.RESTEST 5 07725>
SRC.SYSMESSAGE=You have too many grenades.
RETURN 1
ELSE
IF <SRC.TARG.DISTANCE>>2
SRC.SYSMESSAGE=You are too far away.
RETURN 1
ELSE
SRC.NEWITEM=07725
SRC.ACT.BOUNCE // put it in your pack.
RETURN 1
ENDIF
THANK YOU MULAMBO! =)