So I have been having issues with this code.
function VisoShopServer::findMember(%this,%string)
{
if(!isObject(%this)) return -1;
for(%i=0;%i<%this.memberCount + 1;%i++)
{
if(isObject(%string))
if(%string.getClassName() $= "ItemData")
if(%string.uiName $= %this.member[%i].uiName)
return %this.member[%i];
if(!isObject(%string))
if(strPos(%this.member[%i].uiName,%string) >= 0)
return %this.member[%i].getName();
}
if(getFieldCount(%members) <= 0)
return 0; //Client was never in this group
}
There are a few related weapons with their attached shop object.
Name: Modern Pistol ItemObj: ModernPistolItem ShopObj: VisoShopServItem_Pistols_Modern_Pistol
Name: Modern Pistols A. ItemObj: AkimboModernPistolItem ShopObj: VisoShopServItem_Pistols_Modern_Pistols_A
When I do
talk(VisoShop_ServSECGroup.findMem ber("Modern Pistol"));
This returns
==> VisoShopServItem_Pistols_Mode rn_Pistols_A
This means that it's returning the "Modern Pistols A."'s shop object for some reason, is there any way to fix this?
The VisoShopServItem_* is a script object that keeps an item's cached damage, cost, radius damage, description of the shop weapon, ui name, and the item data's name.
The shop objects are inside the VisoShopServer class.