Page 1 of 1

Command script help please

Posted: Tue Mar 28, 2006 1:19 am
by Mephisto
I'm working on a few new dotcommands that I want to only affect warriors/henchmen following a player. I'm using the sanctuary scripts as a base. As I said, I want this to be a player command, that will only affect their personal henchmen/warriors. Any suggestions? please post here, or priv. msg me. Thanks

Posted: Tue Mar 28, 2006 1:30 am
by DevGIB

Code: Select all

//targets henchman
var target := target(who);
if(getobjproperty(target, "masterserial") == who.serial)
...
else
sendsysmessage(who, "This is not your henchmen.");
endif
havent done anything with the sanc scripts so im not really sure how they set everything up... i can only presume thats how it would be done :)

Posted: Tue Mar 28, 2006 6:59 pm
by Tritan
The only thing that would have to be changed is:

Code: Select all

GetObjProperty (me, "master");
That property stores their masters serial number on them.

Posted: Wed Mar 29, 2006 2:40 am
by XtehseA
something along the lings of what GIB said will work, i aswell havent used sanc scripts before and GIB knows alot more about escript then i do but im pretty sure around what he said will help.

Posted: Wed Mar 29, 2006 4:11 am
by Tritan
I am currently using a modified or tweaked version of those scripts. What DevGib has will work with the one modification I posted. The property has to be called out correctly.

So your code would be this.

Code: Select all

//targets henchman
var target := target(who);
if(getobjproperty(target, "master") == who.serial)
...<execute code for command here>...
else
sendsysmessage(who, "This is not your henchmen.");
endif
There are other ways to do this also but it really depends on what you are wanting these commands to do. Feel free to PM me on these boards if you need more help with this.

Posted: Fri Mar 31, 2006 10:26 pm
by Mephisto
I'll have to get back to you Tritan, I've been busy with work, thus have not had much time to play with the new commands I'm working on... Thanks for the info everyone :P