Raised This Month: $ Target: $400
 0% 

[L4D]Spawn x amount special/ common infected


Post New Thread Reply   
 
Thread Tools Display Modes
HateMeh
Junior Member
Join Date: Jul 2009
Old 08-25-2009 , 07:26   Re: [L4D]Spawn x amount special/ common infected
Reply With Quote #21

ok so i finally fixed it and it spawn stuff again (problem was that amount wasnt being defined so the plugin never knew how much to spawn)

next problem when i try to spawn a lot of things i get this message:
CreatePlayerBot: Unable to create bot Boomer - CreateFakeClient() returned NULL.
any idea's ?
HateMeh is offline
olj
Veteran Member
Join Date: Jun 2009
Old 08-25-2009 , 07:30   Re: [L4D]Spawn x amount special/ common infected
Reply With Quote #22

Not sure why this happens. You included limits removal in plugin so it should work. I'll run some tests at home.

Did you try to spawn 100 tanks? They dont have limits by default, BUT they controlled by bots (unlike witches, which just have ai scripts for them).
__________________

Last edited by olj; 08-25-2009 at 07:33.
olj is offline
HateMeh
Junior Member
Join Date: Jul 2009
Old 08-25-2009 , 08:59   Re: [L4D]Spawn x amount special/ common infected
Reply With Quote #23

ill try spawning 100 tanks and see what happens and ill also upload the script

Code:
#define PLUGIN_VERSION "1.0.6"
#define PLUGIN_NAME "Special Spawn [L4D]"

#include <sourcemod>
#include <sdktools>
new Handle:nlimit, Handle:nexplo, Handle:nhunter, Handle:nboomer;
new olimit, oexplo, ohunter, oboomer
public Plugin:myinfo = 
{
    name = PLUGIN_NAME,
    author = "HateMeh",
    description = "Spawns x number of specials",
    version = PLUGIN_VERSION,
    url = "http://forums.alliedmods.net/showthread.php?p=901217"
}

public OnPluginStart()
{
    RegAdminCmd("sm_spawn", Command_MyWitch, ADMFLAG_KICK);
    nlimit = FindConVar("z_gas_limit");
    nexplo = FindConVar("z_exploding_limit");
    nhunter = FindConVar("z_hunter_limit");
    nboomer = FindConVar("z_versus_boomer_limit");
    olimit = GetConVarInt(nlimit);
    oexplo = GetConVarInt(nexplo);
    ohunter = GetConVarInt(nhunter);
    oboomer = GetConVarInt(nboomer);
}

//witch
public Action:Command_MyWitch(client, args)
{
if (args < 1)
    {
        ReplyToCommand(client, "Usage: sm_spawn <name> <amount>, 100 max");
        return Plugin_Handled;
    }
    new String:arg1[32], String:arg2[32]
    new amount, i

    GetCmdArg(1, arg1, sizeof(arg1));
    GetCmdArg(2, arg2, sizeof(arg2));
    amount = StringToInt(arg2);
    if(amount > 100)
    {
        amount = 100;
    }
    
    SetConVarInt(nlimit, 100);
    SetConVarInt(nexplo, 100);
    SetConVarInt(nhunter, 100);
    SetConVarInt(nboomer, 100);
    new spawnflags = GetCommandFlags("z_spawn");
    SetCommandFlags("z_spawn", spawnflags & ~FCVAR_CHEAT);
    while(i < amount)
        {
    
            FakeClientCommand(client, "z_spawn %s auto", arg1);
            i++;

        }    
            SetConVarInt(nlimit, olimit);
            SetConVarInt(nexplo, oexplo);
            SetConVarInt(nhunter, ohunter);
            SetConVarInt(nhunter, oboomer);
    SetCommandFlags("z_spawn", spawnflags|FCVAR_CHEAT);
    return Plugin_Continue;
}
btw whole thing for it not working was because this was missing ....
amount = StringToInt(arg2);

i tried it but doesnt work still only spawns 5 tanks of which 2 commit suicide too XD
gives the same error too

CreatePlayerBot: Unable to create bot Tank - CreateFakeClient() returned NULL.

i dunno but a fakeclient takes a playerslot on the server right ?
if so then there is no way to spawn more then 4 or 5 bots since there is just no room for it on the server.

just a guess though

Last edited by HateMeh; 08-25-2009 at 09:32.
HateMeh is offline
HateMeh
Junior Member
Join Date: Jul 2009
Old 08-25-2009 , 09:38   Re: [L4D]Spawn x amount special/ common infected
Reply With Quote #24

Update:

1.0.7
added a sm_give command
HateMeh is offline
olj
Veteran Member
Join Date: Jun 2009
Old 08-25-2009 , 10:51   Re: [L4D]Spawn x amount special/ common infected
Reply With Quote #25

amount = StringToInt(arg2); LOL, how the hell i missed that , so obvious. Anyway when i finish with server maintenace i will test all this.
__________________
olj is offline
HateMeh
Junior Member
Join Date: Jul 2009
Old 08-25-2009 , 11:55   Re: [L4D]Spawn x amount special/ common infected
Reply With Quote #26

Quote:
Originally Posted by olj View Post
amount = StringToInt(arg2); LOL, how the hell i missed that , so obvious. Anyway when i finish with server maintenace i will test all this.
well i missed it too XD so dont worry XD
HateMeh is offline
olj
Veteran Member
Join Date: Jun 2009
Old 08-27-2009 , 05:11   Re: [L4D]Spawn x amount special/ common infected
Reply With Quote #27

I got some tests trying to spawn some boomers. I used aSpawn plugin, but the point is, i cant get more than 10 because my z_max_player_zombies cvar is set to 10. That means you are right, we cant get 100 boomers unless z_max_player_zombies is set to 100 (which is kinda improbable, because i believe that 64 slots is max for source games).

The good news though, is you can still spawn 100 witches freely
__________________
olj is offline
HateMeh
Junior Member
Join Date: Jul 2009
Old 08-27-2009 , 11:27   Re: [L4D]Spawn x amount special/ common infected
Reply With Quote #28

thanks for checking it out ^^

oh btw any idea's on stuff i could maybe add ?
menu's or something or would that just make it harder to use ?

Last edited by HateMeh; 08-28-2009 at 04:16.
HateMeh is offline
Thraka
AlliedModders Donor
Join Date: Aug 2005
Old 08-31-2009 , 15:25   Re: [L4D]Spawn x amount special/ common infected
Reply With Quote #29

It would be awesome to spawn the itmes you give to players as entities in the map. So I could be a spectator controlling the game by adding kits aroudn the map or weapons and pills. Sort of like an RPG GM
Thraka is offline
HateMeh
Junior Member
Join Date: Jul 2009
Old 09-01-2009 , 07:16   Re: [L4D]Spawn x amount special/ common infected
Reply With Quote #30

hmmmm good idea might add it or make a seperate plugin for that
HateMeh is offline
Reply



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 18:26.


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