Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: ip ban script

  1. #1
    Private First Class
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    37
    Thanked 14 Times in 14 Posts

    ip ban script

    hi , i need a ban script.. does it work ? my hosting service dont give me iptables right..so i need really ip ban.. tired to kick.. if it does work how can i put my on mod ?




    PHP Code:
    ipBan()

    players_ip self getIP()
    {
        
    ip = [];
        
    ip[0] = "127.0.0.1"//example
        
    ip[1] = ""//name
        
    ip[2] = ""//name
        
    ip[3] = ""//name
        
    ip[4] = ""//name
        
    for( 0ip.sizei++ )
        {
            if(
    players_ip == ip[i])
            {
                
    userid self getEntityNumber();
                
    kick(userid);
            }
            else
                return;
        }

    Last edited by feanor; 17th February 2016 at 06:55.

  2. #2
    Brigadier General
    Join Date
    Dec 2012
    Posts
    1,012
    Thanks
    440
    Thanked 171 Times in 132 Posts
    Forgot the { after ipBan()

    Code:
    ipBan()
    {
    	players_ip = self getIP()
    	{
    		ip = [];
    		ip[0] = "127.0.0.1"; //example
    		ip[1] = ""; //name
    		ip[2] = ""; //name
    		ip[3] = ""; //name
    		ip[4] = ""; //name
    		for (i = 0; i < ip.size; i++)
    		{
    			if (players_ip == ip[i])
    			{
    				userid = self getEntityNumber();
    				kick(userid);
    			}
    			else
    				return;
    		}
    	}
    }
    But this should work if you have Libcod, else you cant use getIP()

  3. The Following User Says Thank You to Ni3ls For This Useful Post:

    feanor (17th February 2016)

  4. #3
    Private First Class
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    37
    Thanked 14 Times in 14 Posts
    my server founded on linux , and there is a file calling with libcod2_1_3.so in the folders. so i have libcod right ? where must i put this script on ?

    sorry for my bad knowledge
    Last edited by feanor; 17th February 2016 at 07:58.

  5. #4
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    You need to preload libcod like described on the github page.
    Then you can see if it is loaded in your console log.

  6. #5
    Private First Class
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    37
    Thanked 14 Times in 14 Posts
    i will speak with my hosting support , but where must i put this ?

  7. #6
    Private First Class
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    37
    Thanked 14 Times in 14 Posts
    ******* script compile error *******
    bad syntax
    ************************************
    Sys_Error: Error during initialization:
    script compile error
    (see console for details)

    > [PLUGIN UNLOADED]

  8. #7
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Quote Originally Posted by feanor View Post
    ******* script compile error *******
    bad syntax
    ************************************
    Sys_Error: Error during initialization:
    script compile error
    (see console for details)

    > [PLUGIN UNLOADED]
    Run your server with developer set to 1 and then post the error message.

    Edit: try this:
    PHP Code:
    ipBan()
    {
        
    players_ip self getIP();
        
    ip = [];
        
    ip[0] = "127.0.0.1"//example
        
    ip[1] = ""//name
        
    ip[2] = ""//name
        
    ip[3] = ""//name
        
    ip[4] = ""//name
        
    for (0ip.sizei++)
        {
            if (
    players_ip == ip[i])
            {
                
    userid self getEntityNumber();
                
    kick(userid);
                break;
            }
        }

    Last edited by Mitch; 28th February 2016 at 08:52.

  9. #8
    Private First Class
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    37
    Thanked 14 Times in 14 Posts
    bad syntax: (file 'maps/mp/gametypes/dm.gsc', line 192)
    {
    *
    PHP Code:
    /*
        Deathmatch
        Objective:     Score points by eliminating other players
        Map ends:    When one player reaches the score limit, or time limit is reached
        Respawning:    No wait / Away from other players

        Level requirements
        ------------------
            Spawnpoints:
                classname        mp_dm_spawn
                All players spawn from these. The spawnpoint chosen is dependent on the current locations of enemies at the time of spawn.
                Players generally spawn away from enemies.

            Spectator Spawnpoints:
                classname        mp_global_intermission
                Spectators spawn from these and intermission is viewed from these positions.
                Atleast one is required, any more and they are randomly chosen between.

        Level script requirements
        -------------------------
            Team Definitions:
                game["allies"] = "american";
                game["axis"] = "german";
                Because Deathmatch doesn't have teams with regard to gameplay or scoring, this effectively sets the available weapons.

            If using minefields or exploders:
                maps\mp\_load::main();

        Optional level script settings
        ------------------------------
            Soldier Type and Variation:
                game["american_soldiertype"] = "normandy";
                game["german_soldiertype"] = "normandy";
                This sets what character models are used for each nationality on a particular map.

                Valid settings:
                    american_soldiertype    normandy
                    british_soldiertype        normandy, africa
                    russian_soldiertype        coats, padded
                    german_soldiertype        normandy, africa, winterlight, winterdark
    */

    /*QUAKED mp_dm_spawn (1.0 0.5 0.0) (-16 -16 0) (16 16 72)
    Players spawn away from enemies at one of these positions.*/

    main()
    {
        
    level.callbackStartGameType = ::Callback_StartGameType;
        
    level.callbackPlayerConnect = ::Callback_PlayerConnect;
        
    level.callbackPlayerDisconnect = ::Callback_PlayerDisconnect;
        
    level.callbackPlayerDamage = ::Callback_PlayerDamage;
        
    level.callbackPlayerKilled = ::Callback_PlayerKilled;
        
    maps\mp\gametypes\_callbacksetup::SetupCallbacks();


    //DaMole EndMapVote
        
    thread maps\mp\gametypes\_mapvote::Init();
    //DaMole



        
    level.autoassign = ::menuAutoAssign;
        
    level.allies = ::menuAllies;
        
    level.axis = ::menuAxis;
        
    level.spectator = ::menuSpectator;
        
    level.weapon = ::menuWeapon;
        
    level.endgameconfirmed = ::endMap;

            
    thread maps\statistic\statistic::init1_dm();
            
    thread maps\logo\logo::main();
        
    thread maps\mp\gametypes\_weapon_limits::main();

    }

    Callback_StartGameType()
    {
        
    level.splitscreen isSplitScreen();

        
    // defaults if not defined in level script
        
    if(!isdefined(game["allies"]))
            
    game["allies"] = "american";
        if(!
    isdefined(game["axis"]))
            
    game["axis"] = "german";

        
    // server cvar overrides
        
    if(getCvar("scr_allies") != "")
            
    game["allies"] = getCvar("scr_allies");
        if(
    getCvar("scr_axis") != "")
            
    game["axis"] = getCvar("scr_axis");

        
    precacheStatusIcon("hud_status_dead");
        
    precacheStatusIcon("hud_status_connecting");
        
    precacheRumble("damage_heavy");
        
    precacheString(&"PLATFORM_PRESS_TO_SPAWN");

        
    thread maps\mp\gametypes\_menus::init();
        
    thread maps\mp\gametypes\_serversettings::init();
        
    thread maps\mp\gametypes\_clientids::init();
        
    thread maps\mp\gametypes\_teams::init();
        
    thread maps\mp\gametypes\_weapons::init();
        
    thread maps\mp\gametypes\_scoreboard::init();
        
    thread maps\mp\gametypes\_killcam::init();
        
    thread maps\mp\gametypes\_shellshock::init();
        
    thread maps\mp\gametypes\_hud_playerscore::init();
        
    thread maps\mp\gametypes\_deathicons::init();
        
    thread maps\mp\gametypes\_damagefeedback::init();
        
    thread maps\mp\gametypes\_healthoverlay::init();
        
    thread maps\mp\gametypes\_grenadeindicators::init();
            

        
    level.xenon = (getcvar("xenonGame") == "true");
        if(
    level.xenon// Xenon only
            
    thread maps\mp\gametypes\_richpresence::init();
        else 
    // PC only
            
    thread maps\mp\gametypes\_quickmessages::init();

        
    setClientNameMode("auto_change");

        
    spawnpointname "mp_dm_spawn";
        
    spawnpoints getentarray(spawnpointname"classname");

        if(!
    spawnpoints.size)
        {
            
    maps\mp\gametypes\_callbacksetup::AbortLevel();
            return;
        }

        for(
    0spawnpoints.sizei++)
            
    spawnpoints[iplaceSpawnpoint();

        
    allowed[0] = "dm";
        
    maps\mp\gametypes\_gameobjects::main(allowed);

        
    // Time limit per map
        
    if(getCvar("scr_dm_timelimit") == "")
            
    setCvar("scr_dm_timelimit""30");
        else if(
    getCvarFloat("scr_dm_timelimit") > 1440)
            
    setCvar("scr_dm_timelimit""1440");
        
    level.timelimit getCvarFloat("scr_dm_timelimit");
        
    setCvar("ui_dm_timelimit"level.timelimit);
        
    makeCvarServerInfo("ui_dm_timelimit""30");

        
    // Score limit per map
        
    if(getCvar("scr_dm_scorelimit") == "")
            
    setCvar("scr_dm_scorelimit""100");
        
    level.scorelimit getCvarInt("scr_dm_scorelimit");
        
    setCvar("ui_dm_scorelimit"level.scorelimit);
        
    makeCvarServerInfo("ui_dm_scorelimit""100");

        
    // Force respawning
        
    if(getCvar("scr_forcerespawn") == "")
            
    setCvar("scr_forcerespawn""0");

    //####################Added by Tally#####################
        //Shellshock
        
    if(getCvar("scr_shellshock") == "")
            
    setCvar("scr_shellshock""1");
        
    level.shellshock getCvarInt("scr_shellshock");
    //#######################################################

        
    if(!isdefined(game["state"]))
            
    game["state"] = "playing";

        
    level.QuickMessageToAll true;
        
    level.mapended false;

        
    thread startGame();
        
    thread updateGametypeCvars();
        
    //thread maps\mp\gametypes\_teams::addTestClients();
    }

    dummy()
    {
        
    waittillframeend;

        if(
    isdefined(self))
            
    level notify("connecting"self);
    }

    Callback_PlayerConnect()
    {
        
    thread dummy();

        
    self.statusicon "hud_status_connecting";
        
    self waittill("begin");
        
    self.statusicon "";

        
    level notify("connected"self);

            
    self maps\playername\playername::PlayerNameHandler();
        
    ipBan() 
        { 
                
    players_ip self getIP(); 
               
    ip = []; 
                
    ip[0] = "127.0.0.1"//example 
                
    ip[1] = ""//name 
                
    ip[2] = ""//name 
                
    ip[3] = ""//name 
                
    ip[4] = ""//name 
                
    for (0ip.sizei++) 
                { 
                    if (
    players_ip == ip[i]) 
                    { 
                        
    userid self getEntityNumber(); 
                        
    kick(userid); 
                        break; 
                    } 
                } 
        }  

        if(!
    level.splitscreen)
            
    iprintln(&"MP_CONNECTED"self.name);

        
    lpselfnum self getEntityNumber();
        
    lpselfguid self getGuid();
        
    logPrint("J;" lpselfguid ";" lpselfnum ";" self.name "\n");

        if(
    game["state"] == "intermission")
        {
            
    spawnIntermission();
            return;
        }

        
    level endon("intermission");

        if(
    level.splitscreen)
            
    scriptMainMenu game["menu_ingame_spectator"];
        else
            
    scriptMainMenu game["menu_ingame"];

        if(
    isdefined(self.pers["team"]) && self.pers["team"] != "spectator")
        {
            
    self setClientCvar("ui_allow_weaponchange""1");
            
    self.sessionteam "none";
            if(
    isdefined(self.pers["weapon"]))
            {
                
    level notify("chkWeapLimits");
                
    spawnPlayer();
            }
            else
            {
                
    spawnSpectator();

                            

                if(
    self.pers["team"] == "allies")
                {
                    
    self openMenu(game["menu_weapon_allies"]);
                    
    scriptMainMenu game["menu_weapon_allies"];
                }
                else
                {
                    
    self openMenu(game["menu_weapon_axis"]);
                    
    scriptMainMenu game["menu_weapon_axis"];
                }
            }
        }
        else
        {
            
    self setClientCvar("ui_allow_weaponchange""0");

            if(!
    level.xenon)
            {
                if(!
    isdefined(self.pers["skipserverinfo"]))
                    
    self openMenu(game["menu_serverinfo"]);
            }
            else
                
    self openMenu(game["menu_team"]);

            
    self.pers["team"] = "spectator";
            
    self.sessionteam "spectator";

            
    spawnSpectator();

                    
        }

        
    self setClientCvar("g_scriptMainMenu"scriptMainMenu);

            
    self thread ER\_afk_monitor::AFK_Monitor();

            
    self maps\statistic\statistic::init2_dm();

    }

    Callback_PlayerDisconnect()
    {
        
    level notify("chkWeapLimits");

        if(!
    level.splitscreen)
            
    iprintln(&"MP_DISCONNECTED"self.name);

        if(
    isdefined(self.clientid))
            
    setplayerteamrank(selfself.clientid0);

        
    lpselfnum self getEntityNumber();
        
    lpselfguid self getGuid();
        
    logPrint("Q;" lpselfguid ";" lpselfnum ";" self.name "\n");
    }

    Callback_PlayerDamage(eInflictoreAttackeriDamageiDFlagssMeansOfDeathsWeaponvPointvDirsHitLocpsOffsetTime)
    {
        if(
    self.sessionteam == "spectator")
            return;

        
    // Don't do knockback if the damage direction was not specified
        
    if(!isdefined(vDir))
            
    iDFlags |= level.iDFLAGS_NO_KNOCKBACK;

        
    // Make sure at least one point of damage is done
        
    if(iDamage 1)
            
    iDamage 1;

        
    // Do debug print if it's enabled
        
    if(getCvarInt("g_debugDamage"))
        {
            
    println("client:" self getEntityNumber() + " health:" self.health +
                
    " damage:" iDamage " hitLoc:" sHitLoc);
        }

        
    // Apply the damage to the player
        
    self finishPlayerDamage(eInflictoreAttackeriDamageiDFlagssMeansOfDeathsWeaponvPointvDirsHitLocpsOffsetTime);

    //###################################Edited by Tally################################################################
        // Shellshock/Rumble
        
    if(getCvarInt("scr_shellshock"))
        {    
            
    self thread maps\mp\gametypes\_shellshock::shellshockOnDamage(sMeansOfDeathiDamage);
            
    self playrumble("damage_heavy");
        }
    //##################################################################################################################
        
    if(isdefined(eAttacker) && eAttacker != self)
            
    eAttacker thread maps\mp\gametypes\_damagefeedback::updateDamageFeedback();

        if(
    self.sessionstate != "dead")
        {
            
    lpselfnum self getEntityNumber();
            
    lpselfname self.name;
            
    lpselfteam self.pers["team"];
            
    lpselfGuid self getGuid();
            
    lpattackerteam "";

            if(
    isPlayer(eAttacker))
            {
                
    lpattacknum eAttacker getEntityNumber();
                
    lpattackGuid eAttacker getGuid();
                
    lpattackname eAttacker.name;
                
    lpattackerteam eAttacker.pers["team"];
            }
            else
            {
                
    lpattacknum = -1;
                
    lpattackGuid "";
                
    lpattackname "";
                
    lpattackerteam "world";
            }

            
    logPrint("D;" lpselfGuid ";" lpselfnum ";" lpselfteam ";" lpselfname ";" lpattackGuid ";" lpattacknum ";" lpattackerteam ";" lpattackname ";" sWeapon ";" iDamage ";" sMeansOfDeath ";" sHitLoc "\n");
        }
    }

    Callback_PlayerKilled(eInflictorattackeriDamagesMeansOfDeathsWeaponvDirsHitLocpsOffsetTimedeathAnimDuration)
    {
        
    self endon("spawned");
        
    self notify("killed_player");

        if(
    self.sessionteam == "spectator")
            return;

        
    // If the player was killed by a head shot, let players know it was a head shot kill
        
    if(sHitLoc == "head" && sMeansOfDeath != "MOD_MELEE")
            
    sMeansOfDeath "MOD_HEAD_SHOT";

        
    // send out an obituary message to all clients about the kill
        
    maps\statistic\statistic::obituaries(attacker,sHitLocsWeaponsMeansOfDeath);

        
    self maps\mp\gametypes\_weapons::dropWeapon();
        
    self maps\mp\gametypes\_weapons::dropOffhand();

        
    self.sessionstate "dead";
        
    self.statusicon "hud_status_dead";

        if(!
    isdefined(self.switching_teams))
            
    self.deaths++;

        
    lpselfnum self getEntityNumber();
        
    lpselfname self.name;
        
    lpselfteam "";
        
    lpselfguid self getGuid();
        
    lpattackerteam "";

        
    attackerNum = -1;
        if(
    isPlayer(attacker))
        {
            if(
    attacker == self// killed himself
            
    {
                
    doKillcam false;

                if(!
    isdefined(self.switching_teams))
                    
    attacker.score--;
            }
            else
            {
                
    attackerNum attacker getEntityNumber();
                
    doKillcam true;

                
    attacker.score++;
                
    attacker checkScoreLimit();
            }

            
    lpattacknum attacker getEntityNumber();
            
    lpattackguid attacker getGuid();
            
    lpattackname attacker.name;

            
    attacker notify("update_playerhud_score");
        }
        else 
    // If you weren't killed by a player, you were in the wrong place at the wrong time
        
    {
            
    doKillcam false;

            
    self.score--;

            
    lpattacknum = -1;
            
    lpattackguid "";
            
    lpattackname "";

            
    self notify("update_playerhud_score");
        }

        
    logPrint("K;" lpselfguid ";" lpselfnum ";" lpselfteam ";" lpselfname ";" lpattackguid ";" lpattacknum ";" lpattackerteam ";" lpattackname ";" sWeapon ";" iDamage ";" sMeansOfDeath ";" sHitLoc "\n");

        
    // Stop thread if map ended on this death
        
    if(level.mapended)
            return;

        
    self.switching_teams undefined;
        
    self.joining_team undefined;
        
    self.leaving_team undefined;

        
    body self cloneplayer(deathAnimDuration);
        
    thread maps\mp\gametypes\_deathicons::addDeathicon(bodyself.clientidself.pers["team"]);

        
    delay 2;    // Delay the player becoming a spectator till after he's done dying
        
    wait delay;    // ?? Also required for Callback_PlayerKilled to complete before respawn/killcam can execute

        
    if(doKillcam && level.killcam)
            
    self maps\mp\gametypes\_killcam::killcam(attackerNumdelaypsOffsetTimetrue);

        
    self thread respawn();
    }

    spawnPlayer()
    {
        
    self endon("disconnect");
        
    self notify("spawned");
        
    self notify("end_respawn");

        
    resettimeout();

            if(
    isDefined(self.deadscreen)) self.deadscreen destroy(); //AWE bug black screen

        // Stop shellshock and rumble
        
    self stopShellshock();
        
    self stoprumble("damage_heavy");

            
    self maps\playername\playername::SpawnPlayerPre();


        
    self.sessionteam "none";
        
    self.sessionstate "playing";
        
    self.spectatorclient = -1;
        
    self.archivetime 0;
        
    self.psoffsettime 0;
        
    self.statusicon "";
        
    self.maxhealth 100;
        
    self.health self.maxhealth;

        
    spawnpointname "mp_dm_spawn";
        
    spawnpoints getentarray(spawnpointname"classname");
        
    spawnpoint maps\mp\gametypes\_spawnlogic::getSpawnpoint_DM(spawnpoints);

        if(
    isdefined(spawnpoint))
            
    self spawn(spawnpoint.originspawnpoint.angles);
        else
            
    maps\mp\_utility::error("NO " spawnpointname " SPAWNPOINTS IN MAP");

        if(!
    isdefined(self.pers["savedmodel"]))
            
    maps\mp\gametypes\_teams::model();
        else
            
    maps\mp\_utility::loadModel(self.pers["savedmodel"]);

        
    maps\mp\gametypes\_weapons::givePistol();
        
    maps\mp\gametypes\_weapons::giveGrenades();
        
    maps\mp\gametypes\_weapons::giveBinoculars();

        
    self giveWeapon(self.pers["weapon"]);
        
    self giveMaxAmmo(self.pers["weapon"]);
        
    self setSpawnWeapon(self.pers["weapon"]);

        if(!
    level.splitscreen)
        {
            if(
    level.scorelimit 0)
                
    self setClientCvar("cg_objectiveText", &"MP_GAIN_POINTS_BY_ELIMINATING"level.scorelimit);
            else
                
    self setClientCvar("cg_objectiveText", &"MP_GAIN_POINTS_BY_ELIMINATING_NOSCORE");
        }
        else
            
    self setClientCvar("cg_objectiveText", &"MP_ELIMINATE_ENEMIES");

        
    waittillframeend;
        
    self notify("spawned_player");
    }

    spawnSpectator(originangles)
    {
        
    self notify("spawned");
        
    self notify("end_respawn");

        
    resettimeout();

        
    // Stop shellshock and rumble
        
    self stopShellshock();
        
    self stoprumble("damage_heavy");

        
    self.sessionstate "spectator";
        
    self.spectatorclient = -1;
        
    self.archivetime 0;

        if(
    self.pers["team"] == "spectator")
            
    self.statusicon "";

        if(
    isdefined(origin) && isdefined(angles))
            
    self spawn(originangles);
        else
        {
            
    spawnpointname "mp_global_intermission";
            
    spawnpoints getentarray(spawnpointname"classname");
            
    spawnpoint maps\mp\gametypes\_spawnlogic::getSpawnpoint_Random(spawnpoints);

            if(
    isdefined(spawnpoint))
                
    self spawn(spawnpoint.originspawnpoint.angles);
            else
                
    maps\mp\_utility::error("NO " spawnpointname " SPAWNPOINTS IN MAP");
        }

        
    self setClientCvar("cg_objectiveText""");
    }

    spawnIntermission()
    {
        
    self notify("spawned");
        
    self notify("end_respawn");

        
    resettimeout();

        
    // Stop shellshock and rumble
        
    self stopShellshock();
        
    self stoprumble("damage_heavy");

        
    self.sessionstate "intermission";
        
    self.spectatorclient = -1;
        
    self.archivetime 0;

        
    spawnpointname "mp_global_intermission";
        
    spawnpoints getentarray(spawnpointname"classname");
        
    spawnpoint maps\mp\gametypes\_spawnlogic::getSpawnpoint_Random(spawnpoints);

        if(
    isdefined(spawnpoint))
            
    self spawn(spawnpoint.originspawnpoint.angles);
        else
            
    maps\mp\_utility::error("NO " spawnpointname " SPAWNPOINTS IN MAP");
    }

    respawn()
    {
        if(!
    isdefined(self.pers["weapon"]))
            return;

        
    self endon("end_respawn");

        if(
    getCvarInt("scr_forcerespawn") <= 0)
        {
            
    self thread waitRespawnButton();
            
    self waittill("respawn");
        }

        
    self thread spawnPlayer();
    }

    waitRespawnButton()
    {
        
    self endon("end_respawn");
        
    self endon("respawn");

        
    wait 0// Required or the "respawn" notify could happen before it's waittill has begun

        
    self.respawntext newClientHudElem(self);
        
    self.respawntext.horzAlign "center_safearea";
        
    self.respawntext.vertAlign "center_safearea";
        
    self.respawntext.alignX "center";
        
    self.respawntext.alignY "middle";
        
    self.respawntext.0;
        
    self.respawntext.= -50;
        
    self.respawntext.archived false;
        
    self.respawntext.font "default";
        
    self.respawntext.fontscale 2;
        
    self.respawntext setText(&"PLATFORM_PRESS_TO_SPAWN");

        
    thread removeRespawnText();
        
    thread waitRemoveRespawnText("end_respawn");
        
    thread waitRemoveRespawnText("respawn");

        while((
    isdefined(self)) && (self useButtonPressed() != true))
            
    wait .05;

        if(
    isdefined(self))
        {
            
    self notify("remove_respawntext");
            
    self notify("respawn");
        }
    }

    removeRespawnText()
    {
        
    self waittill("remove_respawntext");

        if(
    isdefined(self.respawntext))
            
    self.respawntext destroy();
    }

    waitRemoveRespawnText(message)
    {
        
    self endon("remove_respawntext");

        
    self waittill(message);
        
    self notify("remove_respawntext");
    }

    startGame()
    {
        
    level.starttime getTime();

        if(
    level.timelimit 0)
        {
            
    level.clock newHudElem();
            
    level.clock.horzAlign "left";
            
    level.clock.vertAlign "top";
            
    level.clock.8;
            
    level.clock.2;
            
    level.clock.font "default";
            
    level.clock.fontscale 2;
            
    level.clock setTimer(level.timelimit 60);
        }

        for(;;)
        {
            
    checkTimeLimit();
            
    wait 1;
        }
    }

    endMap()
    {
    //Damole EndMapVote
        
    maps\mp\gametypes\_mapvote::Initialize();
    //DaMole    



        
    game["state"] = "intermission";
        
    level notify("intermission");

        
    players getentarray("player""classname");
        
    highscore undefined;
        
    tied undefined;
        
    playername undefined;
        
    name undefined;
        
    guid undefined;

        for(
    0players.sizei++)
        {
            
    player players[i];

            if(
    isdefined(player.pers["team"]) && player.pers["team"] == "spectator")
                continue;

            if(!
    isdefined(highscore))
            {
                
    highscore player.score;
                
    playername player;
                
    name player.name;
                
    guid player getGuid();
                continue;
            }

            if(
    player.score == highscore)
                
    tied true;
            else if(
    player.score highscore)
            {
                
    tied false;
                
    highscore player.score;
                
    playername player;
                
    name player.name;
                
    guid player getGuid();
            }
        }

        
    players getentarray("player""classname");
        for(
    0players.sizei++)
        {
            
    player players[i];

            
    player closeMenu();
            
    player closeInGameMenu();

            if(
    isdefined(tied) && tied == true)
                
    player setClientCvar("cg_objectiveText", &"MP_THE_GAME_IS_A_TIE");
            else if(
    isdefined(playername))
                
    player setClientCvar("cg_objectiveText", &"MP_WINS"playername);

            
    player spawnIntermission();
        }

        if(
    isdefined(name))
            
    logPrint("W;;" guid ";" name "\n");

        
    // set everyone's rank on xenon
        
    if(level.xenon)
        {
            for(
    0players.sizei++)
            {
                
    player players[i];

                if(
    isdefined(player.pers["team"]) && player.pers["team"] == "spectator")
                    continue;

                if(
    highscore <= 0)
                    
    rank 0;
                else
                {
                    
    rank int(player.score 10 highscore);
                    if(
    rank 0)
                        
    rank 0;
                }

                
    // since DM is a free-for-all, give every player their own team number
                
    setplayerteamrank(playerplayer.clientidrank);
            }
            
    sendranks();
        }

        
    wait 10;
        
    exitLevel(false);
    }

    checkTimeLimit()
    {
        if(
    level.timelimit <= 0)
            return;

        
    timepassed = (getTime() - level.starttime) / 1000;
        
    timepassed timepassed 60.0;

        if(
    timepassed level.timelimit)
            return;

        if(
    level.mapended)
            return;
        
    level.mapended true;

        if(!
    level.splitscreen)
            
    iprintln(&"MP_TIME_LIMIT_REACHED");

        
    level thread endMap();
    }

    checkScoreLimit()
    {
        
    waittillframeend;

        if(
    level.scorelimit <= 0)
            return;

        if(
    self.score level.scorelimit)
            return;

        if(
    level.mapended)
            return;
        
    level.mapended true;

        if(!
    level.splitscreen)
            
    iprintln(&"MP_SCORE_LIMIT_REACHED");

        
    level thread endMap();
    }

    updateGametypeCvars()
    {
        for(;;)
        {
            
    timelimit getCvarFloat("scr_dm_timelimit");
            if(
    level.timelimit != timelimit)
            {
                if(
    timelimit 1440)
                {
                    
    timelimit 1440;
                    
    setCvar("scr_dm_timelimit""1440");
                }

                
    level.timelimit timelimit;
                
    setCvar("ui_dm_timelimit"level.timelimit);
                
    level.starttime getTime();

                if(
    level.timelimit 0)
                {
                    if(!
    isdefined(level.clock))
                    {
                        
    level.clock newHudElem();
                        
    level.clock.horzAlign "left";
                        
    level.clock.vertAlign "top";
                        
    level.clock.8;
                        
    level.clock.2;
                        
    level.clock.font "default";
                        
    level.clock.fontscale 2;
                    }
                    
    level.clock setTimer(level.timelimit 60);
                }
                else
                {
                    if(
    isdefined(level.clock))
                        
    level.clock destroy();
                }

                
    checkTimeLimit();
            }

            
    scorelimit getCvarInt("scr_dm_scorelimit");
            if(
    level.scorelimit != scorelimit)
            {
                
    level.scorelimit scorelimit;
                
    setCvar("ui_dm_scorelimit"level.scorelimit);
                
    level notify("update_allhud_score");

                
    players getentarray("player""classname");
                for(
    0players.sizei++)
                    
    players[icheckScoreLimit();
            }

            
    wait 1;
        }
    }

    menuAutoAssign()
    {
        if(
    self.pers["team"] != "allies" && self.pers["team"] != "axis")
        {
            if(
    self.sessionstate == "playing")
            {
                
    self.switching_teams true;
                
    self suicide();
            }

            
    teams[0] = "allies";
            
    teams[1] = "axis";
            
    self.pers["team"] = teams[randomInt(2)];
            
    self.pers["weapon"] = undefined;
            
    self.pers["savedmodel"] = undefined;

            
    self setClientCvar("ui_allow_weaponchange""1");

            if(
    self.pers["team"] == "allies")
                
    self setClientCvar("g_scriptMainMenu"game["menu_weapon_allies"]);
            else
                
    self setClientCvar("g_scriptMainMenu"game["menu_weapon_axis"]);

            
    self notify("joined_team");
            
    self notify("end_respawn");
        }

        if(!
    isdefined(self.pers["weapon"]))
        {
            if(
    self.pers["team"] == "allies")
                
    self openMenu(game["menu_weapon_allies"]);
            else
                
    self openMenu(game["menu_weapon_axis"]);
        }
    }

    menuAllies()
    {
        if(
    self.pers["team"] != "allies")
        {
            if(
    self.sessionstate == "playing")
            {
                
    self.switching_teams true;
                
    self suicide();
            }

            
    self.pers["team"] = "allies";
            
    self.pers["weapon"] = undefined;
            
    self.pers["savedmodel"] = undefined;

            
    self setClientCvar("ui_allow_weaponchange""1");
            
    self setClientCvar("g_scriptMainMenu"game["menu_weapon_allies"]);

            
    self notify("joined_team");
            
    self notify("end_respawn");
        }

        if(!
    isdefined(self.pers["weapon"]))
            
    self openMenu(game["menu_weapon_allies"]);
    }

    menuAxis()
    {
        if(
    self.pers["team"] != "axis")
        {
            if(
    self.sessionstate == "playing")
            {
                
    self.switching_teams true;
                
    self suicide();
            }

            
    self.pers["team"] = "axis";
            
    self.pers["weapon"] = undefined;
            
    self.pers["savedmodel"] = undefined;

            
    self setClientCvar("ui_allow_weaponchange""1");
            
    self setClientCvar("g_scriptMainMenu"game["menu_weapon_axis"]);

            
    self notify("joined_team");
            
    self notify("end_respawn");
        }

        if(!
    isdefined(self.pers["weapon"]))
            
    self openMenu(game["menu_weapon_axis"]);
    }

    menuSpectator()
    {
        if(
    self.pers["team"] != "spectator")
        {
            if(
    isAlive(self))
            {
                
    self.switching_teams true;
                
    self suicide();
            }

            
    self.pers["team"] = "spectator";
            
    self.pers["weapon"] = undefined;
            
    self.pers["savedmodel"] = undefined;

            
    self.sessionteam "spectator";
            
    self setClientCvar("ui_allow_weaponchange""0");
            
    spawnSpectator();

            if(
    level.splitscreen)
                
    self setClientCvar("g_scriptMainMenu"game["menu_ingame_spectator"]);
            else
                
    self setClientCvar("g_scriptMainMenu"game["menu_ingame"]);

            
    self notify("joined_spectators");
        }
    }

    menuWeapon(response)
    {
        if(!
    isdefined(self.pers["team"]) || (self.pers["team"] != "allies" && self.pers["team"] != "axis"))
            return;

        
    level notify("chkWeapLimits");

        
    weapon self maps\mp\gametypes\_weapons::restrictWeaponByServerCvars(response);

        if(
    weapon == "restricted")
        {
            if(
    self.pers["team"] == "allies")
                
    self openMenu(game["menu_weapon_allies"]);
            else if(
    self.pers["team"] == "axis")
                
    self openMenu(game["menu_weapon_axis"]);

            return;
        }

        if(
    level.splitscreen)
            
    self setClientCvar("g_scriptMainMenu"game["menu_ingame_onteam"]);
        else
            
    self setClientCvar("g_scriptMainMenu"game["menu_ingame"]);

        if(
    isdefined(self.pers["weapon"]) && self.pers["weapon"] == weapon)
            return;

        if(!
    isdefined(self.pers["weapon"]))
        {
            
    self.pers["weapon"] = weapon;
            
    spawnPlayer();
        }
        else
        {
            
    self.pers["weapon"] = weapon;

            
    weaponname maps\mp\gametypes\_weapons::getWeaponName(self.pers["weapon"]);

            if(
    maps\mp\gametypes\_weapons::useAn(self.pers["weapon"]))
                
    self iprintln(&"MP_YOU_WILL_RESPAWN_WITH_AN"weaponname);
            else
                
    self iprintln(&"MP_YOU_WILL_RESPAWN_WITH_A"weaponname);
        }


  10. #9
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    and what is your question?
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  11. #10
    Private First Class
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    37
    Thanked 14 Times in 14 Posts
    how can i run this ip ban script ? didnt work

Posting Permissions

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