const int MAX_PLAYERS = 32;
int SlotReserv(object oPC) { int nPlayers = 0, nDMs = 0;
object oPlayer = GetFirstPC(); while(oPlayer != OBJECT_INVALID) { if(GetIsDM(oPlayer)) nDMs++; else nPlayers++;
oPlayer = GetNextPC(); }
if((nPlayers > MAX_PLAYERS + nDMs) && !GetIsDM(oPC)) { SendMessageToPC(oPC, "Ñâîáîäíûõ ìåñò íåò."); BootPC(oPC); return 1; } return 0; } void AccCheck(object oPC, string sPC) { int nAccessLvl; int nRow = 0; string sAccessLvl, szData, sComment; do { szData = Get2DAString("accounts", "account", nRow); nRow++; } while((szData!="")&&(szData!=sPC)); nRow--;
if(szData==sPC) {
sAccessLvl = Get2DAString("accounts", "access", nRow); sComment = Get2DAString("accounts", "comment", nRow);
if(sAccessLvl == "") nAccessLvl = 1; else nAccessLvl = StringToInt(sAccessLvl);
if (nAccessLvl==3) { if (!GetIsDM(oPC)) SendMessageToAllDMs(szData+" -- Mega VIP Player Entering"); else SendMessageToAllDMs(szData+" -- Mega VIP DM Entering"); }
else if (nAccessLvl==2) { SendMessageToAllDMs(szData+" -- VIP Player Entering"); if (!GetIsDM(oPC)) { SendMessageToAllDMs(szData+" -- Ups! Is it Player?! BOOT-BOOT-BOOT!"); BootPC(oPC); DelayCommand(3.0, BootPC(oPC)); DelayCommand(6.0, BootPC(oPC)); } }
else if (nAccessLvl==1) { SendMessageToAllDMs(szData+" -- Player Entering"); if (GetIsDM(oPC)) { SendMessageToAllDMs(szData+" -- Ups! Is it DM?! BOOT-BOOT-BOOT!"); BootPC(oPC); DelayCommand(3.0, BootPC(oPC)); DelayCommand(6.0, BootPC(oPC)); } } else { SendMessageToAllDMs(sPC+" -- Îòïðàâëåí â áóòèê!"); SendMessageToAllDMs("Ïðè÷èíà: "+sComment); BootPC(oPC); DelayCommand(3.0, BootPC(oPC)); DelayCommand(6.0, BootPC(oPC)); } } else { SendMessageToAllDMs(sPC+" -- Îòïðàâëåí â áóòèê!"); SendMessageToAllDMs("Ïðè÷èíà: àêêàóíò íå íàéäåí â ñïèñêå."); BootPC(oPC); DelayCommand(3.0, BootPC(oPC)); DelayCommand(6.0, BootPC(oPC)); } if (sComment!="") SendMessageToAllDMs("Êîìåíòàðèé: "+sComment);
//DelayCommand(2.0f, BootPC(oPC)); // not found or banned. }
void SecBegin(object oPlayer) { string sAccountDatabase = GetPCPlayerName(oPlayer);
AccCheck(oPlayer,sAccountDatabase); // not finished yet. if(GetIsDM(oPlayer)) return; SlotReserv(oPlayer);
if (GetCampaignString(sAccountDatabase, "PublicCDKey") == "") SetCampaignString(sAccountDatabase, "PublicCDKey", "FFFFFFFF");
string sCDKey = GetPCPublicCDKey(oPlayer); string sIP = GetPCIPAddress(oPlayer);
string sDefendedCD = GetCampaignString(sAccountDatabase, "PublicCDKey"); string sDefendedIP = GetCampaignString(sAccountDatabase, "PlayerIPAddress");
if(sDefendedCD == "FFFFFFF" && sDefendedIP == "") SendMessageToPC(oPlayer, "Âàø àêêàóíò íå çàùèùåí!");
if(sDefendedCD != "FFFFFFFF") { if(sDefendedCD != sCDKey) { DelayCommand(2.0f, WriteTimestampedLogEntry("Attemption to hak: '" + GetName(oPlayer) + "' (" + GetPCPlayerName(oPlayer) + "), public CD key part: '" + sCDKey + "', IP address: '" + GetPCIPAddress(oPlayer) + "'")); DelayCommand(2.5f, BootPC(oPlayer)); DelayCommand(3.0f, BootPC(oPlayer)); } else { SendMessageToPC(oPlayer, "CD-key ïðîâåðåí."); } }
if(sDefendedIP != "") { if(sIP != sDefendedIP) { DelayCommand(2.0f, WriteTimestampedLogEntry("Attemption to hak(ip invalid): '" + GetName(oPlayer) + "' (" + GetPCPlayerName(oPlayer) + "), public CD key part: '" + sCDKey + "', IP address: '" + GetPCIPAddress(oPlayer) + "'")); DelayCommand(2.5f, BootPC(oPlayer)); DelayCommand(3.0f, BootPC(oPlayer)); } else { SendMessageToPC(oPlayer, "IP ïðîâåðåí."); } } }
//void main(){} |