SphereCommunity
updated and improved addnpc command - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Submissions (/Forum-Script-Submissions)
+--- Thread: updated and improved addnpc command (/Thread-updated-and-improved-addnpc-command)



updated and improved addnpc command - Ankron - 02-09-2015 04:45 PM

Sphere gets a little confused with the old command and assumes that the command "ADD" doesn't exist when in fact it's the chardef that doesn't exist, this script fixes that minor confusion.

Code:
[FUNCTION addnpc]
IF (<ISNUM <ARGS>>)
    if <serv.chardef.<args>>
        ADD <ARGS>|08c000000
    else
        sysmessage @026 ERROR: Requested NPC is not defined
    endif
ELSEif <serv.chardef.<args>>
    ADD <ARGS>
else
    sysmessage @026 ERROR: Requested NPC is not defined
ENDIF