1616-- Subversion Repository: http://mangadmin.googlecode.com/svn/
1717--
1818---- ---------------------------------------------------------------------------------------------------------
19-
20- function DisplayAccountLevel ()
21- MangAdmin :ChatMsg (" .account" )
22- MangAdmin :LogAction (Locale [" ma_displayleveloutput" ])
23- end
19+ -- Generic Command Template
20+ --[[
21+ [COMMAND_NAME_KEY] = {
22+ [GENERICS_isValueNeeded] = false|true,
23+ [GENERICS_isParametersNeeded] = false|true,
24+ [GENERICS_command] = "command",
25+ [GENERICS_message] = "messageID"
26+ }
27+ ]]
28+
29+ GM_genericCommands = {
30+ [GENERICS_parametersGet ] = function () return ma_gmParametersInput :GetText () end ,
31+ [GM_displayAccountGMLevel ] = {
32+ [GENERICS_command ] = " .account" ,
33+ [GENERICS_message ] = " ma_displayleveloutput"
34+ },
35+ [GM_flyMode ] = {
36+ [GENERICS_isValueNeeded ] = true ,
37+ [GENERICS_command ] = " .gm fly " ,
38+ [GENERICS_message ] = " ma_FlyOnoutput"
39+ },
40+ [GM_godMode ] = {
41+ [GENERICS_isValueNeeded ] = true ,
42+ [GENERICS_command ] = " .cheat god " ,
43+ [GENERICS_message ] = " ma_GodOnoutput"
44+ },
45+ [GM_acceptWhispers ] = {
46+ [GENERICS_isValueNeeded ] = true ,
47+ [GENERICS_command ] = " .whispers " ,
48+ [GENERICS_message ] = " ma_WhisperOnoutput"
49+ },
50+ [GM_visibility ] = {
51+ [GENERICS_isValueNeeded ] = true ,
52+ [GENERICS_command ] = " .gm visible " ,
53+ [GENERICS_message ] = " ma_InvisOnoutput"
54+ }
55+ }
2456
2557function ToggleGMMode (value )
2658 MangAdmin :ChatMsg (" .gm " .. value )
2759 MangAdmin :ChatMsg (" .gm chat " .. value )
28- MangAdmin :LogAction (Locale [" ma_GMOnoutput" ] .. value )
29- end
30-
31- function ToggleFlyMode (value )
32- MangAdmin :ChatMsg (" .gm fly " .. value )
33- MangAdmin :LogAction (Locale [" ma_FlyOnoutput" ] .. value )
34- end
35-
36- function ToggleGodMode (value )
37- MangAdmin :ChatMsg (" .cheat god " .. value )
38- MangAdmin :LogAction (Locale [" ma_GodOnoutput" ] .. value )
39- end
40-
41- function ToggleWhisper (value )
42- MangAdmin :ChatMsg (" .whispers " .. value )
43- MangAdmin :LogAction (Locale [" ma_WhisperOnoutput" ] .. value )
44- end
45-
46- function ToggleVisible (value )
47- MangAdmin :ChatMsg (" .gm visible " .. value )
48- MangAdmin :LogAction (Locale [" ma_InvisOnoutput" ] .. value )
60+ MangAdmin :LogAction (genericLogGenerator (" ma_GMOnoutput" ,value ))
4961end
5062
5163function ToggleTaxicheat (value )
52- if commandTargetCheck (COMMAND_TARGET_PLAYERS_SELF_ONLY ) then
64+ if commandTargetCheck () then
5365 MangAdmin :ChatMsg (" .cheat taxi " .. value )
5466 MangAdmin :LogAction (
5567 (value == " on" and Locale [" genericEnabledText" ] or Locale [" genericDisabledText" ]) ..
@@ -61,7 +73,7 @@ function ToggleTaxicheat(value)
6173end
6274
6375function ToggleMaps (value )
64- if commandTargetCheck (COMMAND_TARGET_PLAYERS_SELF_ONLY ) then
76+ if commandTargetCheck () then
6577 MangAdmin :ChatMsg (" .cheat explore " .. value )
6678 MangAdmin :LogAction (
6779 (value == 1 and Locale [" genericEnabledText" ] or Locale [" genericDisabledText" ]) ..
@@ -73,7 +85,7 @@ function ToggleMaps(value)
7385end
7486
7587function ToggleWaterwalk (value )
76- if commandTargetCheck (COMMAND_TARGET_PLAYERS_SELF_ONLY ) then
88+ if commandTargetCheck () then
7789 MangAdmin :ChatMsg (" .cheat waterwalk " .. value )
7890 MangAdmin :LogAction (
7991 (value == " on" and Locale [" genericEnabledText" ] or Locale [" genericDisabledText" ]) ..
419431
420432function SetSpeed ()
421433 local value = string.format (" %.1f" , ma_speedslider :GetValue ())
422- if commandTargetCheck (COMMAND_TARGET_PLAYERS_SELF_ONLY ) then
434+ if commandTargetCheck () then
423435 MangAdmin :ChatMsg (" .modify speed " .. value )
424436 MangAdmin :LogAction (getCommandTargetName () .. Locale [" ma_gmSpeedOutput" ] .. value )
425437 else
430442
431443function SetScale ()
432444 local value = string.format (" %.1f" , ma_scaleslider :GetValue ())
433- if commandTargetCheck (COMMAND_TARGET_PLAYERS_SELF_ONLY ) then
445+ if commandTargetCheck () then
434446 MangAdmin :ChatMsg (" .modify scale " .. value )
435447 MangAdmin :LogAction (getCommandTargetName () .. Locale [" ma_gmScaleOutput" ] .. value )
436448 else
0 commit comments