Thread: [Plugin] PVP Enable

Results 1 to 4 of 4
  1. #1
    Registered User Dr.Abc's Avatar
    Join Date
    Sep 2018

    Post [Plugin] PVP Enable

    Much Thanks to w00tguy!
    I learned from his plugin how to adjust armor's ratio!
    And part of this plugin comes from his code!

    A very simple plugin to enable players pvp.
    You can chose FFA , TDM for time or TDM for scores.

    To use it you should put these in your svencoop/default_plugin.txt
            "name" Pvp
            "script" Pvp
    And create a file named PVPMapList.txt in scripts/plugin like this
    crossfire 0 0
    crossfireTDM 1 140
    crossfireTDMScore 2 77
    corssfireZM 3 3000
    0 = FFA,None = Default secs.
    1 = TDM For time,140 = 140 secs.
    2 = TDM For scores,77 = 77 scores.
    3 = Zombie Mode,3000 = 3000s for totally time.

    To change gameplay you could use these commands in game console.
    .weaponmode_multi - Change weapons mode, multiplay or not.
    .votedmlms - Vote for LMS rule.
    .votedmdrop - Drop a compression tank instead a weapon.
    .votedmrule - Vote for classical weapons
    .votedmarcade - Vote for Arcade rule.
    You can also change these command in scripts/plugins/pvp/
    class CDMCommandBench
    	void CommandPluginInit()
    		g_DMCommandBench.CommandRegister("weaponmode_multi","Change Weapon Mode multiplay or not","Class",@CGameRules::MultiCallBack);
    		g_DMCommandBench.CommandRegister( "votedmlms", "starts the LMS Mode vote", "LMS",@CLMSVote::StartLMSModeVote );
    		g_DMCommandBench.CommandRegister( "votedmdrop", "starts the HLDM drop Mode vote", "Drop Rule", @CDropWeaponBoxVote::StartDropModeVote );
    		g_DMCommandBench.CommandRegister( "votedmrule", "starts the DM rule Mode vote", "Vote Rule", @CVoteDMRule::DMRuleVoteCallback );
    		g_DMCommandBench.CommandRegister( "votedmarcade", "starts the arcade Mode vote", "Arcade", @CVoteArcade::DMArcadeVoteCallback );
    		@CDMCommandBench::g_CommandListKey = CDMCommandBench::g_CommandList.getKeys();
    	void CommandRegister( string szName, string szHelpInfo, string szPrintf, DMCCallback@ pCallback, int iFlags = 0 )
    		CDMCommandBench::RegistCommand( szName, szHelpInfo, szPrintf, @pCallback );
    You could put custom supply points in scripts/plugins/pvp/config/LMSVector/MapName.ini
    If this file does not exist, safe area and supply points will be a random spwan point.
    For example, crossfire.ini
    -152.111313 681.038452 -1406.543091
    471.237457 -1001.031006 -973.340576
    -776.376709 -667.014221 -1107.672852
    -0.868181 -1621.921753 -1096.24585
    then you need create another file named pvp_skl.txt in scripts/plugin and put these sh1t in it.
    mp_banana 0
    mp_nomedkit 1
    mp_grapple_mode 1
    mp_forcerespawn 1
    mp_falldamage 0
    mp_modelselection 0
    mp_multiplespawn 0
    mp_weaponstay 0
    mp_weapon_droprules 2
    mp_ammo_droprules 2
    mp_item_respawndelay 30
    mp_ammo_respawndelay 30
    mp_weapon_respawndelay 30
    mp_weaponfadedelay 120
    mp_disable_autoclimb 1
    mp_disable_pcbalancing 1
    mp_disable_medkit_points 1
    weaponmode_shotgun 1
    weaponmode_displacer 1
    sv_accelerate 10
    sv_airaccelerate 10
    sv_friction 4
    sv_gravity 800
    sv_maxspeed 270
    sv_maxvelocity 4096
    sv_wateraccelerate 10
    sv_waterfriction 1
    sv_zmax 16000
    sk_player_head 3.8
    sk_player_chest 1
    sk_player_stomach 1
    sk_player_arm 0.7
    sk_player_leg 0.7
    sk_suitcharger 35
    sk_battery 15
    sk_healthcharger 60
    sk_healthkit 15
    sk_plr_crowbar 10
    sk_plr_9mm_bullet 15
    sk_plr_357_bullet 40
    sk_plr_9mmAR_bullet 8
    sk_plr_9mmAR_grenade 100
    sk_plr_buckshot 5
    sk_plr_xbow_bolt_monster 140
    sk_plr_rpg 100
    sk_plr_gauss 30
    sk_plr_secondarygauss 270
    sk_plr_egon_narrow 6
    sk_plr_egon_wide 14
    sk_plr_hand_grenade 100
    sk_plr_satchel 150
    sk_plr_tripmine 150
    sk_plr_HpMedic 10
    sk_plr_wrench 20
    sk_plr_grapple 25
    sk_plr_uzi 10
    sk_556_bullet 15
    sk_hornet_pdmg 12
    sk_plr_762_bullet 100
    sk_plr_spore 50
    sk_plr_shockrifle 15
    sk_shockroach_dmg_xpl_touch 350
    sk_shockroach_dmg_xpl_splash 150
    sk_plr_displacer_other 250
    sk_plr_displacer_radius 300
    This plugin could only work with these which none-pvp maps. For example ,you can just copy and put HLDM or OF map into SC with this plugin .
    If you add a map with build-in pvp into list ,it will mess this plugin and this plugin won't work correctly.

    And you can do some settings in the the header of the as file.
    const float g_WaitingTime = 30;                        //TDM Waiting Time
    const int g_WarningTime = 60;                        //Warning Time
    const int g_iBanlance = 2;                        //The gap for autobalance (minimum is 2)
    const int g_LeftTime = 600;                        //Default Game time
    const int g_MaxScore = 50;                        //Defalut Max team score
    const int HUD_CHAN_PVP = 14;                        //HUD Channel
    const int m_strBatteryHealth = 7;            //Battery supplies
    const string g_PVPMapFile = "scripts/plugins/PVPMapList.txt";        //file name
    const string g_PVPSkillFile = "scripts/plugins/pvp_skl.txt";        //file name
    const string MenuTitle = "Chose Your Team";            //Chose Your Team
    const bool IsClassMode     = true;                        //Is classic Mode
    const float ARMOR_RATIO = 0.2f;                     //80% Ratio
    const float ARMOR_BONUS = 0.5f;                        //150% Bounus
    About ZM.
    I was yelled to add ZM mode to SC before, then I said "okey" and wrote these things.
    const float m_flGatherMaxTime  = 20.0f; 
    //Escape time before the first zombies appear
    const float g_ZMTiemLeft = 200.0f; 
    //Every round time
    const float IntitalZombieGrav = 0.8;
    //Intital Zombie gravity. sv_gravity * 0.8
    const float ZombieGrav = 0.9;
    //Victim Zombie gravity
    const Vector ZombieEyeColor = Vector(191,42,42);
    //Zombie night vision color
    const int MultiShock = 9;
    //Weapon shock times
    const int ZombieSpeed = 300;
    //Zombie max speed
    const int HumanSpeed = 270;
    //Human max speed
    const int IntitalZombieHP = 500;
    //Intital Zombie HP, HP = this const * player count
    const int ZombieHP = 200;
    //Victim Zombie HP
    const int BHopLimit = 400;
    //Max speed limit, no more BHop Marathon
    const bool CanWeBHop = false;
    //Can we BHop?
    const string MapLight = "d";
    //Map light level, a to z.
    const string NVpharse = "nvsight";
    //Toggle night vision keyword
    const string ZMSkyName = "carnival";
    //Map sky name
    const array<array<string>> g_ZMSkill;
    //Zombie mode server CVar
    array<string> pWeaponList = {
    //Human weapons list
    array<string> pWeaponCLList =
    //Human Classical weapons list
    array<string> sWeaponList = {
    //Human Secconary Weapons list
    array<string> sWeaponCLList = {
    //Human Classical Secconary weapons list
    array<string> AllAmmoList = {
    //Human ammo list
    const int HUD_CHAN_DAMA = 9;
    //HUD Channel
    const int ZombieRegenTime = 7;
    //Zombie regen gap
    const int ZombieRegenAmount = 100;
    //Zombie regen amount
    const string PlayerSpeakPharse = "buy";
    //Players call out the key words needed to buy the menu, !buy or /buy
    const array<array<string>> HumanItemKeys = {
    //Human Buy menu
    //Name Item Price
    const array<string> AmmoList = {
    //Human ammo menu
    const array<string>ExpList = {
    //Human Explosive menu

    Click image for larger version. 

Name:	20181210223023_1.jpg 
Views:	201 
Size:	312.2 KB 
ID:	18269Click image for larger version. 

Name:	20181210224517_1.jpg 
Views:	161 
Size:	332.2 KB 
ID:	18271Click image for larger version. 

Name:	20181210224451_1.jpg 
Views:	139 
Size:	262.7 KB 
ID:	18270

    Get the code here.

    sometimes i forgot - Add LMS/Zombie/Arcade Mode
    2018/12/20 - Add support for maps which use info_ctfspawn as spawn.

    To Do
    For some reasons, it is difficult to implement DM without team in SC.You see, every player in game will assign to a team which can not attack its teammates in default.
    This means that in order to implement FFA at present, I have to manually assign each player to the default classify, which means game play will broken with too many players(above 14.)
    To solve this problem, I set the player's Hitbox to null, bind an invisible monster entity to each player, and delivery the damage received by the monster to the player.
    However, this method will lead to projectile weapons(rpg, satchel, crossbow, etc.) stuck with that monster entity.
    For now, i'm working on solving this problem.
    Last edited by Dr.Abc; 24-12-2019 at 12:58 AM. Reason: Operition Health...

  2. #2
    Registered User
    Join Date
    Feb 2017

    Re: [Plugin] PVP Enable

    Hello this script is only for TDM ?
    Can you invite DM please?

  3. #3
    Server Owner Enrory's Avatar
    Join Date
    Dec 2016

    Re: [Plugin] PVP Enable

    ye pls add pvp deathmatch without teams.

  4. #4
    Registered User
    Join Date
    Jul 2010

    Re: [Plugin] PVP Enable

    Interesting idea. pvp deathmatch plugin would be very popular I believe.

Posting Permissions

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