AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   how create a lot of zombies? (https://forums.alliedmods.net/showthread.php?t=301420)

nxlinux 09-20-2017 10:43

how create a lot of zombies?
 
[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.

Halt 09-20-2017 14:23

Re: how create a lot of zombies?
 
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++); 


fiction 09-20-2017 14:54

Re: how create a lot of zombies?
 
Quote:

Originally Posted by Halt (Post 2549922)
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.



Halt 09-20-2017 15:25

Re: how create a lot of zombies?
 
Quote:

Originally Posted by fiction (Post 2549932)
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?

fiction 09-20-2017 15:31

Re: how create a lot of zombies?
 
Quote:

Originally Posted by Halt (Post 2549938)
Difference between new and int?

It's the "new" Transitional Syntax: https://wiki.alliedmods.net/SourcePa...ew_Declarators

nxlinux 09-20-2017 15:52

Re: how create a lot of zombies?
 
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?

Neuro Toxin 09-20-2017 18:45

Re: how create a lot of zombies?
 
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);



xerox8521 09-21-2017 11:29

Re: how create a lot of zombies?
 
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.

nxlinux 09-21-2017 12:23

Re: how create a lot of zombies?
 
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

Halt 09-21-2017 13:08

Re: how create a lot of zombies?
 
Perhaps you could try

PHP Code:

SetCommandFlags("z_minion_limit", (GetCommandFlags("z_minion_limit") - FCVAR_CHEAT)); 

Changes the command flags.


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

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