Initial Upload
Initial Upload
This commit is contained in:
36
_module/nss/sf_cdkeydb.nss
Normal file
36
_module/nss/sf_cdkeydb.nss
Normal file
@@ -0,0 +1,36 @@
|
||||
const string DB_ACT = "LOD_CDKEYS";
|
||||
|
||||
void Main()
|
||||
{
|
||||
object oPC = OBJECT_SELF;
|
||||
string sKey = GetPCPublicCDKey(oPC);
|
||||
string sActName = GetPCPlayerName(oPC);
|
||||
|
||||
string sKey1 = sKey + "_1";
|
||||
string sKey2 = sKey + "_2";
|
||||
string sKey3 = sKey + "_3";
|
||||
|
||||
if(GetIsDM(oPC)) return;
|
||||
|
||||
if (GetCampaignString(DB_ACT, sKey1) == sActName) return;
|
||||
else if (GetCampaignString(DB_ACT, sKey2) == sActName) return;
|
||||
else if (GetCampaignString(DB_ACT, sKey3) == sActName) return;
|
||||
|
||||
if (GetCampaignString(DB_ACT, sKey1) == "")
|
||||
{
|
||||
SetCampaignString(DB_ACT, sKey1, sActName);
|
||||
}
|
||||
else if (GetCampaignString(DB_ACT, sKey2) == "")
|
||||
{
|
||||
SetCampaignString(DB_ACT, sKey2, sActName);
|
||||
}
|
||||
else if (GetCampaignString(DB_ACT, sKey3) == "")
|
||||
{
|
||||
SetCampaignString(DB_ACT, sKey3, sActName);
|
||||
}
|
||||
else
|
||||
{
|
||||
SendMessageToPC(oPC, "Your CD Key has too many accounts on this server, please use a previously registered account to play.");
|
||||
DelayCommand(40.0, BootPC(oPC));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user