Перейти к содержимому
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.

Featured Replies

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

Hello is it possible to create a mod with class limits for example

 

setDvar( "class_assault_limit", 0 );

setDvar( "class_specops_limit", 2 );

setDvar( "class_demolitions_limit", 1 );

setDvar( "class_sniper_limit", 1 );

 

setDvar( "class_assault_allowdrop", 1 );

setDvar( "class_specops_allowdrop", 1 );

setDvar( "class_demolitions_allowdrop", 0 );

setDvar( "class_sniper_allowdrop", 0 );

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

For the dropping part it's pretty much just this on init() in _weapons.gsc (doesn't really matter in which file...):

	setDvarIfUninitialized( "class_assault_allowdrop", 1 );
setDvarIfUninitialized( "class_specops_allowdrop", 1 );
setDvarIfUninitialized( "class_demolitions_allowdrop", 0 );
setDvarIfUninitialized( "class_sniper_allowdrop", 0 );

and changing the dropWeaponForDeath( attacker ) function in _weapons.gsc to:

dropWeaponForDeath( attacker )
{
weapon = self.lastDroppableWeapon;

if ( isdefined( self.droppedDeathWeapon ) )
	return;

if ( level.inGracePeriod )
	return;

if ( !isdefined( weapon ) || weapon == "none" || !self hasWeapon( weapon )  )
	return;

if ( weapon != "riotshield_mp" )
{
	if ( !(self AnyAmmoForWeaponModes( weapon )) )
	{
		return;
	}
	//weapon dropping... banz
	weaponClass = getWeaponClass( weapon );	

	if( isPrimaryWeapon( weapon ) )
	{
		switch ( weaponClass )
		{
			case "weapon_assault":
				if ( !getDvarInt( "class_assault_allowdrop" ) )
				return;
			break;

			case "weapon_smg":
				if ( !getDvarInt( "class_specops_allowdrop" ) )
				return;
			break;

			case "weapon_sniper":
				if ( !getDvarInt( "class_sniper_allowdrop" ) )
				return;
			break;

			case "weapon_shotgun":
				if ( !getDvarInt( "class_demolitions_allowdrop" ) )
				return;
			break;

			default:
				break;
		}
	}
	//
	clipAmmoR = self GetWeaponAmmoClip( weapon, "right" );
	clipAmmoL = self GetWeaponAmmoClip( weapon, "left" );
	if ( !clipAmmoR && !clipAmmoL )
	{
		return;
	}

	stockAmmo = self GetWeaponAmmoStock( weapon );
	stockMax = WeaponMaxAmmo( weapon );
	if ( stockAmmo > stockMax )
		stockAmmo = stockMax;

	item = self dropItem( weapon );
	item ItemWeaponSetAmmo( clipAmmoR, stockAmmo, clipAmmoL );
}
else
{
	item = self dropItem( weapon );	
	if ( !isDefined( item ) )
		return;
	item ItemWeaponSetAmmo( 1, 1, 0 );
}

self.droppedDeathWeapon = true;

item.owner = self;
item.ownersattacker = attacker;

item thread watchPickup();

item thread deletePickupAfterAWhile();

detach_model = getWeaponModel( weapon );

if ( !isDefined( detach_model ) )
	return;

if( isDefined( self.tag_stowed_back ) && detach_model == self.tag_stowed_back )
	self detach_back_weapon();

if ( !isDefined( self.tag_stowed_hip ) )
	return;

if( detach_model == self.tag_stowed_hip )
	self detach_hip_weapon();
}

 

Ready to go _weapons.gsc:

http://pastebin.com/PYV8k1tR

 

The class limiting requires more code changes though. I might do that later.

Опубликовано:
and this dvars ?

 

setDvar( "class_assault_limit", 0 );

setDvar( "class_specops_limit", 2 );

setDvar( "class_demolitions_limit", 1 );

setDvar( "class_sniper_limit", 1 );

 

Use this as

_menus.gsc (you might also want to look at my comments in the file) :

http://pastebin.com/fRNUrGb4

 

You can use these dvars:

/*	0 means unlimited
**	-1 means restricted
**	1 means one player can have it and so on.. (duh)
*/
setDvar( "class_assault_limit", 0 );
setDvar( "class_specops_limit", 2 );
setDvar( "class_demolitions_limit", 2 );
setDvar( "class_sniper_limit", 1 );
setDvar( "class_lmg_limit", -1 );  //light machine gun
setDvar( "class_riot_limit", 0 ); //riot shield

 

dropping dvars:

setDvar( "class_assault_allowdrop", 1 );
setDvar( "class_specops_allowdrop", 1 );
setDvar( "class_demolitions_allowdrop", 0 );
setDvar( "class_sniper_allowdrop", 0 );
setDvar( "class_lmg_allowdrop", 0 );
setDvar( "class_riot_allowdrop", 1 );

_weapons.gsc : http://pastebin.com/V4YkzC7n

 

class_demolitions_limit won't do anything as of now , as i only test the primary weapons class and shotguns are secondary weapons in vanilla...

I could add a check for shotguns, if you need it though.

 

Attached the ready to go .iwd...

https://www.virustotal.com/de/file/7d6d ... 363266728/

Join the conversation

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

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

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

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

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

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

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.