AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [L4D2] Auto Items Spawn (https://forums.alliedmods.net/showthread.php?t=116376)

V10 01-22-2010 13:01

[L4D2] Auto Items Spawn
 
2 Attachment(s)
This plugin designed for automatic spawn items on configured origin positions.
Custom items auto spawn on specific origin type.
Plugin can make visible areas with items (sm_allowitemrings).
Plugin have feature for add, edit, and delete origins for spawn items.
Also you can configure items counts and chances.

CVARS
sm_allowitemrings - Create Beam Rings on item spawn origins (default = 0)
l4d2_autospawni_version - Current plugin version

CMDS
sm_itemsmenu - Auto spawn items menu (add\edit\delete origin)
sm_itemsstats - stats about current map origins complete
sm_allitemsstats - stats about ALL (default) maps origins complete

Origin types
Start - Start map origin position (on survivor respawn saferoom)
Start[0] - must be coordinates start saferoom
PreCenter - origins on pre center map
Center - origins on center map
Final - origins in final map
Final[0] - must be coordinates in final map saferoom

Files
Download AutoSpawnItems_full.zip and unpack to left4dead2 directory

CONFIG
AutoSpawnConfig->Options->Items
Chances - configures items to spawn (get random from it) and items flags
if flag ==1 item not spawned on start and final origins
format:
"name" "chance;flag"
sample:
"first_aid_kit" "90;1"
Counts - minimum and maximum items counts for randomed spawn items counts for every type of origin (Advanced is additionaly items with random origin type).
Maps->"map_name"->Counts
As "AutoSpawnConfig->Options->Items->Counts", but for specific MAP

Maps->"map_name"->"origin_type"
Origins for specific map and type

Maps->"map_name"->"origin_type"->SpecialItems
You can set here items why spawns on given origin type on specific maps.
format:
"name" "count"
sample:
"first_aid_kit" "6"
Maps->All->"origin_type"->SpecialItems
As above, but for a ALL MAPS
In new version changes items names in your config:
Sample:
old => new
first_aid_kit => weapon_first_aid_kit
autoshotgun => weapon_autoshotgun
gascan => weapon_gascan
Melee weapon not use prefix, sample:
machete => machete

About configure chances

Changelog:
1.7
- Fixed spawn errors at first round.
1.6
- added m60 support (dlc)
1.5
- changed config item names from {name} to weapon_{name}
- added support to melee weapons
- fixed weapon ammo count
- small correct colors for item rings
- added cvar for version control
1.4 (beta)
- Fix bug with adding new origins and save old.
1.3 (beta)
- First public release

Bongholio 01-22-2010 14:08

Re: [L4D2] Auto Items Spawn (BETA)
 
Could this be tweeked to set down pre-placed statics automatically?
(like how you do it with admin menu manually with the modelfun plugin?)

The idea doesn't sound so far off.

Luke Penny 01-23-2010 20:56

Re: [L4D2] Auto Items Spawn (BETA)
 
Indeed, I was wondering if it was possible for maps to have a chance to place dynamic props, so you could have a 50% chance of forcing players to take different variable paths in l4d1 or 2.

V10 01-26-2010 16:57

Re: [L4D2] Auto Items Spawn (BETA)
 
Quote:

Originally Posted by Bongholio (Post 1063619)
Could this be tweeked to set down pre-placed statics automatically?
(like how you do it with admin menu manually with the modelfun plugin?)

The idea doesn't sound so far off.

Maybe sometime in the future

rek075 01-28-2010 10:45

Re: [L4D2] Auto Items Spawn (BETA)
 
Quote:

Originally Posted by Luke Penny (Post 1065112)
Indeed, I was wondering if it was possible for maps to have a chance to place dynamic props, so you could have a 50% chance of forcing players to take different variable paths in l4d1 or 2.

This could probably be done with Stripper Source, a script file to generate the configuration files, and a cronjob periodically calling that script.

REDSCOUT 03-27-2010 22:35

Re: [L4D2] Auto Items Spawn (BETA)
 
This is Cool :D ☺☺☻☻☻!! I will test this out!!!

marvel 03-31-2010 11:15

Re: [L4D2] Auto Items Spawn (BETA)
 
Nice plugin, I was looking for this. One question though probably a noob question :) but what means:

"Start" "10;15"

What are the 10 and 15 for?

The other one:

"first_aid_kit" "90;1"

Does that mean there's a 90% chance first aid kit spawns but not in saferoom? If I change this to 0 they spawn in the saferoom.

A little bit more explanation for the noobs like me would be welcome :)

Also, can you spawn weapons with this plugin like M16, AK47 etc? Would be nice for maps like c1m1_hotel where you only have an axe or a pistol or is there another way to do this?

Thanks!

V10 03-31-2010 18:08

Re: [L4D2] Auto Items Spawn (BETA)
 
Quote:

Originally Posted by marvel (Post 1134509)
Nice plugin, I was looking for this. One question though probably a noob question :) but what means:

"Start" "10;15"

What are the 10 and 15 for?

Quote:

Counts - minimum and maximum items counts for randomed spawn items counts for every type of origin (Advanced is additionaly items with random origin type).
"Start" "min count;max count"

Quote:

The other one:

"first_aid_kit" "90;1"

Does that mean there's a 90% chance first aid kit spawns but not in saferoom? If I change this to 0 they spawn in the saferoom.
Yes, but 9% chance
Sample:
1000 = 100% = maximum 1 item
500 + 500 = 50% + 50% = maximum 2 items
500 + 250 + 250 = 50% + 25% + 25% = maximum 3 items
etc

Quote:

A little bit more explanation for the noobs like me would be welcome :)

Also, can you spawn weapons with this plugin like M16, AK47 etc? Would be nice for maps like c1m1_hotel where you only have an axe or a pistol or is there another way to do this?

Thanks!
Yes, you can.

marvel 03-31-2010 18:11

Re: [L4D2] Auto Items Spawn (BETA)
 
Thanks I'll give it a try :)

marvel 04-01-2010 03:26

Re: [L4D2] Auto Items Spawn (BETA)
 
Works perfectly, thanks! One more question, do you maybe have an item list of things you can spawn?

I was trying to spawn weapons like the autoshutgun and shotgun_spas and they did spawn but they only had 10 bullets of ammo, no backup ammo.

Any idea?

Thanks again for the mod! Some maps were far too simple for infected because of the lack of good starting items.

marvel 04-01-2010 04:55

Re: [L4D2] Auto Items Spawn (BETA)
 
Btw plugin gives errors, always the same error / same lines on every map but only at map startup, not during the map.

Code:

L 04/01/2010 - 12:56:48: Info (map "c1m3_mall") (file "errors_20100401.log")
L 04/01/2010 - 12:56:48: [SM] Plugin encountered error 15: Array index is out of bounds
L 04/01/2010 - 12:56:48: [SM] Displaying call stack trace for plugin "AutoSpawnItems.smx":
L 04/01/2010 - 12:56:48: [SM]  [0]  Line 283, D:\Games\Left 4 Dead 2\left4dead2\addons\pawnstudio\temp745.sp::LoadItemsC$
L 04/01/2010 - 12:56:48: [SM]  [1]  Line 91, D:\Games\Left 4 Dead 2\left4dead2\addons\pawnstudio\temp745.sp::Event_Round$
L 04/01/2010 - 12:56:48: [SM] Plugin encountered error 15: Array index is out of bounds
L 04/01/2010 - 12:56:48: [SM] Displaying call stack trace for plugin "AutoSpawnItems.smx":
L 04/01/2010 - 12:56:48: [SM]  [0]  Line 283, D:\Games\Left 4 Dead 2\left4dead2\addons\pawnstudio\temp745.sp::LoadItemsC$
L 04/01/2010 - 12:56:48: [SM]  [1]  Line 120, D:\Games\Left 4 Dead 2\left4dead2\addons\pawnstudio\temp745.sp::OnMapStart$
L 04/01/2010 - 13:10:22: [SM] Plugin encountered error 15: Array index is out of bounds
L 04/01/2010 - 13:10:22: [SM] Displaying call stack trace for plugin "AutoSpawnItems.smx":
L 04/01/2010 - 13:10:22: [SM]  [0]  Line 283, D:\Games\Left 4 Dead 2\left4dead2\addons\pawnstudio\temp745.sp::LoadItemsC$
L 04/01/2010 - 13:10:22: [SM]  [1]  Line 91, D:\Games\Left 4 Dead 2\left4dead2\addons\pawnstudio\temp745.sp::Event_Round$


V10 04-01-2010 07:36

Re: [L4D2] Auto Items Spawn (BETA)
 
Quote:

Works perfectly, thanks! One more question, do you maybe have an item list of things you can spawn?

I was trying to spawn weapons like the autoshutgun and shotgun_spas and they did spawn but they only had 10 bullets of ammo, no backup ammo.

Any idea?

Thanks again for the mod! Some maps were far too simple for infected because of the lack of good starting items.
This is bug of beta version, i correct this on I have time.

Quote:

Originally Posted by marvel (Post 1135235)
Btw plugin gives errors, always the same error / same lines on every map but only at map startup, not during the map.

Code:

L 04/01/2010 - 12:56:48: Info (map "c1m3_mall") (file "errors_20100401.log")
L 04/01/2010 - 12:56:48: [SM] Plugin encountered error 15: Array index is out of bounds
L 04/01/2010 - 12:56:48: [SM] Displaying call stack trace for plugin "AutoSpawnItems.smx":
L 04/01/2010 - 12:56:48: [SM]  [0]  Line 283, D:\Games\Left 4 Dead 2\left4dead2\addons\pawnstudio\temp745.sp::LoadItemsC$
L 04/01/2010 - 12:56:48: [SM]  [1]  Line 91, D:\Games\Left 4 Dead 2\left4dead2\addons\pawnstudio\temp745.sp::Event_Round$
L 04/01/2010 - 12:56:48: [SM] Plugin encountered error 15: Array index is out of bounds
L 04/01/2010 - 12:56:48: [SM] Displaying call stack trace for plugin "AutoSpawnItems.smx":
L 04/01/2010 - 12:56:48: [SM]  [0]  Line 283, D:\Games\Left 4 Dead 2\left4dead2\addons\pawnstudio\temp745.sp::LoadItemsC$
L 04/01/2010 - 12:56:48: [SM]  [1]  Line 120, D:\Games\Left 4 Dead 2\left4dead2\addons\pawnstudio\temp745.sp::OnMapStart$
L 04/01/2010 - 13:10:22: [SM] Plugin encountered error 15: Array index is out of bounds
L 04/01/2010 - 13:10:22: [SM] Displaying call stack trace for plugin "AutoSpawnItems.smx":
L 04/01/2010 - 13:10:22: [SM]  [0]  Line 283, D:\Games\Left 4 Dead 2\left4dead2\addons\pawnstudio\temp745.sp::LoadItemsC$
L 04/01/2010 - 13:10:22: [SM]  [1]  Line 91, D:\Games\Left 4 Dead 2\left4dead2\addons\pawnstudio\temp745.sp::Event_Round$


it s beta, and this indicate you use incorrect config, etc.
with default config all ok.

marvel 04-01-2010 07:41

Re: [L4D2] Auto Items Spawn (BETA)
 
1 Attachment(s)
Quote:

Originally Posted by V10 (Post 1135335)
This is bug of beta version, i correct this on I have time.


it s beta, and this indicate you use incorrect config, etc.
with default config all ok.

That makes sence, but I don't like the default config and want to add my own items :wink:

Can you please check my config, see what I did wrong? I think everything looks ok.

Thanks!

V10 04-01-2010 08:51

Re: [L4D2] Auto Items Spawn (BETA)
 
Quote:

Originally Posted by marvel (Post 1135339)
That makes sence, but I don't like the default config and want to add my own items :wink:

Can you please check my config, see what I did wrong? I think everything looks ok.

Thanks!

You use 14 items in AutoSpawnConfig->Options->Items->Chances section.
change max items count in AutoSpawnItems.sp
line
PHP Code:

#define MAX_ITEMS_COUNT 13 

to
PHP Code:

#define MAX_ITEMS_COUNT 20 

and recompile plugin

marvel 04-01-2010 09:47

Re: [L4D2] Auto Items Spawn (BETA)
 
Quote:

Originally Posted by V10 (Post 1135402)
You use 14 items in AutoSpawnConfig->Options->Items->Chances section.
change max items count in AutoSpawnItems.sp
line
PHP Code:

#define MAX_ITEMS_COUNT 13 

to
PHP Code:

#define MAX_ITEMS_COUNT 20 

and recompile plugin

I changed it to 20 and re-compiled. It sure did anything because I now get a divide by zero error:

Code:

L 04/01/2010 - 15:44:42: SourceMod error session started
L 04/01/2010 - 15:44:42: Info (map "c1m1_hotel") (file "errors_20100401.log")
L 04/01/2010 - 15:44:42: [SM] Plugin encountered error 14: Divide by zero
L 04/01/2010 - 15:44:42: [SM] Displaying call stack trace for plugin "AutoSpawnItems.smx":
L 04/01/2010 - 15:44:42: [SM]  [0]  Line 308, /groups/sourcemod/upload_tmp/textZYCcwo.sp::LoadItemsConfig()
L 04/01/2010 - 15:44:42: [SM]  [1]  Line 91, /groups/sourcemod/upload_tmp/textZYCcwo.sp::Event_RoundStart()
L 04/01/2010 - 15:44:42: [SM] Plugin encountered error 14: Divide by zero
L 04/01/2010 - 15:44:42: [SM] Displaying call stack trace for plugin "AutoSpawnItems.smx":
L 04/01/2010 - 15:44:42: [SM]  [0]  Line 308, /groups/sourcemod/upload_tmp/textZYCcwo.sp::LoadItemsConfig()
L 04/01/2010 - 15:44:42: [SM]  [1]  Line 120, /groups/sourcemod/upload_tmp/textZYCcwo.sp::OnMapStart()

Any idea?

Thanks for your support so far!

V10 04-01-2010 09:52

Re: [L4D2] Auto Items Spawn (BETA)
 
Quote:

Originally Posted by marvel (Post 1135431)
I changed it to 20 and re-compiled. It sure did Any idea?

At least 1 item is no flag (;0) "no spawn in start \ finale" in chances section.
use 0,1% for it
Sample:
"weapon_autoshotgun" "1;0"

marvel 04-01-2010 10:19

Re: [L4D2] Auto Items Spawn (BETA)
 
Quote:

Originally Posted by V10 (Post 1135434)
At least 1 item is no flag (;0) "no spawn in start \ finale" in chances section.
use 0,1% for it
Sample:
"weapon_autoshotgun" "1;0"

That did the trick, plugin works great now, thanks for your help!!

marvel 04-01-2010 12:55

Re: [L4D2] Auto Items Spawn (BETA)
 
I had to remove the weapon spawns though since they don't have backup ammo. If you can fix that I'll give you a medal :wink:

IIPu3PAK 04-02-2010 11:56

Re: [L4D2] Auto Items Spawn (BETA)
 
NO SPAWN MELEE WEAPON!!!111

IIPu3PAK 04-03-2010 02:46

Re: [L4D2] Auto Items Spawn (BETA)
 
Im edit you plugin,now this can spawn melee weapon
PHP Code:

/* Plugin Template generated by Pawn Studio */

#include <sourcemod>
#include <sdktools>

#define MELEE_FIREAXE "fireaxe"
#define MELEE_FRYING_PAN "frying_pan"
#define MELEE_MACHETE "machete"
#define MELEE_BASEBALL_BAT "baseball_bat"
#define MELEE_CROWBAR "crowbar"
#define MELEE_CRICKET_BAT "cricket_bat"
#define MELEE_TONFA "tonfa"
#define MELEE_KATANA "katana"
#define MELEE_GUITAR "electric_guitar"
#define MELEE_KNIFE "knife"
#define MELEE_HUNTING_KNIFE "hunting_knife"

#define VERSION "1.3"
#define CONFIG_FILE "data/AutoItemsSpawn.txt"
#define CONFIG_FILE_VERSION "1.0"

#define DEBUG 1
#define DEBUG_BEAMRINGS 0

#define ORIGIN_TYPES_COUNT 5
#define MAX_ORIGINS_COUNT 10
#define MAX_ITEMS_COUNT 13
#define MAX_RINGS_COUNT 20

#define typeOriginRandom -1
#define typeOriginStart 0
#define typeOriginPreCenter 1
#define typeOriginCenter 2
#define typeOriginPreFinal 3
#define typeOriginFinal 4
//map c4m4 bug dont save new pos..bad num

// Models
new String:BeamSprite[] = "materials/sprites/laser.vmt";
new 
String:BeamSprite_[] = "materials/sprites/laser.vtf";
new 
String:HaloSprite[] = "materials/sprites/halo01.vmt";
new 
String:HaloSprite_[] = "materials/sprites/halo01.vtf";
new 
g_BeamSprite;
new 
g_HaloSprite;
new 
Handle:hCreateTimer;
new 
Handle:hCheckTimer;
new 
Handle:hAllowRings;

new 
Float:Rings[MAX_RINGS_COUNT][4];
new 
RingsCount;
new 
Float:fMaxDist;
new 
Float:fOnePercent;

static 
String:g_sOriginTypes[ORIGIN_TYPES_COUNT+1][13]  = {"Start","PreCenter""Center""PreFinal","Final","Advanced"};
new 
OriginsCount[ORIGIN_TYPES_COUNT];
new 
Float:Origins[ORIGIN_TYPES_COUNT][MAX_ORIGINS_COUNT][3];
new 
String:g_sItems[MAX_ITEMS_COUNT][32]; 
new 
ItemChances[MAX_ITEMS_COUNT];
new 
ItemChancesNoSF[MAX_ITEMS_COUNT];
new 
ItemFlags[MAX_ITEMS_COUNT];
new 
ItemsListCount=0
new ItemsMinCounts[ORIGIN_TYPES_COUNT+1];
new 
ItemsMaxCounts[ORIGIN_TYPES_COUNT+1];
new 
bForceUnbalanced=false;

public 
Plugin:myinfo 
{
    
name "[L4D2] Auto Spawn Items",
    
author "V10",
    
description "Auto Spawn Items :3",
    
version VERSION,
    
url ""
    
}

public 
OnPluginStart()
{
    
    
HookEvent("round_start"Event_RoundStartEventHookMode_PostNoCopy);
    
//cmds
    
RegAdminCmd("sm_itemsmenu"Command_OriginsMenuADMFLAG_SLAY,  "Auto spawn items menu");
    
RegAdminCmd("sm_itemsstats"Command_ItemsStatsADMFLAG_SLAY);
    
RegAdminCmd("sm_allitemsstats"Command_AllItemsStatsADMFLAG_SLAY);
    
#if DEBUG
    
RegAdminCmd("sm_spawnall"Command_SpawnAllADMFLAG_SLAY,  "Initiate spawn items");
    
#endif
    
    //cvars
    
hAllowRings=CreateConVar("sm_allowitemrings","0","Create Beam Rings on item spawn origins");
    
HookConVarChange(hAllowRings,AllowRingsChanged);
    
}

// =======================================================================
// ============================  EVENTS ==================================
// =======================================================================

public Action:Event_RoundStart(Handle:eventString:name[], bool:dontBroadcast)
{
    
#if DEBUG
    
DebugPrint("Start Spawn items");
    
#endif
    
LoadItemsConfig();
    if (
isConfigBalanced()){
        
SpawnDefaultItems();
        
SpawnSpecialItems();
    }else{
        
PrintToServer("ERROR: Auto Spawn Items config not balanced, items not spawned! Please open config and balance. All items chances summ need to be 1000.");
    }
}

public 
OnMapStart()
{
    
//add downloads
    
AddFileToDownloadsTable(BeamSprite);
    
AddFileToDownloadsTable(BeamSprite_);
    
AddFileToDownloadsTable(HaloSprite);
    
AddFileToDownloadsTable(HaloSprite_);
    
//models
    
g_BeamSprite=PrecacheModel(BeamSpritefalse);
    
g_HaloSprite=PrecacheModel(HaloSpritefalse);        
     
    if (
GetConVarBool(hAllowRings)){
      
hCreateTimer=CreateTimer(1.0,CreateBeamRingTimer,_,TIMER_REPEAT+TIMER_FLAG_NO_MAPCHANGE);
      
hCheckTimer=CreateTimer(5.0,CheckBeamRingsTimer,_,TIMER_REPEAT+TIMER_FLAG_NO_MAPCHANGE);
    }
    
decl String:curMap[32];
    
GetCurrentMap(curMapsizeof(curMap));
    
#if DEBUG
    
DebugPrint("Map '%s' started!",curMap);
    
#endif
    
LoadItemsConfig();
}

public 
AllowRingsChanged(Handle:convar, const String:oldValue[], const String:newValue[])
{
    if (
StringToInt(newValue)){
        if (!
StringToInt(oldValue)){
            
hCreateTimer=CreateTimer(1.0,CreateBeamRingTimer,_,TIMER_REPEAT+TIMER_FLAG_NO_MAPCHANGE);
            
hCheckTimer=CreateTimer(5.0,CheckBeamRingsTimer,_,TIMER_REPEAT+TIMER_FLAG_NO_MAPCHANGE);
        }                
    }else{
        if (
StringToInt(oldValue)){
             
KillTimer(hCheckTimer);
             
KillTimer(hCreateTimer);
        }        
    }
}

// =======================================================================
// ============================  COMMANDS ================================
// =======================================================================

#if DEBUG
public Action:Command_SpawnAll(clientargs) {
    
SpawnDefaultItems();
}
#endif

public Action:Command_OriginsMenu(clientargs) {
    if (
client==0client=1;
    new 
Handle:menu CreateMenu(OriginsMenuHandler);
    
SetMenuTitle(menu"Select Type:");
    
AddMenuItem(menu"option1""Start");
    
AddMenuItem(menu"option2""PreCenter");
    
AddMenuItem(menu"option3""Center");
    
AddMenuItem(menu"option4""PreFinal");
    
AddMenuItem(menu"option5""Final");
    
AddMenuItem(menu"option6""",ITEMDRAW_NOTEXT);
    
AddMenuItem(menu"option7""Delete Current");
    
SetMenuExitButton(menutrue);
    
DisplayMenu(menuclientMENU_TIME_FOREVER);
    
    return 
Plugin_Handled;
    
}

// =======================================================================
// ============================  MENU HANDLERS ===========================
// =======================================================================

new tmpNewOriginType=0;
new 
tmpOrgNewOriginType=0;
new 
tmpNewPointExist=0;

public 
OriginsMenuHandler(Handle:menuMenuAction:actionclientitemNum)
{
    if (
action == MenuAction_Select){
        new 
Float:AddedOrigin[3];
        
GetClientAbsOrigin(client,AddedOrigin);
        
ReplyToCommand(client,"x=%f y=%f z=%f",AddedOrigin[0],AddedOrigin[1],AddedOrigin[2]);
        
tmpNewOriginType=itemNum;
        
tmpOrgNewOriginType=tmpNewOriginType;
        new 
Float:tmpOriginDist=500.0;
        
tmpNewPointExist=isPointAlreadyAdded(AddedOrigin,tmpNewOriginType,tmpOriginDist);
        if (
tmpNewPointExist==-1){
            if (
itemNum==6){
                
ReplyToCommand(client,"\x4Point not found around \x03500 radius.");                
                return;
            }
            
AddNewOriginsPoint(client,tmpNewOriginType,AddedOrigin);
        }else{
            if (
itemNum==6){
                new 
Handle:menunew CreateMenu(DeleteConfirmHandler);
                
SetMenuTitle(menunew"Confirm delete %s[%d], dist=%f:",g_sOriginTypes[tmpNewOriginType],tmpNewPointExist,tmpOriginDist);
                
AddMenuItem(menunew"option1""No");
                
AddMenuItem(menunew"option2""Yes");
                
DisplayMenu(menunewclientMENU_TIME_FOREVER);
                return;
            }
            new 
Handle:menunew CreateMenu(OriginsConfirmHandler);
            
SetMenuTitle(menunew"Origin exist on %s[%d], dist=%f:",g_sOriginTypes[tmpNewOriginType],tmpNewPointExist,tmpOriginDist);
            
AddMenuItem(menunew"option1""Ignore");
            
AddMenuItem(menunew"option2""Replace");
            
SetMenuExitButton(menunewtrue);
            
DisplayMenu(menunewclientMENU_TIME_FOREVER);
            
        }
    }
}

public 
DeleteConfirmHandler(Handle:menuMenuAction:actionclientitemNum)
{
    if (
action == MenuAction_Select && itemNum==1){
        
DeleteOriginsPoint(tmpNewOriginType,tmpNewPointExist,client);
    }
}
public 
OriginsConfirmHandler(Handle:menuMenuAction:actionclientitemNum)
{
    if (
action == MenuAction_Select){
        new 
Float:AddedOrigin[3];
        
GetClientAbsOrigin(client,AddedOrigin);
        if (
itemNum==0)
            
AddNewOriginsPoint(client,tmpOrgNewOriginType,AddedOrigin);      
        else if(
itemNum==1)
            
AddNewOriginsPoint(client,tmpNewOriginType,AddedOrigin,true,tmpNewPointExist);              
    }
}

// =======================================================================
// ================================  CONFIG ==============================
// =======================================================================

Handle:OpenItemsConfig(const String:map[]="",OriginType=-1,bool:nomap=falseString:ConfigType[]="Maps")
{
    static 
String:sPath[256];
    new 
String:Map[32];
    
    if (
sPath[0]==0BuildPath(Path_SMsPathsizeof(sPath), CONFIG_FILE);
    if (!
nomap && map[0]==0GetCurrentMap(Map32);
    else 
strcopy(Map,32,map);

    
//Load
    
new Handle:kv CreateKeyValues("AutoSpawnConfig");
    
FileToKeyValues(kv,sPath);
    if (!
KvJumpToKey(kv,ConfigType)){
        
SetFailState("Cant find %s config section",ConfigType);
        return 
INVALID_HANDLE;
    }
    if (!
nomapKvJumpToKey(kv,Map,true);
    if (!
nomap && OriginType!=-1KvJumpToKey(kv,g_sOriginTypes[OriginType],true);
    return 
kv;
}

CloseItemsConfig(Handle:kvsave=false)
{
    if (
save){
        static 
String:sPath[256];
        if (
sPath[0]==0BuildPath(Path_SMsPathsizeof(sPath), CONFIG_FILE);
        
//Save
        
KvRewind(kv);
        
KeyValuesToFile(kv,sPath);
    }
    
CloseHandle(kv);
}

isConfigBalanced()
{
//    return !bForceUnbalanced;
    
return true;
}

LoadItemsConfig(){
    new 
Handle:kv OpenItemsConfig(_,_,true,"Options");
    
bForceUnbalanced=false;
    
    
//Parse Chances
    
new total=0;
    if (
KvJumpToKey(kv,"Items",false) && KvJumpToKey(kv,"Chances",false)){
        new 
counter 0;
        
KvGotoFirstSubKey(kv,false);
        do{
            
decl String:Value[10];
            
decl String:Values[2][10];
            
KvGetSectionName(kv,g_sItems[counter],32);
            
KvGetString(kv,"",Value,sizeof(Value));
            new 
ParamCount=ExplodeString(Value,";",Values,2,sizeof(Value));
            
ItemChances[counter]=StringToInt(Values[0]);
            
total+=ItemChances[counter];
            if (
ParamCount>1ItemFlags[counter]=StringToInt(Values[1]);            
            
counter++;
        }while(
KvGotoNextKey(kv,false));
        
ItemsListCount=counter;
        if (
total!=1000bForceUnbalanced=true;
    }else 
SetFailState("Not found needed section in config file.");
    
    
// recalc no start\final
    //Calc Free
    
new iFree=0;
    new 
GoodCount=0;
    for (new 
0ItemsListCounti++){
        if (
ItemFlags[i]) iFree+=ItemChances[i];
        else{
            
GoodCount++;
            
ItemChancesNoSF[i]=ItemChances[i];
        }
    }
    
//Recalc local table
    
if (iFree!=0){
        new 
byOne=iFree/GoodCount;
        for (new 
0ItemsListCounti++){if (!ItemFlags[i]) ItemChancesNoSF[i]+=byOne;}    
    }    

    if (
bForceUnbalancedPrintToServer("Items unbalanced. 1000!=%d",total);

    
//return to Items
    
KvGoBack(kv);KvGoBack(kv);
    
//parse global counts
    
if (!ParseCounts(kv)) SetFailState("Not found Counts section in config file.");
    
//close file
    
CloseItemsConfig(kv);
    
    
//Parse map origins and counts
    
kv=OpenItemsConfig();
    for (new 
typeOriginStart<= typeOriginFinali++){
        
OriginsCount[i]=FillOrigins(kv,i,Origins[i]);
    }
    
ParseCounts(kv);
    
CloseItemsConfig(kv);
    
    
fMaxDist=GetVectorDistance(Origins[typeOriginStart][0],Origins[typeOriginFinal][0]);
    
fOnePercent=FloatDiv(FloatAbs(fMaxDist),100.0);
    
    
#if DEBUG
    
DebugPrint("Loaded origins: SO:%d, PCO:%d, CO:%d, PFO:%d, FO:%d",OriginsCount[typeOriginStart],OriginsCount[typeOriginPreCenter],OriginsCount[typeOriginCenter],OriginsCount[typeOriginPreFinal],OriginsCount[typeOriginFinal]);
    
DebugPrint("Loaded items:");
    for (new 
0ItemsListCounti++){
        
DebugPrint("Name=%s, Chance=%d, Flag=%d, ChanseNoSF=%d",g_sItems[i],ItemChances[i],ItemFlags[i],ItemChancesNoSF[i]);
    }
    
    
DebugPrint("Loaded counts:");
    for (new 
0<= ORIGIN_TYPES_COUNTi++){
        
DebugPrint("Origin=%s, MinCount=%d, MaxCount=%d",g_sOriginTypes[i],ItemsMinCounts[i],ItemsMaxCounts[i]);            
    }
    
#endif
}


ParseCounts(Handle:kv){
    if (
KvJumpToKey(kv,"Counts",false)){
        for (new 
0<= ORIGIN_TYPES_COUNTi++){
            
decl String:Value[10];
            
decl String:Values[2][10];
            
KvGetString(kv,g_sOriginTypes[i],Value,sizeof(Value));
            if (!
Value[0]) continue;
            
ExplodeString(Value,";",Values,2,sizeof(Value));
            
ItemsMinCounts[i]=StringToInt(Values[0]);
            
ItemsMaxCounts[i]=StringToInt(Values[1]);            
        
//    PrintToServer("Name=%s, min=%d, max=%d",g_sOriginTypes[i],ItemsMinCounts[i],ItemsMaxCounts[i]);            
        
}
        return 
true;
    }
    return 
false;
}

// =======================================================================
// ================================  ORIGINS =============================
// =======================================================================

stock FillOrigins(Handle:kv,typeid,Float:array[MAX_ORIGINS_COUNT][3]){
    new 
String:ValName[5];
    new 
Float:origin[3];
    new 
count=0;
    
KvSavePosition(kv);
    if (
KvJumpToKey(kv,g_sOriginTypes[typeid])){
        for (new 
0MAX_ORIGINS_COUNTz++){
            
IntToString(z,ValName,sizeof(ValName));
            
KvGetVector(kv,ValName,origin);
            if (
origin[0]==&& origin[1]==&& origin[2]==0) break;
            array[
z]=origin;
            
count++;
        }
    }else{        
        for (new 
0MAX_ORIGINS_COUNTz++){
            array[
z][0]=0.0;array[z][1]=0.0;array[z][2]=0.0;
        }
        
#if DEBUG
        
decl String:tmpName[50];
        
KvGetSectionName(kv,tmpName,sizeof(tmpName));
        
DebugPrint("Cant find %s key in %s",g_sOriginTypes[typeid],tmpName);
        
#endif        
    
}
    
KvGoBack(kv);
    return 
count;
}

stock isPointAlreadyAdded(const Float:current[3],&type,&Float:dist){
    new 
LastFoundIndex=-1;
    for (new 
typeOriginStart<= typeOriginFinali++){
        for (new 
0OriginsCount[i]; n++){
            new 
Float:tmpdist=GetVectorDistance(Origins[i][n],current);
            if (
tmpdist<dist){
                
dist=tmpdist;
                
type=i;
                
LastFoundIndex=n;
            }
        }
    }
    return 
LastFoundIndex;
}

AddNewOriginsPoint(client,type,Float:Origin[3],replace=false,id=0){
    new 
String:ValName[5];
    
//Load
    
new Handle:kv OpenItemsConfig(_,type);
    new 
NextNum=id;
    if (!
replace){
        
//add
        
NextNum=GetNextOriginNum(kv);
        
IntToString(NextNum,ValName,sizeof(ValName));
        new 
originsc=OriginsCount[type];
        
Origins[type][originsc]=Origin;
        
OriginsCount[type]=NextNum+1;
    }else{
        
IntToString(id,ValName,sizeof(ValName));
        
Origins[type][id]=Origin;
    }
    
KvSetVector(kv,ValName,Origin);
    
//reply
    
if (client){
        
ReplyToCommand(client,"\x4Success saved \x3%s \x4point as num \x3%d",g_sOriginTypes[type],NextNum);
    }
    
    
//Save
    
CloseItemsConfig(kv,true);
}

DeleteOriginsPoint(type,id,client=0){
    new 
String:ValName[5];
    
//Load
    
new Handle:kv OpenItemsConfig(_,type);
    new 
LastNum=OriginsCount[type]-1//GetNextOriginNum(kv);
    
if (id!=LastNum){
        
IntToString(id,ValName,sizeof(ValName));
        
Origins[type][id]=Origins[type][LastNum];
        
KvSetVector(kv,ValName,Origins[type][LastNum]);
    }
    
IntToString(LastNum,ValName,sizeof(ValName));
    
KvDeleteKey(kv,ValName);
    
OriginsCount[type]--;
    
//reply
    
if (client){
        
ReplyToCommand(client,"\x4Success deleted \x3%s \x4point num \x3%d",g_sOriginTypes[type],id);
    }
    
#if DEBUG
    
DebugPrint("Deleted %s origin, num=%d",g_sOriginTypes[type],id);
    
#endif
    
    //Save
    
CloseItemsConfig(kv,true);
}


stock GetNextOriginNum(Handle:kv){
    new 
count=0;
    
//    KvSavePosition(kv);
    
if (KvJumpToKey(kv,"0")){
        new 
String:tmpStr[100];
        do
        {
            
KvGetSectionName(kv,tmpStr,sizeof(tmpStr))
            if (
StrContains(tmpStr,"SpecialItems")==-1)
                
count++;
        } while (
KvGotoNextKey(kv,false));
        
KvGoBack(kv);
    }
    return 
count;    
}

stock Float:GetRandomOrigin(type=-1){    
    if (
type==-1)
        
type=GetRandomInt(typeOriginStart,typeOriginFinal);
    new 
Float:Origin[3];
    new 
rnd1;
    if (
OriginsCount[type]==0) return Origin;
    if (
OriginsCount[type]==1) return Origins[type][0];
    
rnd1GetRandomInt(0,OriginsCount[type]-1);
    
Origin=Origins[type][rnd1];
    
#if DEBUG
    
DebugPrint("Generated random origin %f %f %f, type=%d, num=%d",Origin[0],Origin[1],Origin[2],type,rnd1);
    
#endif
    
return Origin;
}

// =======================================================================
// ============================  SPAWN ITEMS =============================
// =======================================================================

SpawnDefaultItems()
{
    
    
SpawnItemsTypeCountR(typeOriginRandom,ItemsMinCounts[ORIGIN_TYPES_COUNT],ItemsMaxCounts[ORIGIN_TYPES_COUNT]);
    for (new 
typeOriginStart<= typeOriginFinali++){
        
SpawnItemsTypeCountR(i,ItemsMinCounts[i],ItemsMaxCounts[i]);
    }
}

SpawnSpecialItems(){
    new 
Handle:kv OpenItemsConfig(_,_,true);
    new 
String:Map[32];
    
GetCurrentMap(Map32);
    
SubSpawnSpecialItems(kv,Map);
    
SubSpawnSpecialItems(kv,"All");
    
CloseItemsConfig(kv,false);
}

SubSpawnSpecialItems(Handle:kv,const String:Map[]){
    if (
KvJumpToKey(kv,Map)){
        for (new 
typeOriginStart<= typeOriginFinali++){
            if (
KvJumpToKey(kv,g_sOriginTypes[i])){
                if (
KvJumpToKey(kv,"SpecialItems")){
                    
KvGotoFirstSubKey(kv,false);
                    do{
                        
decl String:Item[50];
                        
KvGetSectionName(kv,Item,sizeof(Item));
                        new 
count=KvGetNum(kv,"");
                        
#if DEBUG
                        
DebugPrint("Parse specitem '%s' count=%s",Item,count);
                        
#endif
                        
if (count>1SpawnItemsCountR(Item,count,i);
                        else  
SpawnItemRandomle(Item,GetRandomOrigin(i));                                            
                    }while(
KvGotoNextKey(kv,false));
                    
KvGoBack(kv);
                    
KvGoBack(kv);
                }        
                
KvGoBack(kv);
            }
        }
        
KvGoBack(kv);
    } 
}

// =======================================================================
// ============================  SPAWN FUNCS =============================
// =======================================================================

SpawnItemsCountR(const String:Item[],count,type)
{
    for (new 
1<= countz++){
        
SpawnItemRandomle(Item,GetRandomOrigin(type));
    }
}
SpawnItemsTypeCountR(type,min,max)
{
    new 
Count;
    if (
type==typeOriginRandomtype=GetRandomInt(typeOriginPreCenter,typeOriginPreFinal);        
    if (
min==maxCount=min;
    else 
Count=GetRandomInt(min,max);

    for (new 
1<= Countz++){
        
SpawnRandomItem(GetRandomOrigin(type),type);
    }
}

SpawnItem(const String:Item[],const Float:Where[3]){
    if (
Where[0]!=0)
        {
        new 
String:SpawnedItem[50];
        if (
StrEqual(Item"fireaxe"false) || StrEqual(Item"frying_pan"false) || StrEqual(Item"machete"false) || StrEqual(Item"baseball_bat",false) || StrEqual(Item"crowbar",false) || StrEqual(Item"cricket_bat",false) || StrEqual(Item"katana",false) || StrEqual(Item"tonfa",false) || StrEqual(Item,"electric_guitar",false) || StrEqual(Item,"knife",false) || StrEqual(Item,"hunting_knife",false))
         {
                
Format(SpawnedItem,50,"weapon_melee");
         }
         else
         {
         
Format(SpawnedItem,50,"weapon_%s",Item);

         }
        new 
index CreateEntityByName(SpawnedItem);
        if (
index!=-1)
                {
                         if (
StrEqual(Item"fireaxe"false) || StrEqual(Item"frying_pan"false) || StrEqual(Item"machete"false) || StrEqual(Item"baseball_bat",false) || StrEqual(Item"crowbar",false) || StrEqual(Item"cricket_bat",false) || StrEqual(Item"katana",false) || StrEqual(Item"tonfa",false) || StrEqual(Item,"electric_guitar",false) || StrEqual(Item,"knife",false) || StrEqual(Item,"hunting_knife",false))
                         {
                                    
DispatchKeyValue(index,"melee_script_name",Item)
                         }          
            
TeleportEntity(indexWhereNULL_VECTORNULL_VECTOR);
            
DispatchSpawn(index);
            
ActivateEntity(index);
    
#if DEBUG
            
DebugPrint("Spawn item '%s' at %f %f %f",SpawnedItem,Where[0],Where[1],Where[2]);
        }else{
            
DebugPrint("ERROR on spawn item '%s' at %f %f %f",SpawnedItem,Where[0],Where[1],Where[2]);            
        }
    
#else
        
}    
    
#endif
    
}else{
        
#if DEBUG
        
DebugPrint("ERROR spawn item coords is NULL '%s'",Item);
        
#endif
    
}
}

SpawnItemRandomle(const String:Item[],Float:Where[3]){
    
Where[0]=Where[0]+(GetRandomInt(0,100)-50);
    
Where[1]=Where[1]+(GetRandomInt(0,100)-50);
    
Where[2]=Where[2]+30.0;
    
SpawnItem(Item,Where);
}


SpawnRandomItem(Float:where[3],typeOrigin=typeOriginRandom){
    new 
total=0;
    new 
Chances[MAX_ITEMS_COUNT];

    if (
typeOrigin==typeOriginStart || typeOrigin==typeOriginFinalChances=ItemChancesNoSF;
    else 
Chances=ItemChances;
    
    new 
item=GetRandomInt(1,1000);    
    for (new 
0MAX_ITEMS_COUNTi++){
        if (
item>=total && item<total+Chances[i]){
            
#if DEBUG
            
DebugPrint("Generated random item: %s, chance=%d, curchance=%d, rnd=%d",g_sItems[i],Chances[i],total,item);
            
#endif
            
SpawnItemRandomle(g_sItems[i],where);
            return;
        }
        
total=total+Chances[i];
    }
}

// =======================================================================
// ============================  POINTS STATS ============================
// =======================================================================

public Action:Command_ItemsStats(clientargs) {
    
ReplyToCommand(client,"\x4Stats:");
    new 
fAllOK=true;
    if ( 
OriginsCount[typeOriginStart]<2){
        
ReplyToCommand(client,"\x3- No Start origin");
        
fAllOK=false;
    }
    if ( 
OriginsCount[typeOriginFinal]<1){
        
ReplyToCommand(client,"\x3- No Final origin");
        
fAllOK=false;
    }
    if ( 
OriginsCount[typeOriginPreCenter]<5){
        
ReplyToCommand(client,"\x3- Need more PreCenter origins, now:\x4%d",OriginsCount[typeOriginPreCenter]);
        
fAllOK=false;
    }
    if ( 
OriginsCount[typeOriginCenter]<5){
        
ReplyToCommand(client,"\x3- Need more Center origins, now:\x4%d",OriginsCount[typeOriginCenter]);
        
fAllOK=false;
    }
    if ( 
OriginsCount[typeOriginPreFinal]<5){
        
ReplyToCommand(client,"\x3- Need more PreFinal origins, now:\x4%d",OriginsCount[typeOriginPreFinal]);
        
fAllOK=false;
    }
    if (
fAllOK){
        
ReplyToCommand(client,"\x3- Map Origins Complete");
    }
    
PrintToConsole(client,"Loaded origins: SO:%d, PCO:%d, CO:%d, PFO:%d, FO:%d",OriginsCount[typeOriginStart],OriginsCount[typeOriginPreCenter],OriginsCount[typeOriginCenter],OriginsCount[typeOriginPreFinal],OriginsCount[typeOriginFinal]);
    return 
Plugin_Handled;
}

public 
Action:Command_AllItemsStats(clientargs) {
    new 
Handle:kv OpenItemsConfig(_,_,true);
    
    
//maps
    
KvGotoFirstSubKey(kv);
    do
    {
        new 
fAllOK=true;
        new 
fMapSended=false;
        new 
String:MapName[100];
        
KvGetSectionName(kv,MapName,sizeof(MapName))
        if (!
strcmp(MapName,"All"))
            continue;
        
KvSavePosition(kv);
        for (new 
05z++){
            new 
count=0;
            if(
KvJumpToKey(kv,g_sOriginTypes[z])){
                
count=GetNextOriginNum(kv);
                
KvGoBack(kv);
            }            
            if (
z==&& count<2){
                if (!
fMapSended){
                    
ReplyToCommand(client,"\x4Map: \x3%s",MapName);
                    
fMapSended=true;
                }
                
ReplyToCommand(client,"\x3- No Start origin");
                
fAllOK=false;
            }
            if (
z==&& count<1){
                if (!
fMapSended){
                    
ReplyToCommand(client,"\x4Map: \x3%s",MapName);
                    
fMapSended=true;
                }
                
ReplyToCommand(client,"\x3- No Final origin");
                
fAllOK=false;
            }
            if (
z==&& count<5){
                if (!
fMapSended){
                    
ReplyToCommand(client,"\x4Map: \x3%s",MapName);
                    
fMapSended=true;
                }
                
ReplyToCommand(client,"\x3- Need more PreCenter origins, now:\x4%d",count);
                
fAllOK=false;
            }
            if (
z==&& count<5){
                if (!
fMapSended){
                    
ReplyToCommand(client,"\x4Map: \x3%s",MapName);
                    
fMapSended=true;
                }
                
ReplyToCommand(client,"\x3- Need more Center origins, now:\x4%d",count);
                
fAllOK=false;
            }
            if (
z==&& count<5){
                if (!
fMapSended){
                    
ReplyToCommand(client,"\x4Map: \x3%s",MapName);
                    
fMapSended=true;
                }
                
ReplyToCommand(client,"\x3- Need more PreFinal origins, now:\x4%d",count);
                
fAllOK=false;
            }            
        }
        if (!
fAllOK){
            
ReplyToCommand(client,"\x4=================================");        
        }
        
KvGoBack(kv);
    } while (
KvGotoNextKey(kv,false));
    
CloseItemsConfig(kv);
    return 
Plugin_Handled;
}

// =======================================================================
// ============================  BEAM RING ===============================
// =======================================================================

stock isPointAroundPlayer(const Float:current[3],Float:CheckMaxDist=1100.0){
    
decl Float:AbsOrigin[3];
    for (new 
i=1i<=MaxClientsi++){ 
        if (!
IsClientInGame(i)) continue; //not ingame? skip
        
if (GetClientTeam(i) != 2) continue; //not infected? skip
        
if (!IsPlayerAlive(i)) continue; //not alived? skip
        
if (IsFakeClient(i)) continue; //bot? skip
        
        
GetClientAbsOrigin(i,AbsOrigin);
        if (
GetVectorDistance(AbsOrigin,current)<CheckMaxDist) return i;
    }
    return -
1;
}

public 
Action:CheckBeamRingsTimer(Handle:timer)
{
    
RingsCount=0;
    for (new 
typeOriginStart<= typeOriginFinali++){
        for (new 
0OriginsCount[i]; n++){
            if (
isPointAroundPlayer(Origins[i][n])==-1) continue;
            
AddBeamRing(Origins[i][n]);
        }
    }
        
    return 
Plugin_Continue;
}

public 
Action:CreateBeamRingTimer(Handle:timer)
{
    static 
bool:bIn=false;
    if (!
RingsCount) return Plugin_Continue;
    for (new 
0RingsCounti++){
        new 
Float:where[3];
        
where[0]=Rings[i][0];
        
where[1]=Rings[i][1];
        
where[2]=Rings[i][2];
        
CreateBeamRing(where,bIn,Rings[i][3]);
    }
    
bIn=!bIn;
    return 
Plugin_Continue;
}

CreateBeamRing(Float:where[3],bool:bIn=falseFloat:minRadius){
    new 
Float:fCurDist=fMaxDist-GetVectorDistance(Origins[typeOriginFinal][0],where);
    new 
Float:fCurPercent=FloatDiv(FloatAbs(fCurDist),fOnePercent);
    new 
RingColor[4] = {2550050};
    if (
FloatCompare(fCurPercent,50.0)<=0)
        
RingColor[1]=FloatMul(FloatMul(fCurPercent,2.0),2.55);
    else{
        
RingColor[0]=255-RoundToFloor(FloatMul(FloatMul(FloatSub(fCurPercent,50.0),2.0),2.55));
        
RingColor[1]=255;
    }
    
    
TE_SetupBeamRingPoint(where,(bIn?minRadius*2:minRadius), (bIn?minRadius:minRadius*2), g_BeamSpriteg_HaloSprite011.03.00.0RingColor10);
    
TE_SendToAll();    
}

AddBeamRing(Float:where[3],Float:minRadius=100.0){
    if (
RingsCount>=MAX_RINGS_COUNT) return;
    
Rings[RingsCount][0]=where[0];
    
Rings[RingsCount][1]=where[1];
    
Rings[RingsCount][2]=where[2];
    
Rings[RingsCount][3]=minRadius;
    
RingsCount++;
    
#if DEBUG_BEAMRINGS
    
DebugPrint("Added BeamRing [ %f, %f, %f ], count=%d",where[0],where[1],where[2],RingsCount);
    
#endif
}

stock DeleteBeamRing(Float:where[3]){
    
#if DEBUG_BEAMRINGS
    
DebugPrint("Deleted BeamRing [ %f, %f, %f ]",where[0],where[1]where[2]);
    
#endif
    
for (new 0RingsCounti++){
        if (
Rings[i][0]==where[0] && Rings[i][1]==where[1] && Rings[i][2]==where[2]){
            if (
i==RingsCount-1){
                
RingsCount--;
                return;
            }
            
Rings[i][0]=Rings[RingsCount-1][0];
            
Rings[i][1]=Rings[RingsCount-1][1];
            
Rings[i][2]=Rings[RingsCount-1][2];
            
Rings[i][3]=Rings[RingsCount-1][3];
            
RingsCount--;
            return;
        }
    }
}

// =======================================================================
// ============================  STUFF ===================================
// =======================================================================


DebugPrint(const String:format[], any:...)
{
    
#if DEBUG
    
static bool:bLogFileInit=false;
    static 
String:logPath[256];
    
decl String:buffer[300];
    
VFormat(buffersizeof(buffer), format2);
    if (!
bLogFileInit){
        
BuildPath(Path_SMlogPathsizeof(logPath), "logs/AutoSpawnItems.log");    
        
bLogFileInit=true;
    }
    
//PrintToChatAll(buffer);
    
LogToFileEx(logPath,buffer);
    
#endif



marvel 04-03-2010 05:52

Re: [L4D2] Auto Items Spawn (BETA)
 
Thanks I have tested this, but from what I could see (in c1m1_hotel) only fireaxe and ninja sword worked. I think the map needs to support the melee weapon or it won't spawn.

marvel 04-03-2010 07:02

Re: [L4D2] Auto Items Spawn (BETA)
 
Another glitch, defibs are bugged. Sometimes you're just alive and then when you're carrying a defib you get defibbed and lose your weapons. weird bug.

marvel 04-03-2010 07:22

Re: [L4D2] Auto Items Spawn (BETA)
 
1 Attachment(s)
Quote:

Originally Posted by marvel (Post 1137432)
Thanks I have tested this, but from what I could see (in c1m1_hotel) only fireaxe and ninja sword worked. I think the map needs to support the melee weapon or it won't spawn.

I can confirm this, in dark carnival I could spawn electric guitars etc so your modified version works.

I've attached it for the lazy people like me.

V10 04-03-2010 15:16

Re: [L4D2] Auto Items Spawn (BETA)
 
Quote:

Originally Posted by IIPu3PAK (Post 1136517)
NO SPAWN MELEE WEAPON!!!111
my cfg

I do not understand why your post big config(and plugin code) in text form(attachment exist), it kills my traffic, please delete config from message.
in config i use this:
"machete" "2;0"
"weapon_chainsaw" "5;0"
etc
For spawn any melee weapon on any map please see that:
http://forums.alliedmods.net/showpos...&postcount=121
Are you russian by any chance (judging by your nick)? If so, maybe we should talk in russian in private.

Quote:

Im edit you plugin,now this can spawn melee weapon
Your code does not change nothing. Map can keep melee weapon or not support.

Edit: Sry, I use simple changed version of plugin (version was not posted here) and her spawn melee works.
I update plugin to vesrion 1.5.

V10 04-03-2010 19:30

Re: [L4D2] Auto Items Spawn
 
Version 1.5 released

marvel 04-04-2010 11:58

Re: [L4D2] Auto Items Spawn (BETA)
 
Quote:

Originally Posted by V10 (Post 1137915)
marvel you can delete overquoting from your message? please.

Sure np, thanks for the update. I can see you fixed ammo for the weapons. I'm going to try this, thanks!

Nataraja 04-05-2010 03:09

Re: [L4D2] Auto Items Spawn
 
Could u plz give more examples???
Thx!

IIPu3PAK 04-05-2010 16:04

Re: [L4D2] Auto Items Spawn
 
Quote:

Edit: Sry, I use simple changed version of plugin (version was not posted here) and her spawn melee works.
I update plugin to vesrion 1.5.
Well, that's why I was looking for a spawn melee weapons? -_- damn

IIPu3PAK 04-07-2010 12:48

Re: [L4D2] Auto Items Spawn
 
Хочется увидеть возможность ставить в конфиге около точки радиус разброса вещей в этой точке... а то иногда когда ставишь точку в закрытом пространстве то вещи могут появляться в стенах!!!

V10 04-07-2010 13:06

Re: [L4D2] Auto Items Spawn
 
Quote:

Originally Posted by IIPu3PAK (Post 1142548)
Хочется увидеть возможность ставить в конфиге около точки радиус разброса вещей в этой точке... а то иногда когда ставишь точку в закрытом пространстве то вещи могут появляться в стенах!!!

Да это есть в планах, но пока нет времени, придется много чего переписать+конвертировать конфиг.
Quote:

Quote:

Originally Posted by IIPu3PAK (Post 1142548)
I would like to see the opportunity to put in the config radius around the point spread of things at this point ... and sometimes when to put the point in a confined space then things may appear in the walls !!!

Yes it is in the plans, but no time have a lot to rewrite + convert config.

IIPu3PAK 04-08-2010 04:52

Re: [L4D2] Auto Items Spawn
 
А можно ли заспавнить этим скриптом кучку_патронов, если да то что надо прописать в конфиг?

marvel 04-14-2010 09:11

Re: [L4D2] Auto Items Spawn
 
Quote:

Originally Posted by IIPu3PAK (Post 1142548)
Хочется увидеть возможность ставить в конфиге около точки радиус разброса вещей в этой точке... а то иногда когда ставишь точку в закрытом пространстве то вещи могут появляться в стенах!!!

Had to translate the russian :) but I agree. I spawn a lot of items right now it would be nice to have them spawn within a certain area.

I use one server and spawn only medkits there but they are spread through the entire saferoom which makes one big mess of it. My other servers spawns everything, from pipebombs to pillz, chainsaws etc which gives one big mess lol.

So would it be possible to spawn medkits together, pipes together etc. ?

V10 04-14-2010 10:42

Re: [L4D2] Auto Items Spawn
 
Quote:

Originally Posted by marvel (Post 1150062)
Had to translate the russian :) but I agree. I spawn a lot of items right now it would be nice to have them spawn within a certain area.

I use one server and spawn only medkits there but they are spread through the entire saferoom which makes one big mess of it. My other servers spawns everything, from pipebombs to pillz, chainsaws etc which gives one big mess lol.

So would it be possible to spawn medkits together, pipes together etc. ?

No, but you can modify(delete, edit) spawn point in sm_itemsmenu
I no have free time for create correct spawn points for all maps, if someone would create such a config, I will include it in their version.
to view spawn points use sm_allowitemrings 1 (only alived survivor can view spawn point rings)

marvel 04-23-2010 13:42

Re: [L4D2] Auto Items Spawn
 
This plugin broke with DLC. Only spawns shotguns now :)

V10 04-27-2010 05:50

Re: [L4D2] Auto Items Spawn
 
Quote:

Originally Posted by marvel (Post 1158309)
This plugin broke with DLC. Only spawns shotguns now :)

I no have this problem...other users?

V10 04-30-2010 10:44

Re: [L4D2] Auto Items Spawn
 
Version 1.6 released:
- Added m60 support (dlc)

marvel 05-08-2010 21:56

Re: [L4D2] Auto Items Spawn
 
Great, I'll try it thanks.

Eraa 05-12-2010 15:40

Re: [L4D2] Auto Items Spawn
 
Hi, this is a good plugin but I can not have the proper setup. Sometimes that spawn only pipbomb/Molotov or Adrenaline/Pills etc..
It would be much more accurate if we could configure the spawn area by category : Start, Items, Weapons, Grenades, Upgrade, Melee.

Doswhore 06-02-2011 05:10

Re: [L4D2] Auto Items Spawn
 
So can someone tell me if I can use this to spawn every weapon at the start of each round? Or at least one from each tear. And or help me to set this up. My server is pretty difficult. I used to have points mod but I was getting alot of errors and having trouble balancing it. Now I have perkmod 2 and I think if I had every weapon at the start of the map it would help. Thanks.

carlos moschen 09-11-2011 12:56

Re: [L4D2] Auto Items Spawn
 
friend you could add these maps?


/ / MAP THE PASSING \ \

-> C6m1_riverbank
-> C6m2_bedlam
-> C6m3_port


/ / MAP THE SACRIFICE \ ​​\

-> C7m1_docks
-> C7m2_barge
-> C7m3_port


/ / MAP NO MERCY \ \

-> C8m1_apartment
-> C8m2_subway
-> C8m3_sewers
-> C8m4_interior
-> C8m5_rooftop


/ / MAP DEAD AIR \ \

-> C11m1_greenhouse
-> C11m2_offices
-> C11m3_garage
-> C11m4_terminal
-> C11m5_runway


/ / MAP BLOOD HARVEST \ \

-> C12m1_hilltop
-> C12m2_traintunnel
-> C12m3_bridge
-> C12m4_barn
-> C12m5_cornfield


/ / MAP COLD STREAM \ \

-> C13m1_alpinecreek
-> C13m2_southpinestream
-> C13m3_memorialbridge
-> 13m4_cutthroatcreek

---------------------------------------------------------------------------

It helps me here:

would leave the weapons that way, as in the picture? organize them, the person taking the gun and will always have more than one, would do this? if yes how?


image -> http://upmaximum.webs.com/hi.png


All times are GMT -4. The time now is 11:40.

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