Перейти к содержимому
View in the app

A better way to browse. Learn more.

Zloplay community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Release] restrictions/ customizations mod v1.1

Опубликовано:

Hey,

 

this mod is highly customizable. In its "stock" state it will do almost nothing.

Server owners can customize it by using certain dvars.

You can restrict any weapons, attachments, perks, deathstreaks, killstreaks, equipment, offhand nades and even weapon-attachement combos you want to by just setting dvars in your server.cfg. You don't have to touch the .gsc files at all.

Besides that you can customize the needed amount consecutive kills for any killstreaks you want by just setting dvars. I've also integrated some of my "mini-releases", so that this mod offers an alternative teambalancing method (balance by lowest time on server, instead of lowest "team-time) and dvars to adjust the behaviour of the nuke.

 

Video:

(used dvars setting in this video)

	//blocking all ump45's
set scr_allow_ump45 "0"
//block ak with only gl attached 
set scr_allow_ak47_gl_mp "0"
//blocking all g18's with akimbo
set scr_allow_glock_akimbo_mp "0"
set scr_allow_glock_akimbo_fmj_mp "0"
set scr_allow_glock_akimbo_silencer_mp "0"
set scr_allow_glock_akimbo_xmags_mp "0"
//blocking all aa12's
set scr_allow_aa12 "0"
//remove all thermal attachments
set scr_allow_thermal "0"
//restrict claymore
set scr_allow_claymore_mp "0"
//restrict commando perk
set scr_allow_specialty_extendedmelee "0"

 

Lets start with the list of dvars you can use to adjust the mod to your likings:

The dvars should be set in the server.cfg.

 

basic syntax to restrict something:

set scr_allow_THINGTOBERESTRICTED "0"

 

//Restrict certain weapons

(the weapon as a whole, unregarded which attachment it has, it will be replaced by one of the "default weapon(s) you may define)

 

set scr_allow_ump45 "0"

set scr_allow_spas12 "0"

---> this will disable ump45 and spas12 completely. You can specify any weapon you want, including secondary weapons.

 

//Restrict certain weapon-attachment combinations

only the attachment will be removed, the weapon stays

set scr_allow_ump45_silencer_mp "0"

---> this will only disallow ump45 with the silencer attached. The silencer will be removed and the player spawns with ump45 without attachments

 

//Restrict certain attachments completly

set scr_allow_silencer "0"

---> this will remove the silencer on every weapon and the player spawns with the "base" weapon

 

//Restrict certain equipment

set scr_allow_semtex_mp "0"

---> this will remove specified equipment and replace it by a default one you may define

 

Well, i guess you got the basic idea and dvars syntax.To shorten this i will just put some more examples:

set scr_allow_concussion_grenade "0" //disable an offhand grenade

set scr_allow_specialty_marathon "0" //disable a perk

set scr_allow_nuke "0" //disable a killstreak

Of course these are just examples!

 

The restricted things will be replaced by default ones when the player spawns. You may change them:

If there is more then one weapon etc. defined, one will be chosen randomly

//multiple definitions possible, seperated by a ,

set scr_default_primarys "m4,famas"

set scr_default_secondarys "usp"

set scr_default_perks1 "specialty_fastreload,specialty_scavenger"

set scr_default_perks2 "specialty_bulletdamage"

set scr_default_perks3 "specialty_bulletaccuracy,specialty_detectexplosive"

 

//only one defintion possible

set scr_default_equipment "frag_grenade_mp"

set scr_default_offhand "smoke_grenade"

set scr_default_deathstreak "none"

set scr_default_killstreak1 "uav"

set scr_default_killstreak2 "predator_missile"

set scr_default_killstreak3 "emp"

 

 

//Change the amount of consecutive kills needed for certain killstreaks

basic syntax

set scr_streakcount_KILLSTREAKNAMEHERE VALUEHERE

set scr_streakcount_harrier_airstrike "8"

--> killstreak of 8 needed to achieve harrier, the value has to be >2

 

//Other usefull dvars: 1= on 0 = off

set scr_one_flash "0" //only 1 stun/ flash instead of 2

set scr_one_stun "0"

set scr_nuke_all "1" //nuke kills all/enemies only

set scr_nuke_endsgame "1" //nuke ends the game / doesn't end it

set scr_restriction_messages "1" //show restriction messages to the player when he spawns

set scr_teambalance_new "1" //use alternative teambalance routine

set scr_allow_unbalance "0" //allow the player to choose the team which has already more players

 

If the restriction messages are enabled on the server, players can still disable/reenable for themselves by pressing actionslot2 button.

 

Credits to me (banz) and to lmaobox for the alternative getJoinTeamPermission function.

 

Please report any bugs.

 

UPDATE v1.1:

- better restriction messsage handling
- added a dvar list to the attachments

 

Virustotal v1.1:

https://www.virustotal.com/file/ff9d301 ... 344433120/

 

Virustotal dvarlist:

https://www.virustotal.com/file/09c80be ... 350673652/

  • Ответы 53
  • Просмотры 3,8k
  • Created
  • Последний ответ

Top Posters In This Topic

Featured Replies

Опубликовано:
  • Автор
1000 + dvars?

 

Nope, no need to initialize every possible weapon-attachment-combo and such. I've just set 18 dvars for default settings. ;)

Lots of possible dvars to set indeed, but i guess most people wont restrict more than 10 things.

 

setDvarIfUninitialized( "scr_default_primarys", "m4,famas" );
setDvarIfUninitialized( "scr_default_secondarys", "usp" );
setDvarIfUninitialized( "scr_default_perks1", "specialty_fastreload,specialty_scavenger" );
setDvarIfUninitialized( "scr_default_perks2", "specialty_bulletdamage" );
setDvarIfUninitialized( "scr_default_perks3", "specialty_bulletaccuracy,specialty_detectexplosive" );

//only one defintion possible
setDvarIfUninitialized( "scr_default_equipment", "frag_grenade_mp" );
setDvarIfUninitialized( "scr_default_offhand", "smoke_grenade" );
setDvarIfUninitialized( "scr_default_deathstreak", "none" );
setDvarIfUninitialized( "scr_default_killstreak1", "uav" );
setDvarIfUninitialized( "scr_default_killstreak2", "predator_missile" );
setDvarIfUninitialized( "scr_default_killstreak3", "emp" );

//message
setDvarIfUninitialized( "scr_restriction_messages", 1 );

//nuke
setDvarIfUninitialized( "scr_nuke_all", 1 );
setDvarIfUninitialized( "scr_nuke_endsgame", 1 );

//flash/stun
setDvarIfUninitialized("scr_one_flash", 0);
setDvarIfUninitialized("scr_one_stun", 0);

//teambalance
setDvarIfUninitialized("scr_teambalance_new", 0);
setDvarIfUninitialized("scr_allow_unbalance", 1);

 

 

The restrictions are basically done with just 4 lines of code:

 

isAllowedThing( thingString ) {
if( getDvar("scr_allow_"+thingString) != "" && !getDvarInt("scr_allow_"+thingString))
	return false;

return true;
}

 

called from the right places ofc...

 

EDIT: Added the download link. Look at the first post. ;)

Опубликовано:

That's a great mod, those should be default commands for servers as they were with cod4. What would be perfect is a ModWarfare mod as in cod4.

 

-You can change your classes weapons/perks in game

-You can see the list of weapons/perks to be able to select them in game

-The weapons/perks disabled by the server are grayed out and cannot be selected

-An option to unrank the server or to let everyone select every weapon/perk regardless of their rank

 

With this mod and your promod in which you are creating weapon selection menu, it would be easily doable.

Опубликовано:

Looks cool, but I was wondering if something could be done to the code to not restrict a weapon/perk, but rather give it to all players.

 

Like if I'd want everyone to have marathon pro on my server, but they're still able to select a first perk for themselves, that is have their perks plus the one I give them.

 

And also, how would I go about giving everyone max/full ammo from start, but not the scavenger perk.

 

I had seen something like onplayerspawn give full ammo in _rank or _class and that did the trick for me, but can't find the custom mod for myself now.

 

Thanks in advance.

Опубликовано:
  • Автор

And also, how would I go about giving everyone max/full ammo from start, but not the scavenger perk.

 

Thanks in advance.

 

Go to the mods _class.gsc and search for:

 

	if ( self hasPerk( "specialty_extraammo", true ) && getWeaponClass( secondaryName ) != "weapon_projectile" )
	self giveMaxAmmo( secondaryName );

and

	if ( self hasPerk( "specialty_extraammo", true ) )
	self giveMaxAmmo( primaryName );

 

Remove the if statements to get full ammo on secondary and primary on spawn.

You might want to leave the if ( getWeaponClass( secondaryName ) != "weapon_projectile" ) ) in for secondaries... ;)

 

Like if I'd want everyone to have marathon pro on my server, but they're still able to select a first perk for themselves, that is have their perks plus the one I give them.

 

add this below the self giveMaxAmmo( primaryName ); line.

 

self _setPerk( "specialty_fastmantle" );

Опубликовано:
  • Автор
That setPerk for marathon didn't work, all else is epic! :)

 

Oh, yes didn't test it...

Anyway look for this part of code in _class.gsc:

 

	self maps\mp\perks\_perks::givePerk( loadoutEquipment );
self maps\mp\perks\_perks::givePerk( loadoutPerk1 );
self maps\mp\perks\_perks::givePerk( loadoutPerk2 );
self maps\mp\perks\_perks::givePerk( loadoutPerk3 );

and add

self maps\mp\perks\_perks::givePerk( "specialty_marathon" );

 

below. That will work.

 

 

Could it be due to the sprint duration that is set in the serverg.cfg?

 

What dvar are you talking about and to what did you set it in your server.cfg?

Опубликовано:
  • Автор

set scr_player_sprinttime "4" // Sprint time, duration a player can run.

And that is the default value. Also, that giveperk didn't work too. :(

 

Hmm, it defintely does work. I've tested it myself.

Keep in mind that the hud won't show both perks in slot1, as it can only show one perk per slot.

But the perk is still given and fully functional. If you put

self maps\mp\perks\_perks::givePerk( "specialty_marathon" );

diretly above the other giveperk functions, it will show the perk1 the player has chosen in his class. If you put it below it will show the marathon perk.

Опубликовано:

lol it does work actually. What I did was edit the _class.gsc in my m2demo folder, and not the one from the mod, so obv the mod's _class.gsc had a priority over it. My bad :P

 

But one thing I noticed is that marathon can be given this way, but not marathon pro, ie. fastmantle. Or is it called in another way?

 

And I have restricted some weapons and perks, including the stopping power as it's a low hp server. But when I enter server with SP pro, it just says, replacing specialty_bulletdamage with specialty_bulletdamage.

lol stopping power is the default alternative second perk as I see it now, so will just have to change that :)

 

Finally, is there a way to have weapons, perks, deathstreaks etc. removed, but not replaced with anything? I've seen a server show empty slots for restricted perks.

 

And really appreciate all the help.

Thanks.

Опубликовано:
  • Автор

But one thing I noticed is that marathon can be given this way, but not marathon pro, ie. fastmantle. Or is it called in another way?

 

EDIT: Try to give both, first marathon then fastmantle, like this:

	self maps\mp\perks\_perks::givePerk( "specialty_marathon" );
self maps\mp\perks\_perks::givePerk( "specialty_fastmantle" ); 

 

Finally, is there a way to have weapons, perks, deathstreaks etc. removed, but not replaced with anything? I've seen a server show empty slots for restricted perks.

 

Just setting the scr_default_blabla dvars to "none" should work.

  • 3 weeks later...
Опубликовано:

Ah, thanks for that edit.

But now, I got another issue I just found about...I read something about a different calling method in iw4m, than it was in aIW. So, when I load the mod, it would give errors to 'legacy' client players, and the error simply contains the mod's name ie., 'z_svr_restrictions.iwd different from the server'. So what I did was extracted and replaced all the files of the mod with the original ones and now, not sure if it works with legacy clients, but it sure doesn't on iw4m.

 

Was going to create a topic for the issue, but thought might as well bump this useful mod. ;)

Опубликовано:
  • Автор

Did you try extracting the z_svr_restrictions.iwd and place the maps folder in your severs m2demo folder? (overwrite the existing .gsc files, you might want to make a backup of the m2demo folder before doing so)

And after that remove the z_svr_restrictions.iwd from your m2demo folder of course.

  • 3 weeks later...
Опубликовано:

Hey, so I added the following lines into the server.cfg, yet it still isnt working:

 

set scr_allow_gl_ak47_mp "0"

set scr_allow_ak47_shotgun_attach_mp "0"

set scr_allow_gl_m16_mp "0"

set scr_allow_m16_shotgun_attach_mp "0"

set scr_allow_gl_m4_mp "0"

set scr_allow_m4_shotgun_attach_mp "0"

set scr_allow_gl_fn2000_mp "0"

set scr_allow_fn2000_shotgun_attach_mp "0"

set scr_allow_gl_masada_mp "0"

set scr_allow_masada_shotgun_attach_mp "0"

set scr_allow_gl_famas_mp "0"

set scr_allow_famas_shotgun_attach_mp "0"

set scr_allow_gl_fal_mp "0"

set scr_allow_fal_shotgun_attach_mp "0"

set scr_allow_gl_scar_mp "0"

set scr_allow_scar_shotgun_attach_mp "0"

set scr_allow_gl_tavor_mp "0"

set scr_allow_tavor_shotgun_attach_mp "0"

set scr_allow_model1887_akimbo_mp "0"

set scr_allow_model1887_fmj_mp "0"

set scr_allow_model1887_akimbo_fmj_mp "0"

set scr_allow_ranger_akimbo_mp "0"

set scr_allow_ranger_fmj_mp "0"

set scr_allow_ranger_akimbo_fmj_mp "0"

set scr_allow_concussion_grenade "0"

set scr_default_offhand "flash_grenade"

set scr_allow_airdrop "0"

set scr_allow_specialty_finalstand "0"

set scr_allow_specialty_pistoldeath "0"

set scr_allow_specialty_extendedmelee "0"

set scr_default_perks3 "specialty_bulletaccuracy,specialty_detectexplosive"

set scr_allow_specialty_onemanarmy "0"

set scr_default_perks1 "specialty_fastreload"

 

I extracted the .iwd file and placed it in the m2demo/maps directory. However, its still allowing each of those. Am I missing something?

Опубликовано:
  • Автор

So your folder struture is m2demo\maps\mp\gametypes\(_class.gsc,_teams.gsc)

and m2demo\maps\mp\killstreaks\(_nuke.gsc,_killstreaks.gsc) ?

 

And you have to overwrite the existing .gsc files in those folders with the one from the mod. You might want to make a backup of your m2demo folder first.

Опубликовано:

Yup, that's what it is. I even removed the original files before bringing it over.

  • 3 weeks later...
Опубликовано:
  • Автор
Hey, so I added the following lines into the server.cfg, yet it still isnt working:

 

-dvar list-

 

I extracted the .iwd file and placed it in the m2demo/maps directory. However, its still allowing each of those. Am I missing something?

 

Oh damn. There was a mistake in the dvar list (it had singleplayer weapon names in it).

So that's why some of the dvars you used weren't working.

I've uploaded a fixed dvar list now. Please redownload (first post).

 

It seems like you want to restrict gl and shotgun attachment completely on all possible weapons, so you can just use these dvars:

 

set scr_allow_gl "0"
set scr_allow_shotgun "0"
set scr_allow_model1887_akimbo_mp "0"
set scr_allow_model1887_fmj_mp "0"
set scr_allow_model1887_akimbo_fmj_mp "0"
set scr_allow_ranger_akimbo_mp "0"
set scr_allow_ranger_fmj_mp "0"
set scr_allow_ranger_akimbo_fmj_mp "0"
set scr_allow_concussion_grenade "0"
set scr_default_offhand "flash_grenade"
set scr_allow_airdrop "0"
set scr_allow_specialty_finalstand "0"
set scr_allow_specialty_pistoldeath "0"
set scr_allow_specialty_extendedmelee "0"
set scr_default_perks3 "specialty_bulletaccuracy,specialty_detectexplosive"
set scr_allow_specialty_onemanarmy "0"
set scr_default_perks1 "specialty_fastreload"

  • 1 month later...
Опубликовано:

edit: it seems I've solved my problem

Опубликовано:
  • Автор

I'd like to add some promod functionality, and/or set certain variables such as cg_maxpackets, snaps, rate or cg_fovscale for all players

 

What do you want to add exactly?

Also, you shouldn't force certain snaps/rate values...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Гость
Ответить в тему...

Сейчас на странице 0

  • Нет пользователей, просматривающих эту страницу

Важная информация

Используя этот сайт, вы соглашаетесь Условия использования.

Account

Navigation

Поиск

Поиск

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.