MOH Central

Medal of Honor Series Forum => MOHAA Series: General => Topic started by: wcSki on January 22, 2006, 07:50:39 PM

Title: Admin Pro 1.22
Post by: wcSki on January 22, 2006, 07:50:39 PM
I have a couple of question about Admin Pro.

   

   

   1st... how can I turn the volume down of the spectate music when I turn that on... it seems very loud. I would like to use it... but I want it softer.

   

   2nd... the cvar settings?? How would I set those up?? I want use this so I can capture common hacks... do you have any suggestions?? I do not want to force skins on anyone... but I would like to use it to stop known hacks.

   

   Hope you understand.

   

   Thanks,

   Ski
Title: Admin Pro 1.22
Post by: Elgan {sfx} on January 22, 2006, 08:22:25 PM
1 cant, will add this option

   

   2. just add cvars, it cant detect cvars, just force them.
Title: Admin Pro 1.22
Post by: wcSki on January 22, 2006, 08:55:08 PM
Elgan,

   

   I guess what I am asking for #2 is... what cvars should I add to achieve my goal?? I am new to all this and I am not sure which ones I should put in. Can you give me some idea's?

   

   Thanks,

   Ski
Title: Admin Pro 1.22
Post by: Elgan {sfx} on January 22, 2006, 09:12:48 PM
i wouldnt bother tbh, some do, so i added it.  if a cheater really wants to cheat, they can get past any script/scanner.
Title: Admin Pro 1.22
Post by: wcSki on January 25, 2006, 01:26:50 AM
Hey Elgan... I have another question. Is it possible to swap the secondary weapons?? I would like to swap out the standard team pistols and give them a silence pistol instead. How can this be done??? Looking at the weapons limiter file you can only take them away... is there a way to replace the standard pistol with the silence pistol like you do with the beginning of survivor.

   

   Thanks,

   Ski
Title: Admin Pro 1.22
Post by: habsey on January 25, 2006, 04:15:48 AM
ok this is possible a couple ways.

   

   You can do it in your state file under the raise state by adding give "models/weapons/silenced_pistol.tik"

   

   or you could do a script like this

   

   

   
   while (1)
   {
   take "models/weapons/colt45.tik"
   take "models/weapons/german_pistol.tik" //make sure to change this cant remember the correct .tik file name
   give "models/weapons/silenced_pistol.tik" //make sure to change this cant remember the correct .tik file name
   wait 3
   }
   end
   

   and to make sure there is no problems with the loop running again y not try sumthing like this.

   

   main:
   while(1)
   {
   if (local.pistol_exhange = 1)
   {
   end
   }
   else if (local.pistol_exhange != 1)
   {
   local.pistol_exhange = 1
   take "models/weapons/colt45.tik"
   take "models/weapons/german_pistol.tik" //make sure to change this cant remember the correct .tik file name
   give "models/weapons/silenced_pistol.tik" //make sure to change this cant remember the correct .tik file name
   }
   wait 1
   }
   end
   
Title: Admin Pro 1.22
Post by: wcSki on January 25, 2006, 06:20:26 PM
SO this can not be done in admin pro?

   

   Ski
Title: Admin Pro 1.22
Post by: Cobra {sfx} on January 25, 2006, 06:23:35 PM
Elgans in the middle of moving house - youll need to wait until his return for a reply
Title: Admin Pro 1.22
Post by: wcSki on January 25, 2006, 06:28:05 PM
Thx Cobra... if I used the above script... how would I use it?

   

   Would I have to put an execute line at the start of each map or something?

   

   Ski
Title: Admin Pro 1.22
Post by: Cobra {sfx} on January 25, 2006, 06:38:21 PM
Ive never used or looked at Admin Pro so i wouldnt know m8, perhaps Habsey can answer u
Title: Admin Pro 1.22
Post by: wcSki on January 25, 2006, 06:53:52 PM
I think you mis-understood... I can wait till Elgan returns to see if this can be done using admin pro.

   

   

   But if I wanted to create a script to swap pistols out WITHOUT using admin pro how would I do that?? Would I need something like above and then exec global/pistolswap.scr or something in each map??

   

   Ski
Title: Admin Pro 1.22
Post by: habsey on January 26, 2006, 03:53:33 AM
take the code i gave u above....

   

   then save it as weapon_stuff.scr

   then open up ur dmpreache.scr file and at the very bottom put this line

   

   

   

   exec global/weapon_stuff.scr
   end
   

   and then open up pakscape, create a new file make a folder called global and put the dmpreache.scr file and the weapon_stuff.scr file in this folder.

   

   Doing it under dmpreache.scr saves alot of work instead of doing it in the map file as then you only need to do it in one place and not your whole map rotation

   

   

   If you wanna do this inside admin pro y not try using the weapons limiter...

   

   editing admin pro is probably a bit to hard for you when u open it up (sometimes i even get lost in it (great scripting by elgan!)) so just use the .txt files that he made for easy use.  So if the weapon limiter doesnt work then give my code a go.

   

   GL!
Title: Admin Pro 1.22
Post by: wcSki on January 26, 2006, 02:17:27 PM
Thx Habsey... I would love to figure out a way to do this within the Admin Pro weapons limiter so I can turn it off and on when I want to. That is what is so nice about it Admin Pro's weapons limiter... but for secondary weapons in Admin Pro elgan just has it so you can take the pistols or keep them... not swap them out with the silenced pistol.

   

   I am trying to set this up on a server that we use in a lot of different ways... mainly a rifle only server.... but sometimes we need to set it up for matches. So I need to ability to turn mods on and off fairly easy. With the script I can not do that... I have to remove the pk3 from the main folder correct?

   

   Ski
Title: Admin Pro 1.22
Post by: habsey on January 26, 2006, 02:49:58 PM
well there is a certain way you are able to turn mods on and off... for example with the weapons_stuff.scr that i gave u earlier instead of writing this line

   
 exec global/weapon_stuff.scr
   end

   

   in your dmpreache you could replace it with

   

   
   if(getcvar(g_swap_pistols) == "1")
   {
   exec global/weapon_stuff.scr
   }
   end
   

   

   this way if you were to enter

   rcon g_swap_pistols 1

   into your console and then restart your server, this script would execute.

   As this swap mod does not conflict with admin pro it should be fine to just do it like we are.  I havent used admin pro much myself, only looked into some of the scripting.  There is no way to edit admin pro to do what you want to achieve with the settings.txt files however you would be able to do it within the weapons limiter scripting (we should leave this to elgan).  If you kindly ask him he will probably add this to the next version but for the time being just use the stuff i have givin you.  

   

   BTW,

   

   you can edit this code to whatever you want...

   

   

   
   if(getcvar(g_swap_pistols) == "1")
   {
   exec global/weapon_stuff.scr
   }
   end
   

   

   for example if i made a dark sky i could do sumthing like this

   

   

   
   if(getcvar(g_dark_sky) == "1")
   {
   exec global/dark_sky.scr
   }
   end
   

   

   to turn it on i would do

   rcon g_dark_sky 1

   rcon restart

   then to turn it off i would do

   rcon g_dark_sky 0

   rcon restart

   

   GL!
Title: Admin Pro 1.22
Post by: Elgan {sfx} on January 26, 2006, 06:05:52 PM
wcSki :
   Hey Elgan... I have another question. Is it possible to swap the secondary weapons?? I would like to swap out the standard team pistols and give them a silence pistol instead. How can this be done??? Looking at the weapons limiter file you can only take them away... is there a way to replace the standard pistol with the silence pistol like you do with the beginning of survivor.

   

   Thanks,

   Ski

   

   

   think it can give secondary as well, cant check right now, if should be fine with a script like above with raise as habsey shows, no loop,

   

   add cvars or use Ap cvars, up to u.

   

   level.run["weapons-limter"] == 0 //weapon off, 1=on, can check if its on or off like that.
Title: Admin Pro 1.22
Post by: wcSki on January 26, 2006, 06:24:55 PM
I have did what was outlined about and for some reason I can not get the script to run and swap out the pistols...

   

   I looked again in the weapons limiter.txt file and could not see anything about swapping secondary weapons.... I will keep trying and see what happens.

   

   Ski
Title: Admin Pro 1.22
Post by: Elgan {sfx} on January 26, 2006, 06:30:04 PM
hm, ok

   

   well it may not have swapping for pistols, the reason being is that i would have to check if pistols are beign swapped on every single weapon raise, This is because you cant check what weapon the player has in the inventory.

   

   So, i probably only added take away. I should of added give also. So you take away a pistol and give another.

   

   i will add "give" for next update, thought i had added it.sorry, ok, just make a script to give and take like habsey shows. You can make it turn on and off with a new cvar or use AP or a new cvar in AP, you could even make it as a new plugion script.
Title: Admin Pro 1.22
Post by: wcSki on January 26, 2006, 06:47:02 PM
Ok I made this 1st pistol_swap.scr

   

   

   main:
   while(1)
   {
   if (local.pistol_exhange = 1)
   {
   end
   }
   else if (local.pistol_exhange != 1)
   {
   local.pistol_exhange = 1
   take "models/weapons/colt45.tik"
   take "models/weapons/p38.tik" //make sure to change this cant remember the correct .tik file
   namegive "models/weapons/silencedpistol.tik" //make sure to change this cant remember the correct .tik file name
   }
   wait 1
   }
   end

   

   and then at the end of DMprecache I added this

   

   

   cache models/vehicles/jeep_30cal.tik
   if(getcvar(g_pistol_swap) == "1")
   {
   exec global/pistol_swap.scr
   }
   end
   

   

   Placed both of these files into a new pk3 named zzzzzz_pistol_swap.pk3

   

   created a global folder and placed DMprecache.scr and pistol_swap.scr

   

   placed into server main folder... restarted server and pistols do not swap when I enter the command line. I tried:

   

   rcon g_pistol_swap 1

   rcon g_pistol_swap "1"

   rcon set g_pistol_swap 1

   rcon set g_pistol_swap "1"

   

   none of them worked. What am I doing wrong??

   Ski
Title: Admin Pro 1.22
Post by: Elgan {sfx} on January 26, 2006, 06:53:21 PM
the loop above, will not check if its already running, it will just check if its running in its own scope, and run. It will check every looping. Also your cvar will only check once, at the exec.

   

   

   main:
   
   if (level.pistol_exhange = 1)
   {
   end  //check once, before the loop.
   }
   
   level.pistol_exhange = 1
   
   while(1)
   {
   
   if(getcvar(g_pistol_swap) == "1")
   {
   take "models/weapons/colt45.tik"
   take "models/weapons/p38.tik" //make sure to change this cant remember the correct .tik file
   namegive "models/weapons/silencedpistol.tik" //make sure to change this cant remember the correct .tik file name
   }
   
   
   wait 1
   }
   end

   

   exec it from dmprecache or similar
Title: Admin Pro 1.22
Post by: wcSki on January 26, 2006, 07:09:56 PM
Man I am feeling really dumb... I used the code you listed above and put it in my pistol_swap.scr file... saved it all again and still will not swap pistols.

   

   How should I be entering the console command??

   

   rcon set g_pistol_swap "1"

   

   is that correct??

   Ski

   

   Edit:

   Oh and when I go into the Admin Pro menu and look at the cvar list.... I do not see g_pistol_swap even listed. I think I maybe to much of a noob at this to put this thing together so it works. :con

   

   edit#2:

   Another question came to mind. Part of the Admin Pro Menu you have the option to punish peeps or warn them they are about to be kicked. kickwarn I think the command is... is there a way to change the text the in window that pops up??
Title: Admin Pro 1.22
Post by: Elgan {sfx} on January 27, 2006, 12:16:21 AM
setting the cvar sud be good, sud then work,.

   

   AP menu will not change, u didnt even add a script to AP

   

   3. yes, but in the script global/ac/command_post/

   

   one of the scripts inside there, forget the name. Cant check atm
Title: Admin Pro 1.22
Post by: wcSki on January 27, 2006, 03:29:25 AM
Well thanks for all the help, but I can not get this to work at all. Is it possible for someone to put this together for me and send me the pk3??

   

   I found the file to edit... thx!

   

   Ski
Title: Admin Pro 1.22
Post by: Elgan {sfx} on January 27, 2006, 05:51:32 PM
try

   

   

   main:
   
   if (level.pistol_exhange = 1)
   {
   end  //check once, before the loop.
   }
   
   level.pistol_exhange = 1
   
   while(1)
   {
   
   if(getcvar(g_pistol_swap) == "1")
   {
   for(local.i = 1;local.i<= $player.size;local.i++)
   {
   local.player = $player[local.i]
   local.player take "models/weapons/colt45.tik"
   local.player take "models/weapons/p38.tik" //make sure to change this cant remember the correct .tik file
   local.player give "models/weapons/silencedpistol.tik" //make sure to change this cant remember the correct .tik file name
   }
   }
   
   
   wait 1
   }
   end
Title: Admin Pro 1.22
Post by: wcSki on January 27, 2006, 07:05:22 PM
Hmmm nope that did not work. I posted on TMT forums as well and unreal demon told me to try this based on the script provided in this thread.

   

   

   Main:
   
      if (level.pistol_exhange)
         end
   
      level.pistol_exhange = 1
   
      while (1)
      {
         local.pistol_swap_cvar = getcvar("g_pistol_swap")
         if(local.pistol_swap_cvar == "1")
         {
            for(local.i = 1; local.i <= $player.size; local.i ++)
            {
               if !($player[local.i].pistol_swapped)
               {
                  $player[local.i].pistol_swapped = 1
                  $player[local.i] take "models/weapons/colt45.tik"
                  $player[local.i] take "models/weapons/p38.tik"
                  $player[local.i] give "models/weapons/silencedpistol.tik"
                  $player[local.i] thread check_for_death
               }
               wait .5
            }
         }
         wait 1
      }
   
   end
   
   check_for_death:
   
      while(isAlive self)
         waitframe
   
      $player[local.i].pistol_swapped = 0
   
   end
   

   

   

   I did that... but still was not able to get it to run so I thought maybe it was the way I am executing it in DMprecache... so I placed this line in the mohdm1 map script

   

   

   

   level waittill spawn
   exec global/pistol_swap.scr
   

   

   I do not know if that is the right place to put it or not... but I then created a maps/DM folder in my pk3 and placed the script for the map in there and loaded up a local server to test it out using the last pistol_swap.scr above that unreal demon provided. Not the on all the time one.

   

   when I 1st loaded the map I had standard pistol... then I put into console

   

   set g_pistol_swap 1

   <pressed enter>

   

   and then checked to see if I had a silenced pistol and I did!

   

   BUT  

   When I changed from Allies to Axis... It went back to standard pistol and I could not get it to give me a silenced pistol with out 1st setting it back to 0

   

   set g_pistol_swap 0

   restart

   set g_pistol_swap 1

   

   and then back to 1. AND whenever I restarted the map it went back to standard pistols and I had to do the samething as above to turn it back on.

   

   hey! at least I had a silenced pistol for some of the time

   

   So for some reason putting what I have in DMprecache is not working... how else can I turn this off and on??? and make it stay on during map restarts and map changes from one to another?? any ideas??

   

   I am very new to this and just wanted to say thanks to you both for all the help!

   

   Ski
Title: Admin Pro 1.22
Post by: habsey on January 27, 2006, 08:04:41 PM
use the 1 elgan gave u above should work and if it doesnt repost and ill add some team casing to it..
Title: Admin Pro 1.22
Post by: wcSki on January 28, 2006, 08:46:09 PM
I tried elgans script above and it still did not work. This is what I have so far.

   

   This is the pistol_swap.scr I have that works somewhat :(

   

   

   //// Pistol Swap Script Made Possible By Unreal_Demon, Elgan, Habsey and others
   //// Tested and put together By :^BONES^: Ski
   //// Thanks to Unreal_Demon, Elgan, Habsey for all their help!
   
   Main:
   
      if (level.pistol_exhange)
         end
   
      level.pistol_exhange = 1
   
      while (1)
      {
         local.pistol_swap_cvar = getcvar("pistol_swap")
         if(local.pistol_swap_cvar == "1")
         {
            for(local.i = 1; local.i <= $player.size; local.i ++)
            {
               if ( !($player[local.i].pistol_swapped) && ($player[local.i].dmteam != "spectator") )
               {
                  $player[local.i].pistol_swapped = 1
   
                  if($player[local.i].dmteam == "allies")
                     $player[local.i] take "models/weapons/colt45.tik"
                  if($player[local.i].dmteam == "axis")
                     $player[local.i] take "models/weapons/p38.tik"
   
                  $player[local.i] give "models/weapons/silencedpistol.tik"
                  $player[local.i] thread check_for_death
               }
               wait .5
            }
         }
         wait 1
      }
   
   end
   
   check_for_death:
   
      local.team = self.dmteam
   
      while(1)
      {
         if( (self.dmteam != local.team) || (self.health <= 0) )
         {
            $player[local.i].pistol_swapped = 0
            end
         }
         wait 1
      }
   
   end
   

   

   I excute it by putting this code in the map file

   

   

   level waittill spawn
   exec global/pistol_swap.scr
   

   

   It will only excute if you set pistol_swap to 1=ON in rcon console.

   

   

   With everything like above I have the script swapping out standard pistol's to the silenced pistol MOST of the time.

   

   The problem I am having is when someone is in spectate... when they spawn from spectate the pistols do not swap... as soon as the die and respawn the pistol starts swapping. Not sure what to do so they swap when coming out of spectate. Any idea looking at the script above what I could try??

   

   Thanks!

   Ski
Title: Admin Pro 1.22
Post by: habsey on January 28, 2006, 09:52:13 PM
k here it is ... tested works great dont see a problem in it,

   

   //// Pistol Swap Script Made Possible By Unreal_Demon, Elgan, Habsey and others
   //// Tested and put together By :^BONES^: Ski
   //// Thanks to Unreal_Demon, Elgan, Habsey for all their help!
   
   Main:
   
      if (level.pistol_exhange)
         end
   
      level.pistol_exhange = 1
   
      while (1)
      {
         local.pistol_swap_cvar = getcvar("pistol_swap")
         if(local.pistol_swap_cvar == "1")
         {
            for(local.i = 1; local.i <= $player.size; local.i ++)
            {
               if ( !($player[local.i].pistol_swapped))
               {
                  $player[local.i].pistol_swapped = 1
   
                  if($player[local.i].dmteam == "allies")
                  {
                     $player[local.i] take "models/weapons/colt45.tik"
                     $player[local.i] give "models/weapons/silencedpistol.tik"
                     $player[local.i] thread check_for_death
                  }
                  if($player[local.i].dmteam == "axis")
                  {
                     $player[local.i] take "models/weapons/p38.tik"
                     $player[local.i] give "models/weapons/silencedpistol.tik"
                     $player[local.i] thread check_for_death
                  }
                  else if($player[local.i].dmteam == "spectator")
                  {
                     goto main
                  }
               }
               wait .5
            }
         }
         wait 1
      }
   
   end
   
   check_for_death:
   
      local.team = self.dmteam
   
      while(1)
      {
         if( (self.dmteam != local.team) || (self.health <= 0) )
         {
            $player[local.i].pistol_swapped = 0
            end
         }
         wait 1
      }
   
   end
   
Title: Admin Pro 1.22
Post by: wcSki on January 28, 2006, 11:37:08 PM
Thanks Habsey

   

   I tried the script above, it did not fix the problem... if you spawn and get killed you respawn with a silence pistol... but if you go into spectate and then rejoin the battle you spawn with the standard pistols for each team. I guess I am kind of stuck at this point. Not sure what to do.

   

   Maybe elgan can put this ability into admin pro... hint hint :)

   

   really tho you all have been great!! Thank you so much!

   Ski
Title: Admin Pro 1.22
Post by: habsey on January 28, 2006, 11:52:02 PM
well im off to hockey now ill take a look at it when i get bak ill get it too work if someone doesnt beat me to it well peace
Title: Admin Pro 1.22
Post by: wcSki on January 30, 2006, 01:59:52 AM
I think I have just about used up my help on this one... nobody seems to have an idea of what could be wrong so I think you will have time :)

   

   Ski