Raised This Month: $12 Target: $400
 3% 

how create a lot of zombies?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nxlinux
Member
Join Date: Oct 2013
Location: China
Old 09-20-2017 , 10:43   how create a lot of zombies?
Reply With Quote #1

[L4D2]
how create a lot of special zombies at the same time?

PHP Code:
for(new 1<= 6i++)
{
        new 
type;
    new 
String:Name[3][32] = {"charger""spitter","jockey"};
    new 
String:text[64];
    
type GetRandomInt(0sizeof(Name)-1);
    
Format(textsizeof(text), "%s %.f %.f %.f"Name[type], pos[0], pos[1], pos[2]);
        
    new 
anyclient CreateFakeClient("Bot");
    
    
CheatCommand(anyclient"z_spawn"text);

this code can not create 6 zombies,it just create 1 or 2. mostly it create nothing.

Last edited by nxlinux; 09-20-2017 at 15:53.
nxlinux is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 09-20-2017 , 14:23   Re: how create a lot of zombies?
Reply With Quote #2

For future referance please include the game name in your threads title. (L4D2)

So you want you loop to run 6 times? I'm still new to coding but why are you setting your loop to 1 initially?

If you want it to stop running when i <= 6 then set i = 0 in the initialization.

PHP Code:
for    (new 0<= 6i++) 
I belive this would work too if you're trying to end when the loop runs 6 times exactly.

PHP Code:
for    (new 0== 6i++); 
Halt is offline
fiction
Member
Join Date: May 2017
Old 09-20-2017 , 14:54   Re: how create a lot of zombies?
Reply With Quote #3

Quote:
Originally Posted by Halt View Post
I belive this would work too if you're trying to end when the loop runs 6 times exactly.

PHP Code:
for    (new 0== 6i++); 
That won't work because the code inside is only ran if the condition is true.
PHP Code:
for(int i6i++)
{
    
//Code here will be run 6 times.

fiction is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 09-20-2017 , 15:25   Re: how create a lot of zombies?
Reply With Quote #4

Quote:
Originally Posted by fiction View Post
That won't work because the code inside is only ran if the condition is true.
PHP Code:
for(int i6i++)
{
    
//Code here will be run 6 times.

Difference between new and int?
Halt is offline
fiction
Member
Join Date: May 2017
Old 09-20-2017 , 15:31   Re: how create a lot of zombies?
Reply With Quote #5

Quote:
Originally Posted by Halt View Post
Difference between new and int?
It's the "new" Transitional Syntax: https://wiki.alliedmods.net/SourcePa...ew_Declarators
fiction is offline
nxlinux
Member
Join Date: Oct 2013
Location: China
Old 09-20-2017 , 15:52   Re: how create a lot of zombies?
Reply With Quote #6

i just want to create 6 or 10 special zombies,but game can not create that much. it summons up to 3 zombies for me.

game restrictions?
nxlinux is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 09-20-2017 , 18:45   Re: how create a lot of zombies?
Reply With Quote #7

Looks like a game restriction. There might be a convar or something that will allow more.

You should also be using the new syntax.

PHP Code:
for (int i 1<= 6i++)
{
    
char name[3][32] = {"charger""spitter","jockey"};
    
char text[64];
    
int type GetRandomInt(0sizeof(name)-1);
    
Format(textsizeof(text), "%s %.f %.f %.f"name[type], pos[0], pos[1], pos[2]);
        
    
int anyclient CreateFakeClient("Bot");

    
CheatCommand(anyclient"z_spawn"text);

__________________
Neuro Toxin is offline
xerox8521
Senior Member
Join Date: Sep 2011
Old 09-21-2017 , 11:29   Re: how create a lot of zombies?
Reply With Quote #8

You need to change convar limits foreach special infected. Which you can find here: https://developer.valvesoftware.com/..._of_L4D2_Cvars

Note that boomer is sometimes considered as z_exploding_CvarName and smoker sometimes as z_gas_CvarName for convars.
xerox8521 is offline
nxlinux
Member
Join Date: Oct 2013
Location: China
Old 09-21-2017 , 12:23   Re: how create a lot of zombies?
Reply With Quote #9

sm_cvar z_minion_limit "6"
sm_cvar z_exploding_limit "6"
sm_cvar z_gas_limit "6"
sm_cvar z_hunter_limit "6"

this not working for me
nxlinux is offline
Halt
Senior Member
Join Date: Jan 2015
Location: Black Mesa
Old 09-21-2017 , 13:08   Re: how create a lot of zombies?
Reply With Quote #10

Perhaps you could try

PHP Code:
SetCommandFlags("z_minion_limit", (GetCommandFlags("z_minion_limit") - FCVAR_CHEAT)); 
Changes the command flags.
Halt is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:17.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode