SphereCommunity
Unidentified Symbol: - Printable Version

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



Unidentified Symbol: - Mordaunt - 10-16-2012 12:55 PM

I have been trouble shooting this for a couple of hours and it won't go away,
I get the error Undefined symbol ''
Based on this section of my script:

Code:
[FUNCTION acc_is_owner]
for <src.account.chars>
    if (<account.char.<eval <local._for>-1>.is_owner>)
        return 1
    endif
endfor
return 0

specifically the if (<account.char.<eval <local._for>-1>.is_owner>) line.

There is nothing wrong with this function it runs perfectly everywhere else in the script when it is called where the player is src (and it is called a lot!)

It is causing the error ONLY WHEN CALLED BY THIS EVENT where the player is default rather than src
Code:
ON=@ItemDClick
    if !(strcmpi(*<strarg <act.name>>*, *Recovery*)) || (<act.defname>==<def.vendor_deed_id>)
        if <QVAL (<def.account_ownership>)? (<I.is_owner>) || (<I.acc_is_owner>):(<I.is_owner>)> || (<I.is_coowner>) || (<I.is_friend>)
            obj=<region.tag0.sign>
            if (<obj.dtag0.vendors> < <obj.dtag0.max_vendors>)
                obj.tag0.vendors += 1
                return 0
            else
                sysmessage @,,1 You have no available vendor slots
                sysmessage @,,1 You must remove an existing vendor before you can place a new one.
                return 1
            endif
        else
                sysmessage @,,1 Only people on the house list may place vendors here
                return 1
        endif
endif

Looking for a fresh pair of eyes here to see if anyone can see what I am missing.


RE: Unidentified Symbol: - Extreme - 10-16-2012 02:00 PM

PHP Code:
[FUNCTION acc_is_owner]
for 
<account.chars>
    if (<
account.char.<eval <local._for>-1>.is_owner>)
        return 
1
    
endif
endfor
return 




RE: Unidentified Symbol: - Mordaunt - 10-16-2012 11:15 PM

As I said last night...

That does not fix it.

The problem is coming from the fact that I am calling the function when the player is default rather than src.
The function works fine as is. Even changing to how you wrote it the error remains.

The whole script actually does everything it is supposed to do despite the error


RE: Unidentified Symbol: - ShiryuX - 10-17-2012 01:17 AM

Try to read the account as serv instead of using the char.


RE: Unidentified Symbol: - RanXerox - 10-17-2012 01:18 AM

Here is a thought. Rewrite it to be able to function on an object, as in: SRC.acc_is_owner
...and be able to accept an argument to act on, as in: acc_is_owner <SRC>
Then in the code itself, use TRYSRC <ARGN> or whatever to make your other case work.


RE: Unidentified Symbol: - Mordaunt - 10-17-2012 03:29 AM

Tried your method last night ShiryuX, produced a whole load of errors.

Looking at your suggestions RanXerox, but not fully grasping what you mean.


Okay....

ShiryuX has shown me the error of my ways Tongue