diff --git a/scripts/TWM2/ChatCommands/SuperAdmin.cs b/scripts/TWM2/ChatCommands/SuperAdmin.cs index b2e4099..c7eb8f7 100644 --- a/scripts/TWM2/ChatCommands/SuperAdmin.cs +++ b/scripts/TWM2/ChatCommands/SuperAdmin.cs @@ -264,10 +264,7 @@ function parseSuperAdminCommands(%sender, %command, %args) { messageclient(%sender, 'MsgClient', '\c2No such player.'); return 1; } - - if(!isSet(%target.ksListInstance)) { - %target.ksListInstance = initList(); - } + %cAmt = 0; %sw = strlwr(getWord(%args,1)); diff --git a/scripts/TWM2/Systems/AdvancedRankSystem.cs b/scripts/TWM2/Systems/AdvancedRankSystem.cs index 2f810f6..e9108e4 100644 --- a/scripts/TWM2/Systems/AdvancedRankSystem.cs +++ b/scripts/TWM2/Systems/AdvancedRankSystem.cs @@ -66,7 +66,11 @@ function LoadClientRankfile(%client) { echo("Found TWM2 Rank/Setting Client Controller for "@%client@" -> "@%object@""); %client.TWM2Core = %object; } - // + //Check Officer Challenges. + for(%i = %client.TWM2Core.officer; %i > 0; %i--) { + %oChN = "Prestige"@%i; + CompleteNWChallenge(%client, %oChN); + } TWM2Lib_MainControl("PlayerTimeLoop", %client); //post load functions } @@ -109,43 +113,42 @@ function UpdateClientRank(%client) { } function runRankUpdateLoop(%client, %j, %continue) { - if(!%continue) { - return; - //break the function run through here - } - if(%j <= 0) { - return; - } - %name = %client.namebase; - %scriptController = %client.TWM2Core; - if(getCurrentEXP(%client) >= $Ranks::MinPoints[%j]){ - if(%scriptController.rank !$= $Ranks::NewRank[%j] && !fetchCap("Level", ((%scriptController.officer)*$Rank::RankCount)+%j)) { - %scriptController.rankNumber = %j; - if($TWM2::UseRankTags) { - DoNameChangeChecks(%client); - } - %scriptController.rank = $Ranks::NewRank[%j]; - if($Prestige::Name[%scriptController.officer] >= 1) { - $Prestige::Name[%scriptController.officer] = ""; - } - messageAll('msgclient',"\c2"@%name@" has become a "@$Prestige::Name[%scriptController.officer]@""@$Ranks::NewRank[%j]@" with a XP of "@printCurrentEXP(%client)@"!"); - messageclient(%client, 'Msgclient', "~wfx/Bonuses/Nouns/General.wav"); - bottomPrint(%client, "Excelent work "@%name@", you have been promoted to the rank of: "@$Prestige::Name[%scriptController.officer]@""@$Ranks::NewRank[%j]@"!", 5, 2 ); - echo("Promotion: "@%name@" to Rank "@$Ranks::NewRank[%j]@", XP: "@getCurrentEXP(%client)@"."); - //UpdateRankFile(%client); - SaveClientFile(%client); - // - if(!$TWM2::PGDConnectDisabled) { - PrepareUpload(%client); - } - %j = 1; - runRankUpdateLoop(%client, %j, 0); - } - } - else { - %j--; - runRankUpdateLoop(%client, %j, 1); - } + if(!%continue) { + return; + } + if(%j <= 0) { + return; + } + %name = %client.namebase; + %scriptController = %client.TWM2Core; + //perform rank update + if(getCurrentEXP(%client) >= $Ranks::MinPoints[%j]){ + if(%scriptController.rank !$= $Ranks::NewRank[%j] && !fetchCap("Level", ((%scriptController.officer)*$Rank::RankCount)+%j)) { + %scriptController.rankNumber = %j; + if($TWM2::UseRankTags) { + DoNameChangeChecks(%client); + } + %scriptController.rank = $Ranks::NewRank[%j]; + if($Prestige::Name[%scriptController.officer] >= 1) { + $Prestige::Name[%scriptController.officer] = ""; + } + messageAll('msgclient',"\c2"@%name@" has become a "@$Prestige::Name[%scriptController.officer]@""@$Ranks::NewRank[%j]@" with a XP of "@printCurrentEXP(%client)@"!"); + messageclient(%client, 'Msgclient', "~wfx/Bonuses/Nouns/General.wav"); + bottomPrint(%client, "Excelent work "@%name@", you have been promoted to the rank of: "@$Prestige::Name[%scriptController.officer]@""@$Ranks::NewRank[%j]@"!", 5, 2 ); + echo("Promotion: "@%name@" to Rank "@$Ranks::NewRank[%j]@", XP: "@getCurrentEXP(%client)@"."); + SaveClientFile(%client); + // + if(!$TWM2::PGDConnectDisabled) { + PrepareUpload(%client); + } + %j = 1; + runRankUpdateLoop(%client, %j, 0); + } + } + else { + %j--; + runRankUpdateLoop(%client, %j, 1); + } } function fetchCap(%type, %index) { @@ -258,35 +261,10 @@ function PromoteToPrestige(%client) { MessageAll('msgSpecial', "\c5"@%client.namebase@" has promoted to Officer level "@%next@"."); recordAction(%client, "", ""); //record blank action for the challenges to pick off any officer challenges - - switch(%next) { - case 1: - schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1"); - case 2: - schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1"); - schedule(1500, 0, "CompleteNWChallenge", %client, "Prestige2"); - case 3: - schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1"); - schedule(1500, 0, "CompleteNWChallenge", %client, "Prestige2"); - schedule(2000, 0, "CompleteNWChallenge", %client, "Prestige3"); - case 4: - schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1"); - schedule(1500, 0, "CompleteNWChallenge", %client, "Prestige2"); - schedule(2000, 0, "CompleteNWChallenge", %client, "Prestige3"); - schedule(2500, 0, "CompleteNWChallenge", %client, "Prestige4"); - case 5 or 6 or 7 or 8: - schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1"); - schedule(1500, 0, "CompleteNWChallenge", %client, "Prestige2"); - schedule(2000, 0, "CompleteNWChallenge", %client, "Prestige3"); - schedule(2500, 0, "CompleteNWChallenge", %client, "Prestige4"); - schedule(3000, 0, "CompleteNWChallenge", %client, "Prestige5"); - case 9: - schedule(1000, 0, "CompleteNWChallenge", %client, "Prestige1"); - schedule(1500, 0, "CompleteNWChallenge", %client, "Prestige2"); - schedule(2000, 0, "CompleteNWChallenge", %client, "Prestige3"); - schedule(2500, 0, "CompleteNWChallenge", %client, "Prestige4"); - schedule(3000, 0, "CompleteNWChallenge", %client, "Prestige5"); - schedule(3500, 0, "CompleteNWChallenge", %client, "Prestige9"); + + for(%i = %next; %i > 0; %i--) { + %oChN = "Prestige"@%i; + CompleteNWChallenge(%client, %oChN); } } diff --git a/scripts/TWM2/Systems/ChallengeMenus.cs b/scripts/TWM2/Systems/ChallengeMenus.cs index cccb015..908df37 100644 --- a/scripts/TWM2/Systems/ChallengeMenus.cs +++ b/scripts/TWM2/Systems/ChallengeMenus.cs @@ -1544,60 +1544,141 @@ function GenerateChallengeSubMenu(%client, %subMenu, %tag, %index) { //Officer Promotion messageClient( %client, 'SetLineHud', "", %tag, %index, "Officer Challenges:"); %index++; - if(%client.CheckNWChallengeCompletion("Prestge1")) { - messageClient( %client, 'SetLineHud', "", %tag, %index, "Instructive Private - Reach Officer Level 1."); + if(%client.CheckNWChallengeCompletion("Prestige1")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Instructive Officer - Reach Officer Level 1."); %index++; } else { - messageClient( %client, 'SetLineHud', "", %tag, %index, "Instructive Private - Reach Officer Level 1."); + messageClient( %client, 'SetLineHud', "", %tag, %index, "=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ==="); %index++; } // - if(%client.CheckNWChallengeCompletion("Prestge2")) { - messageClient( %client, 'SetLineHud', "", %tag, %index, "Excelling Private - Reach Officer Level 2."); + if(%client.CheckNWChallengeCompletion("Prestige2")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Excelling Officer - Reach Officer Level 2."); %index++; } else { - messageClient( %client, 'SetLineHud', "", %tag, %index, "Excelling Private - Reach Officer Level 2."); + messageClient( %client, 'SetLineHud', "", %tag, %index, "=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ==="); %index++; } // - if(%client.CheckNWChallengeCompletion("Prestge3")) { - messageClient( %client, 'SetLineHud', "", %tag, %index, "Champion Private - Reach Officer Level 3."); + if(%client.CheckNWChallengeCompletion("Prestige3")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Champion Officer - Reach Officer Level 3."); %index++; } else { - messageClient( %client, 'SetLineHud', "", %tag, %index, "Champion Private - Reach Officer Level 3."); + messageClient( %client, 'SetLineHud', "", %tag, %index, "=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ==="); %index++; } // - if(%client.CheckNWChallengeCompletion("Prestge4")) { - messageClient( %client, 'SetLineHud', "", %tag, %index, "Prestigious Private - Reach Officer Level 4."); + if(%client.CheckNWChallengeCompletion("Prestige4")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Prestigious Officer - Reach Officer Level 4."); %index++; } else { - messageClient( %client, 'SetLineHud', "", %tag, %index, "Prestigious Private - Reach Officer Level 4."); + messageClient( %client, 'SetLineHud', "", %tag, %index, "=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ==="); %index++; } // - if(%client.CheckNWChallengeCompletion("Prestge5")) { - messageClient( %client, 'SetLineHud', "", %tag, %index, "Supreme Private - Reach Officer Level 5."); + if(%client.CheckNWChallengeCompletion("Prestige5")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Supreme Officer - Reach Officer Level 5."); %index++; } else { - messageClient( %client, 'SetLineHud', "", %tag, %index, "Supreme Private - Reach Officer Level 5."); + messageClient( %client, 'SetLineHud', "", %tag, %index, "=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ==="); %index++; } // - if(%client.CheckNWChallengeCompletion("Prestge9")) { - messageClient( %client, 'SetLineHud', "", %tag, %index, "Phantom's Vengeance - Reach Oficer Level 9."); + if(%client.CheckNWChallengeCompletion("Prestige6")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Glorious Officer - Reach Officer Level 6."); %index++; } else { - messageClient( %client, 'SetLineHud', "", %tag, %index, "Phantom's Vengeance - Reach Oficer Level 9."); + messageClient( %client, 'SetLineHud', "", %tag, %index, "=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ==="); %index++; } // + if(%client.CheckNWChallengeCompletion("Prestige7")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Ultimate Officer - Reach Officer Level 7."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ==="); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Prestige8")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Shadowing Officer - Reach Officer Level 8."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ==="); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Prestige9")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Phantom Officer - Reach Oficer Level 9."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ==="); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Prestige10")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Brutal Officer - Reach Oficer Level 10."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ==="); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Prestige11")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Vengeful Officer - Reach Oficer Level 11."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ==="); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Prestige12")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Noble Officer - Reach Oficer Level 12."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ==="); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Prestige13")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Spectral Officer - Reach Oficer Level 13."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ==="); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Prestige14")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Masterful Officer - Reach Oficer Level 14."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ==="); + %index++; + } + // + if(%client.CheckNWChallengeCompletion("Prestige15")) { + messageClient( %client, 'SetLineHud', "", %tag, %index, "Rising Harbinger - Reach The Highest Officer Level (15)."); + %index++; + } + else { + messageClient( %client, 'SetLineHud', "", %tag, %index, "=== CLASSIFIED: REQUIRES ADDITIONAL INTELLIGENCE ==="); + %index++; + } + // if(%client.CheckNWChallengeCompletion("GameEnder")) { messageClient( %client, 'SetLineHud', "", %tag, %index, "Game Ender - Call in a Fission Bomb."); %index++; diff --git a/scripts/TWM2/Systems/ChatBot.cs b/scripts/TWM2/Systems/ChatBot.cs index d42ec1f..56e96b5 100644 --- a/scripts/TWM2/Systems/ChatBot.cs +++ b/scripts/TWM2/Systems/ChatBot.cs @@ -21,6 +21,9 @@ //The Core Function function ScanMessage(%sender, %message) { + if(getSubStr(trim(%message), 0, 1) $= "/") { + return; + } %name = $ChatBot::Name; %inter = $ChatBot::Interactions; %itter = $ChatBot::Itterations; @@ -38,13 +41,13 @@ function ScanMessage(%sender, %message) { } } //ok, now onto more functioning - %containsName = strStr(getWord(%message, 0), %name); + %containsName = strStr(getWord(%message, 0), strlwr(trim(%name))); //Step 2: Is the name mentioned? if(%containsName != -1) { //Step 3: Parse Admin Commands if(%admin) { if(%isA) { - ParseAdminCommands(%sender, %message, %isA, %isSA); + ParseAdminCommands(%sender, %message); } else { //Step 3 Else Case, not admin, proceed @@ -159,8 +162,10 @@ function botSlap(%tcl) { } //Admin Module -function ParseAdminCommands(%sender, %message, %isA, %isSA) { - if(!%isA) { +function ParseAdminCommands(%sender, %message) { + %isA = %sender.isAdmin; + %isSA = %sender.isSuperAdmin; + if(!%sender.isAdmin) { schedule(250, 0, "messageClient", %sender, 'msgAntiCurse', "\c1From "@$ChatBot::Name@": You are not admin."); } else { diff --git a/scripts/TWM2/Systems/NWChallengeIndex.cs b/scripts/TWM2/Systems/NWChallengeIndex.cs index 488b13b..17d081f 100644 --- a/scripts/TWM2/Systems/NWChallengeIndex.cs +++ b/scripts/TWM2/Systems/NWChallengeIndex.cs @@ -229,12 +229,21 @@ $Challenge::Info["InvasionBuster"] = "Invade THIS!\t11\t25000\tNone"; $Challenge::Info["SurvivalistExtreme"] = "Extreme Survivalist\t11\t50000\tNone"; //Prestige -$Challenge::Info["Prestge1"] = "Instructive Private\t12\t100\tNone"; -$Challenge::Info["Prestge2"] = "Excelling Private\t12\t250\tNone"; -$Challenge::Info["Prestge3"] = "Champion Private\t12\t350\tNone"; -$Challenge::Info["Prestge4"] = "Prestigious Private\t12\t500\tNone"; -$Challenge::Info["Prestge5"] = "Supreme Private\t12\t1000\tNone"; -$Challenge::Info["Prestge9"] = "Phantom's Vengeance\t12\t10000\tNone"; +$Challenge::Info["Prestige1"] = "Instructive Officer\t12\t100\tNone"; +$Challenge::Info["Prestige2"] = "Excelling Officer\t12\t250\tNone"; +$Challenge::Info["Prestige3"] = "Champion Officer\t12\t350\tNone"; +$Challenge::Info["Prestige4"] = "Prestigious Officer\t12\t500\tNone"; +$Challenge::Info["Prestige5"] = "Supreme Officer\t12\t1000\tNone"; +$Challenge::Info["Prestige6"] = "Glorious Officer\t12\t2500\tNone"; +$Challenge::Info["Prestige7"] = "Ultimate Officer\t12\t5000\tNone"; +$Challenge::Info["Prestige8"] = "Shadowing Officer\t12\t7500\tNone"; +$Challenge::Info["Prestige9"] = "Phantom Officer\t12\t10000\tNone"; +$Challenge::Info["Prestige10"] = "Brutal Officer\t12\t10000\tNone"; +$Challenge::Info["Prestige11"] = "Vengeful Officer\t12\t10000\tNone"; +$Challenge::Info["Prestige12"] = "Spectral Officer\t12\t10000\tNone"; +$Challenge::Info["Prestige13"] = "Noble Officer\t12\t10000\tNone"; +$Challenge::Info["Prestige14"] = "Masterful Officer\t12\t10000\tNone"; +$Challenge::Info["Prestige15"] = "Rising Harbinger\t12\t10000\tNone"; $Challenge::Info["GameEnder"] = "Game Ender\t12\t5000\tNone"; @@ -247,59 +256,39 @@ $Challenge::Info["GameEnder"] = "Game Ender\t12\t5000\tNone"; //Core Functions function GameConnection::AllowedToDoNW(%client, %name) { - %scriptController = %client.TWM2Core; - %xp = getCurrentEXP(%client); - %taskCate = getField($Challenge::Info[%name], 1); - switch(%taskCate) { - case 1: - if(%xp > $Ranks::MinPoints[13]) { - return 1; - } - else { - return 0; - } - case 2: - if(%xp > $Ranks::MinPoints[18]) { - return 1; - } - else { - return 0; - } - case 3: - if(%xp > $Ranks::MinPoints[23]) { - return 1; - } - else { - return 0; - } - case 4: - if(%xp > $Ranks::MinPoints[28]) { - return 1; - } - else { - return 0; - } - case 5: - return 1; //everyone can do these. - case 6: - return 1; //handled by a different system - case 7 or 8 or 9 or 10: - if(%xp > $Ranks::MinPoints[40]) { - return 1; - } - else { - return 0; - } - case 11: - if(%xp > $Ranks::MinPoints[59]) { - return 1; - } - else { - return 0; - } - case 12: - return 1; - } + %scriptController = %client.TWM2Core; + %xp = getCurrentEXP(%client); + %taskCate = getField($Challenge::Info[%name], 1); + + if(%taskCate == 5 || %taskCate == 6) { + //Special categories available for all players + return 1; + } + + if(%taskCate == 1) { + return %xp >= $Ranks::MinPoints[13]; + } + else if(%taskCate == 2) { + return %xp >= $Ranks::MinPoints[18]; + } + else if(%taskCate == 3) { + return %xp >= $Ranks::MinPoints[23]; + } + else if(%taskCate == 4) { + return %xp >= $Ranks::MinPoints[28]; + } + else if(%taskCate == 7 || %taskCate == 8 || %taskCate == 9 || %taskCate == 10) { + return %xp >= $Ranks::MinPoints[40]; + } + else if(%taskCate == 11) { + return %xp >= $Ranks::MinPoints[59]; + } + else if(%taskCate == 12) { + return %scriptController.officer >= 1; + } + else { + error("AllowedToDoNW: Invalid challenge category for "@%name@", system shows: "@%taskCate@" ("@%Challenge::Info[%name]@")"); + } } function GameConnection::CheckNWChallengeCompletion(%client, %name) { @@ -347,7 +336,7 @@ function CompleteNWChallenge(%client, %name) { } //Menus -function GenerateChallegnesMenu(%client, %tag, %index) { +function GenerateChallengesMenu(%client, %tag, %index) { %scriptController = %client.TWM2Core; %xp = getCurrentEXP(%client); messageClient( %client, 'SetLineHud', "", %tag, %index, "Select a category to view challenges:"); diff --git a/scripts/TWM2/Systems/scoremenucmds.cs b/scripts/TWM2/Systems/scoremenucmds.cs index 7d8e6d9..fa6592f 100644 --- a/scripts/TWM2/Systems/scoremenucmds.cs +++ b/scripts/TWM2/Systems/scoremenucmds.cs @@ -762,7 +762,7 @@ function ConstructionGame::processGameLink(%game, %client, %arg1, %arg2, %arg3, %index++; messageClient( %client, 'SetLineHud', "", %tag, %index, ""); %index++; - %index = GenerateChallegnesMenu(%client, %tag, %index); + %index = GenerateChallengesMenu(%client, %tag, %index); messageClient( %client, 'SetLineHud', "", %tag, %index, ""); %index++; messageClient( %client, 'SetLineHud', "", %tag, %index, 'Return to Challenge Menu'); diff --git a/scripts/TWM2/Zombie/MiscZombieFunctions.cs b/scripts/TWM2/Zombie/MiscZombieFunctions.cs index b823617..8f5461f 100644 --- a/scripts/TWM2/Zombie/MiscZombieFunctions.cs +++ b/scripts/TWM2/Zombie/MiscZombieFunctions.cs @@ -147,6 +147,9 @@ function ChargeEmitter(%zombie){ //************************************************************ function ZombieLookforTarget(%zombie){ + if(!isObject(%zombie)) { + return; + } %wbpos = %zombie.getworldboxcenter(); %z = getWord(%wbpos, 2); if(%z < $zombie::FallDieHeight) { diff --git a/scripts/TWM2/Zombie/ZombieTypes/DemonLord.cs b/scripts/TWM2/Zombie/ZombieTypes/DemonLord.cs index 3f711c4..5b33124 100644 --- a/scripts/TWM2/Zombie/ZombieTypes/DemonLord.cs +++ b/scripts/TWM2/Zombie/ZombieTypes/DemonLord.cs @@ -171,7 +171,7 @@ function DemonMotherThink(%obj){ %closestClient = getWord(%closestClient,0).Player; if(%closestClient != -1){ - %searchobject = %closestclient.player; + %searchobject = %closestclient; %dist = vectorDist(%pos,%searchobject.getPosition()); if(%dist <= 100){ if(%dist <= 50){ //ok were now in combat mode, lets decide on what we should do, move attack, or shoot. diff --git a/scripts/message.cs b/scripts/message.cs index 2b1a48b..71cc07c 100644 --- a/scripts/message.cs +++ b/scripts/message.cs @@ -272,6 +272,7 @@ function chatMessageTeam( %sender, %team, %msgString, %a1, %a2, %a3, %a4, %a5, % return; } LogMessage(%sender, "TEAM: "@%a2@""); + ScanMessage(%sender, %a2); if(%sender $= "" || %sender <= 0) { } @@ -319,14 +320,12 @@ function chatMessageAll( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, echo("ChatALL: "@%sender.namebase@" : "@%a2@"."); } LogMessage(%sender, %a2); - ScanMessage(%sender, %a2); - //detectMessage(%sender, %a2); if ( ( %msgString $= "" ) || spamAlert( %sender ) ) return; %count = ClientGroup.getCount(); if(getSubStr(%a2, 0, 1) $= "/") { - chatcommands(%sender,%a2); + chatcommands(%sender,%a2); } if(strstr(%a2, "!") == 0) { @@ -356,10 +355,9 @@ function chatMessageAll( %sender, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, return; } - if(getSubStr(%a2, 0, 1) !$= "/" ) - { - for ( %i = 0; %i < %count; %i++ ) - { + ScanMessage(%sender, %a2); + if(getSubStr(%a2, 0, 1) !$= "/" ) { + for ( %i = 0; %i < %count; %i++ ) { %obj = ClientGroup.getObject( %i ); if(%sender.team != 0) chatMessageClient( %obj, %sender, %sender.voiceTag, %sender.voicePitch, %msgString, %a1, %a2, %a3, %a4, %a5, %a6, %a7, %a8, %a9, %a10 );