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

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

The script keeps giving me the error "exceeded maximum number of child0 scripts"

the mod itself loads but then once i spawn it freezes and gives that error.

Im pretty sure the error is in all the m40, w1200 and defultgun threads cause i copy pasted them.

Couldn't figure out how to use the code box thing so http://pastebin.com/HmfcXrG6

help would be helpful.

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

Uhm, could you explain exactly what you want the script 'to do' even?

 

I don't get why you put a loop in here e.g.:

 

    for(; //why looping? the thread is called everytime a player spawns...
               {
                       self endon("death"); //what is that doing here?!
                       if(getDvar("mapname") == "oilrig") { 
                               if (self.m40 == true) {
                                       self takeWeapon( curWep );

                                       wait 0.001;

                                       self giveWeapon( "m40a3", 0, false );
                                       wait 0.001;

                                       self switchToWeapon("m40a3");

                                       wait 0.05; 

                                       self giveMaxAmmo ("m40a3");
                                       }
                       } else {
                               self iPrintLnBold( "M40A3 Only Works On Oilrig" );
               }

 

Also, please use proper indentation next time and not so many huge white spaces....

Опубликовано:
  • Автор
Uhm, could you explain exactly what you want the script 'to do' even?

 

I don't get why you put a loop in here e.g.:

 

 

I guess i could have been more descriptive, all it does is when you do +weap it takes you current wepon and vies you the m40, w1200, or the gun you had at the start. as for the forever loop it is there so when you do +weap it works, and the endon is there cause i threaded it in onplayerspawned and i don't want many copy's of the same thread running at once.

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

I guess i could have been more descriptive, all it does is when you do +weap it takes you current wepon and vies you the m40, w1200, or the gun you had at the start. as for the forever loop it is there so when you do +weap it works,

Ah, now i understand what you want.

 

 

and the endon is there cause i threaded it in onplayerspawned and i don't want many copy's of the same thread running at once.

Yes, but the endon should be above the loop and not in it...

 

Anyway, i will fix that script asap.

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

Ok, i made it work like this:

 

- you type in: /+weap in console

- it says: weapon changes to m40a3 next spawn

-> next time you spawn you get m40a3 as primary

 

(w1200 if you type /+weap again, your default weapon when you type it a third time and so on...)

Oh and it should work in all gametypes on oilrig. On other maps it will show a message that m40a3 isn't available.

 

init()
{
precacheItem("m40a3");
precacheItem("winchester1200");
level thread onPlayerConnect();
}


onPlayerConnect()
{
for(;
{
	level waittill( "connected", player );

	if( !isDefined( player.pers["weaploop"] ) )
		player.pers["weaploop"] = 0;

	player thread onPlayerSpawned();
}
}



onPlayerSpawned()
{
self endon( "disconnect" );

for(;
{
	self waittill( "spawned_player" );
	if( level.script == "oilrig" )
		self thread weapAtSpawn();

	self thread weapToggle();
}
}

weapAtSpawn()
{
self endon( "disconnect" );
self endon( "death" );

curWep = self getCurrentWeapon();
wait 0.05;
switch( self.pers["weaploop"] )
{
	case 0: 
			break;
	case 1:
			self takeWeapon( curWep );
			wait 0.05;
			self giveWeapon( "m40a3", 0, false );
			self switchToWeapon("m40a3");
			self giveMaxAmmo ("m40a3");
			break;
	case 2:
			self takeWeapon( curWep );
   			wait 0.05;
   			self giveWeapon( "winchester1200", 0, false );
   			self switchToWeapon("winchester1200");
			self giveMaxAmmo ("winchester1200");
			break;
}
}


weapToggle()
{
self endon( "death" );
self endon( "disconnect" );

self notifyOnPlayerCommand( "weap", "+weap" );

for(;
{
self waittill("weap"); 

	if(level.script == "oilrig") {

		switch( self.pers["weaploop"] )
		{
			case 0:
				self.pers["weaploop"]++;
				self iPrintln("Your weapon will change to ^3m40a3 ^7the next time you spawn");
				break;
			case 1:
				self.pers["weaploop"]++;
				self iPrintln("Your weapon will change to ^3w1200 ^7the next time you spawn");
				break;
			case 2:
				self.pers["weaploop"] = 0;
				self iPrintln("Reset to your ^3default weapon ^7next time you spawn");
				break;
		}
	}
	else {
		self iPrintLnBold( "^3M40A3 / W12000 ^7are only working on Oilrig!" );
	}
}
}

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.