Ok, so I'm having some difficulties.
I have two edits....ish..
I have a bankstone and I am trying to make it so I can set the owner, and only he or a staff member can open that bank stone, while if there is no owner set, anyone can open the bankstone...
Here are my two scripts...
setowner.src: Needs to set a property on the bank with the same value as the owners name.
Code:
use uo;
program textcmd_setowner( who, text )
SendSysMessage( who, "Target the bank stone" );
var bankstone := TargetCoordinates( who );
SendSysMessage( who, "Target the new owner" );
var newowner := TargetCoordinates( who );
SetObjProperty(bankstone, "owner", newowner.name);
SendSysMessage( who, "New owner set!" );
endprogram
bankstone.src: needs to look for an owner, if it has one, block everyone else's access except the owner and staff. If it doesn't allow everyone access
Code:
var owner := GetObjProperty(item, "owner");
if (owner && owner != who.name && who.cmdlevel < 2 )
SendSysMessage( who, "This is not your bankstone!" );
return;
endif
That is at the beginning of the function, if someone can get past this they can open the bank, if they can't it tells them This is not your bankstone! and ends the script...
My problem is that at the moment everyone can open it, weather it has an owner set or not..
Any issues that are obvious?