Initial Upload
Initial Upload
This commit is contained in:
41
_module/nss/mail_hasnomb.nss
Normal file
41
_module/nss/mail_hasnomb.nss
Normal file
@@ -0,0 +1,41 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Mail - Has No Mailbox
|
||||
//:: mail_hasnomb.nss
|
||||
//:: Copyright (c) 2003 Jake E. Fitch
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Determines if the character has a mailbox and if so returns False.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Jake E. Fitch (Milambus Mandragon)
|
||||
//:: Created On: Jan. 6, 2004
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "mail_include"
|
||||
|
||||
int StartingConditional()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
object oMailman = GetNearestObjectByTag("Mailman", oPC);
|
||||
|
||||
int iTotalMB = GetCampaignInt(DBName, "LastMailbox");
|
||||
int iCounter;
|
||||
|
||||
// If its already been determined, no need to go through the mailboxes again.
|
||||
if (GetLocalInt(oMailman, "mail_Mailbox") > 0) return FALSE;
|
||||
|
||||
// Go through each mailbox comparing its owners name and cd key to the current character.
|
||||
for (iCounter = 0; iCounter <= iTotalMB; iCounter++) {
|
||||
int iNameMatch = (GetName(oPC) == GetCampaignString(DBName, "MBOwner" + IntToString(iCounter)));
|
||||
int iCDMatch = TRUE;
|
||||
|
||||
if (CDKeyCheck) iCDMatch = (GetPCPublicCDKey(oPC) == GetCampaignString(DBName, "MBCDKey" + IntToString(iCounter)));
|
||||
|
||||
if (iNameMatch && iCDMatch) {
|
||||
SetLocalInt(oMailman, "mail_Mailbox", iCounter);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
Reference in New Issue
Block a user