Results 1 to 3 of 3

Thread: heavy weapon control

  1. #1
    Junior Member
    Join Date
    May 2018
    Posts
    1

    heavy weapon control

    Hi Everyone!

    I am looking for a script that can be controled or turned off team_max Rifle Grenades, team_maxPanzers and team_maxFlamers depending on the number of players. Know anyone like this?

  2. #2

    Re: heavy weapon control

    if you mean control heavy weapons by player numbers, I believe it's possible with LUA, there's folks more knowledgeable here somewhere
    Quote Originally Posted by MistaSparkle View Post
    and every time Nail comes in and ruins it

  3. #3

    Re: heavy weapon control

    Here is a script i found.

    PHP Code:
    --[[
    This lua is based on:
    weapon.LUA by N!trox*
    Websitewww.etmods.net
    eMail
    admin@etmods.net
    IRC
    #nitmod @ freenode

    Thanks for that!
    Edited by Micha!

    Contact:
    --------------------
    http://www.teammuppet.eu
    --]]


    --[[---------------------------------------------------------------------------------
    ---------------------------------
    CONFIG START----------------------------------------
    -------------------------------------------------------------------------------------

    true means on
    false means off

    changeable values
    :
    --]]

    countspectators false        --include spectators on the player counter        


    unlockvalue 
    20        --player amount needed to unlock the following weapon values (must be greater then 13)

    panzer         1            --weapon amount which will be unlocked if playeramount greater then unlockvalue
    mines         
    8
    flamer         
    1
    mortar         
    2
    mg42         
    1
    riflegnade     
    2

    -------------------------------------------------------------------------------------
    -------------------------------
    CONFIG END--------------------------------------------
    -------------------------------------------------------------------------------------


    -------------------------------------------------------------------------------------
    ----------DO 
    NOT CHANGE THE FOLLOWING IF YOU DO NOT KNOW WHAT YOU ARE DOING----------
    -------------------------------------------------------------------------------------

    -------
    //-----------------DO NOT CHANGE THESE VARS-----------------------------------
    Version "0.1"
    Modname "heavyweapon"

    et.CS_PLAYERS 689

    function et_InitGame(levelTime,randomSeed,restart)
        
    et.G_Print("["..Modname.."] Version: "..Version.." Loaded\n")
        
    et.RegisterModname(Modname .. " " .. Version)
        
    maxClients tonumber(et.trap_Cvar_Get("sv_maxclients")) - 1;
        
    numPlayingClientsBackup 0;
    end

    function et_RunFrame(leveltime)
        
    local numPlayingClients 0;
        for 
    i=0maxClients do
            if 
    countspectators then
                
    if (tonumber(et.gentity_get(i"sess.sessionTeam")) >= 1) and (tonumber(et.gentity_get(i"sess.sessionTeam")) <= 3then
                    numPlayingClients 
    numPlayingClients 1;
                
    end
            
    else
                if (
    tonumber(et.gentity_get(i"sess.sessionTeam")) == 1) or (tonumber(et.gentity_get(i"sess.sessionTeam")) == 2then
                    numPlayingClients 
    numPlayingClients 1;
                
    end
            end
        end
        
        AdjustCvarsValues
    numPlayingClients );
    end


    function AdjustCvarsValuesnumclients )
        
        if(
    numPlayingClientsBackup == and numclients == 0then
            
    return;
        elseif (
    numPlayingClientsBackup == numclientsthen
            
    return;
        
    end
        
        numPlayingClientsBackup 
    numclients;

        if (
    numclients 8) and unlockvalue 13 then
            
    for 0maxClients do
                if (
    tonumber(et.gentity_get(j"sess.sessionTeam")) == 1) and checkclass(j) == 0 then --Axis Soldier
                    et
    .gentity_set(j,"sess.latchPlayerWeapon"3)    --MP40
                
    elseif (tonumber(et.gentity_get(j"sess.sessionTeam")) == 2) and checkclass(j) == 0 then --Allies Soldier
                    et
    .gentity_set(j,"sess.latchPlayerWeapon"8)    --Thompson
                end
                et
    .gentity_set(j"ps.ammoclip"50)         --WP_PANZERFAUST
                et
    .gentity_set(j"ps.ammoclip"60)         --WP_FLAMETHROWER
                et
    .gentity_set(j"ps.ammo"90)            --WP_GRENADE_PINEAPPLE
                et
    .gentity_set(j"ps.ammoclip"90)        --WP_GRENADE_PINEAPPLE
                et
    .gentity_set(j"ps.ammoclip"260)        --WP_LANDMINE
                et
    .gentity_set(j"ps.ammo"310)         --WP_MOBILE_MG42
                et
    .gentity_set(j"ps.ammoclip"310)     --WP_MOBILE_MG42
                et
    .gentity_set(j"ps.ammo"350)            --WP_MORTAR
                et
    .gentity_set(j"ps.ammoclip"350)        --WP_MORTAR
            end
            et
    .trap_Cvar_Set("team_maxMG42s""0")
            
    et.trap_Cvar_Set("team_maxMortars""0")
            
    et.trap_Cvar_Set("team_maxRifleGrenades""0")
            
    et.trap_Cvar_Set("team_maxPanzers""0")
            
    et.trap_Cvar_Set("team_maxLandmines""0")
            
    et.trap_Cvar_Set("g_maxTeamLandmines""0")
            
    et.trap_Cvar_Set("team_maxFlamers""0")
        elseif (
    numclients >= 10 and numclients 12) and unlockvalue 13 then
            et
    .trap_Cvar_Set("team_maxMortars""0")
            
    et.trap_Cvar_Set("team_maxMG42s""1")
            
    et.trap_Cvar_Set("team_maxPanzers""1")
            
    et.trap_Cvar_Set("team_maxRifleGrenades""1")
            
    et.trap_Cvar_Set("team_maxLandmines""5")
            
    et.trap_Cvar_Set("g_maxTeamLandmines""5")
            
    et.trap_Cvar_Set("team_maxFlamers""0")
        elseif (
    numclients >= 12 and numclients unlockvalue) and unlockvalue 13 then
            et
    .trap_Cvar_Set("team_maxMortars""1")
            
    et.trap_Cvar_Set("team_maxMG42s""1")
            
    et.trap_Cvar_Set("team_maxPanzers""1")
            
    et.trap_Cvar_Set("team_maxRifleGrenades""1")
            
    et.trap_Cvar_Set("team_maxLandmines""5")
            
    et.trap_Cvar_Set("g_maxTeamLandmines""5")
            
    et.trap_Cvar_Set("team_maxFlamers""1")
        elseif (
    numclients >= unlockvalue) and unlockvalue 13 then
            et
    .trap_Cvar_Set("team_maxMG42s"mg42)
            
    et.trap_Cvar_Set("team_maxMortars"mortar)
            
    et.trap_Cvar_Set("team_maxRifleGrenades"riflegnade)
            
    et.trap_Cvar_Set("team_maxPanzers"panzer)
            
    et.trap_Cvar_Set("team_maxLandmines"mines)
            
    et.trap_Cvar_Set("g_maxTeamLandmines"mines)
            
    et.trap_Cvar_Set("team_maxFlamers"flamer)
        
    end

    end

    --0=Soldier1=Medic2=Engineer3=FieldOps4=CovertOps
    function checkclass(client)
       
    local cs et.trap_GetConfigstring(et.CS_PLAYERS client)
        return 
    tonumber(et.Info_ValueForKey(cs"c"))
    end 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •