AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Pallets with Bags (https://forums.alliedmods.net/showthread.php?t=52927)

SAMURAI16 03-22-2007 10:27

Pallets with Bags
 
3 Attachment(s)
Pallets with Bags
Author : SAMURAI
Version : 0.2c
Wath a trailer with plugin in action

Changelog :
Version 0.2c:
Removed the cvar for set it to make pallets with bags destroyable or no.
To be destroyable, just set the health > 0.

Version 0.2b:
Added an cvar to set if can destroy pallets with bagsAdded an cvar to set the health of pallets with bags Removed checks for hull vacant Added a new check to see if user is trying to place models on the sky
Version 0.2:

Code optimized
Fixed grammar problems
Fixed the problem with new round event

Version 0.1:
Initial version.

Plugin details:
With this plugin, admins have posibilty to place anywhere on map pallets with bags. Looks like walls used on wars.
The pallets with bags are solid, can be destroyed or not (set the health 0 and will be undestroyable), and if you want, you can place one over one.

Cvars:
pallets_wbags - Enable / Disable the plugin.
1 = Enabled (default). 0 = Disabled.

pallets_wbags_nroundrem - On new round, if this cvar is enabled, all palets with bags placed will be removed.
1 = Enabled
0 = Disabled (default) .

pallets_wbags_max - Set the maximum of pallets with bags that can be placed
Default = 64
pallets_wbags_health - Set the health of a pallet with bags . If the health is > 0, you will can destroy pallets with bags. So if you want to make it undestroyable, set the health 0
Default = 0.
Required Modules:
- Fakemeta

Admin Commands:

say pallets_menu - Open the menu of pallets with bags, and there you can choose:
1 - Place a pallet with bags
2 - Remove a pallet with bags
- To remove an pallet with bags you must aiming at a valid pallet with bags.
3 - Remove all pallets with bags
- This will remove the all pallets with bags placed on map.

NOTE :
- Admins must have RCON acces to use pallets with bags menu.
- Available are 2 models, will be set a random of them.
- The pallets with bags are placed where you are aiming
- To destroy a pallet with bags, set the cvar "pallets_wbags_health" > 0. An pallet with bags, to can be destroyed, set the health before place a pallet with bags

Install:
- Install the plugin like any plugin
- Extract the models arhive on your \cstrike\models\ folder.

Credits:
- P34nut for get_user_hitpoint stock.
-
Avalanche some indicates
- manchimocyrus for trailer

Download the last version of this plugin : http://www.cs-utilz.net/viewtopic.ph...st=0&sk=t&sd=a

See screenshot:


jim_yang 03-22-2007 10:41

Re: Pallets with Bags
 
seems funny

hip_hop_x 03-22-2007 10:58

Re: Pallets with Bags
 
yup, it's a good plugin.

vvg125 03-22-2007 11:52

Re: Pallets with Bags
 
Interesting, I'll test it out soon... However I would just like to point out two grammatical errors in your screenshot.

Code:

1. Place an pallet with bags
2. Remove an pallet with bags

should be:

Code:

1. Place a pallet with bags
2. Remove a pallet with bags


VEN 03-22-2007 13:12

Re: Pallets with Bags
 
Code:
 register_event("ResetHUD","event_newround","b");
This isn't a new round event, see here for details: http://forums.alliedmods.net/showthread.php?t=42159

Code:
stock get_user_hitpoint(id, Float:hOrigin[3])
FYI, there are also
Code:
stock fm_get_aim_origin(index, Float:origin[3])
in the Fakemeta Utilities.

Quote:

for tell me about is_hull_vacant stock
Of course it's good that you've been informed about this stock but unfortunately you haven't been informed how to use it. I.e.
Code:
hull = pev(id, pev_flags) &  HULL_HUMAN
Do you realise what you are doing here? Please tell me.

MultiShot 03-22-2007 20:31

Re: Pallets with Bags
 
Um, a quick question:
so this mainly blocks a path so people can't get through?

ThomasNguyen 03-22-2007 22:26

Re: Pallets with Bags
 
Not quite. I think its main purpose is to allow the admin to place the bags in certain area's so players can take cover.. Making the map more fun.

sytremelaker 03-22-2007 23:08

Re: Pallets with Bags
 
Do you mind adding the option of making them destroyable after taking (x) amount of damage? It shouldn't be anything easy to destroy.

Brad 03-23-2007 08:25

Re: Pallets with Bags
 
Ideally the damage needed to destroy a bag would be set by a CVAR.

hjkwe654 03-23-2007 09:33

Re: Pallets with Bags
 
.sma ?

SAMURAI16 03-23-2007 10:11

Re: Pallets with Bags
 
Quote:

Originally Posted by hjkwe654 (Post 455843)
.sma ?

Sorry the site i think is momentan with problems . I can't upload the sma

manchimocyrus 03-23-2007 10:14

Re: Pallets with Bags
 
samurai16 the .sma??????????????

SAMURAI16 03-23-2007 10:17

Re: Pallets with Bags
 
Quote:

Originally Posted by manchimocyrus (Post 455858)
samurai16 the .sma??????????????

Sorry the site i think is momentan with problems . I can't upload the sma

SAMURAI16 03-23-2007 12:12

Re: Pallets with Bags
 
Quote:

Originally Posted by VEN (Post 455531)

Of course it's good that you've been informed about this stock but unfortunately you haven't been informed how to use it. I.e.
Code:
hull = pev(id, pev_flags) & HULL_HUMAN

Do you realise what you are doing here? Please tell me.

I used that to check for the free spot. It's the first time when i used . I saw in hlds_const HULL defines and i decided to use HULL_HUMAN. I tested on server, and seems to can't place models on air.
Please tell a good method to use it

VEN 03-23-2007 12:16

Re: Pallets with Bags
 
Quote:

I saw in hlds_const HULL defines and i decided to use HULL_HUMAN
Quote:

Originally Posted by hlsdk_const.inc
// The hullnumber paramater of EngFunc_TraceHull, EngFunc_TraceModel and DLLFunc_GetHullBounds

I think you didn't get my question. Do you understand what you are doing below?
Quote:

hull = pev(id, pev_flags) & HULL_HUMAN

SAMURAI16 03-23-2007 12:38

Re: Pallets with Bags
 
not verry sure . Can explain me with high details ?
I used that way, because that comes on my brain, i tested an worked anyway

VEN 03-23-2007 13:26

Re: Pallets with Bags
 
HULL_* isn't related to entity flags constants directly because flags is using FL_* constants, so you can't just do: hull = pev(id, pev_flags) & HULL_HUMAN but you can detect player's hull number (HULL_*) based on his ducking (FL_DUCKING) state check.

If you would like to know how actually you can use is_hull_vacant() you have to look into the source code of Teleport Smoke Grenade (where this function was originally used).

If you going to read hlsdk_const.inc carefully, you'll see:
Quote:

Originally Posted by hlsdk_const.inc
// The hullnumber paramater of EngFunc_TraceHull, EngFunc_TraceModel and DLLFunc_GetHullBounds
Furthermore how bags is related to player's hull? I'm confused.

SAMURAI16 03-23-2007 14:28

Re: Pallets with Bags
 
with this:
PHP Code:

static hull;
hull pev(idpev_flags) & FL_DUCKING HULL_HEAD HULL_HUMAN 

I can't place anywhere
Or, i think isn't required tracehull on my plugin, and i don't understand how can my code ( if(pev(id,pev_flags) & HULL_HUMAN) ) can works. Only what i want on my plugin, is to check if users isn't aiming at sky, i think its enough only that.
Any suggestions ? how works tracemodel and gethullbounds ?

VEN 03-23-2007 15:05

Re: Pallets with Bags
 
Quote:

Furthermore how bags is related to player's hull?
Quote:

i think isn't required tracehull on my plugin
You get it correct.

Quote:

what i want on my plugin, is to check if users isn't aiming at sky
Just do player aim trace and check if vecEndPos PointContents isn't equal to CONTENTS_SKY.

SAMURAI16 03-23-2007 15:14

Re: Pallets with Bags
 
this is good ?
PHP Code:

static Float:origin1[3];
pev(id,pev_origin,origin1);
static 
ptr;
engfunc(EngFunc_TraceLine,origin1,xorigin,IGNORE_MONSTERS,id,ptr);

static 
Float:vecEndPos[3];
get_tr2(ptr,TR_vecEndPos,vecEndPos)
if(
engfunc(EngFunc_PointContents,vecEndPos) == CONTENTS_SKY)
{
        
client_print(id,print_chat,"[AMXX] You can't place a pallet with bags there");
        return 
PLUGIN_HANDLED;



VEN 03-23-2007 15:31

Re: Pallets with Bags
 
No just
Quote:

if(engfunc(EngFunc_PointContents,xorigin) == CONTENTS_SKY)

because your xorigin is actually aim trace vecEndPos

SAMURAI16 03-23-2007 15:35

Re: Pallets with Bags
 
works, thanks
Now wait untill i will can upload the sma.

hjkwe654 03-23-2007 21:41

Re: Pallets with Bags
 
Quote:

Originally Posted by SAMURAI16 (Post 455979)
works, thanks
Now wait untill i will can upload the sma.

you can post .sma content in your topic

SAMURAI16 03-24-2007 00:47

Re: Pallets with Bags
 
see in the first post, i posted the plugin on a free host untill site will work correct.

manchimocyrus 03-24-2007 02:03

Re: Pallets with Bags
 
The link works. Thanks.

SAMURAI16 03-24-2007 11:29

Re: Pallets with Bags
 
Version 0.2b released
Added an cvar to set if can destroy pallets with bags
Added an cvar to set the health of pallets with bags
Removed checks for hull vacant
Added a new check to see if user is trying to place models on the sky


manchimocyrus 03-24-2007 11:56

Re: Pallets with Bags
 
Added an cvar to set if can destroy pallets with bags
Added an cvar to set the health of pallets with bags

Not works

SAMURAI16 03-24-2007 12:05

Re: Pallets with Bags
 
thanks, fixed . Read on notes how to make to can destroy a pallet with bags

SAMURAI16 03-24-2007 13:06

Re: Pallets with Bags
 
Version 0.2c released
Removed the cvar for set it to make pallets with bags destroyable or no.
To be destroyable, just set the health > 0.

manchimocyrus 03-24-2007 14:18

Re: Pallets with Bags
 
Not works man is the same thing. Pallets with bags can not be destroyd.

SAMURAI16 03-24-2007 14:18

Re: Pallets with Bags
 
it's work . I tested . Just set the health 50 for example and shoot on it. Works 100 %

SAMURAI16 03-25-2007 08:58

Re: Pallets with Bags
 
- Added a movie with plugin in action ; see in first post :o

VEN 03-25-2007 09:26

Re: Pallets with Bags
 
Hints:

Quote:

register_concmd("say pallets_menu", ...)
Should be clcmd, not concmd. In other case you'll get "you are dead" when the command is executed from a server console.

Quote:

engfunc(EngFunc_PrecacheModel,"models/pallet_with_bags.mdl");
engfunc(EngFunc_PrecacheModel,"models/pallet_with_bags2.mdl");
Better use loop, so you don't have edit this every time MODELS_NUM is changed.

Instead of
Quote:

#define MODELS_NUM 2
new g_models[MODELS_NUM][] =

you can do
Quote:

new g_models[][] =
And to get a number of models you can use sizeof g_models. This will simplify editing of models list (no need to edit define in this case).

Quote:

if (equali(class, "amxx_pallets"))

You don't need to use equali since for example AMXX_pallets will not be your entity.

Quote:

if(id)
For what do you use this check? Do you realise that it isn't needed. Do you realise why?

Also i do not know whether it was planned or not to not check the distance between player and bag, in fact the bag may be placed far away from a player.

SAMURAI16 03-25-2007 09:36

Re: Pallets with Bags
 
done
see now

Bonesmuggler 03-25-2007 15:37

Re: Pallets with Bags
 
So if I set some bags up in a corner with the cvar : pallets_wbags_nroundrem set to disable , and having the health set to 75, the pallet will return next new round if destroyed?
Also would be nice to have them save to a file so that every time the map changes to the map these were set on it would be there :), if that's possible.

SAMURAI16 03-25-2007 15:41

Re: Pallets with Bags
 
so, pallets_wbags_nroundrem is disable, bags have health 75, on nextround, woun't be destroyed . But if you shoot o a pallet with bags, that will be destroyed.

Maurice 03-26-2007 15:04

Re: Pallets with Bags
 
Awesome plugin! the plugin would even be greater for me if it is possible to set some coordinates in a .ine file so when the map reloads the pallets are still there, Anyway briljant job mate!

BioI-Iazard 03-27-2007 13:21

Re: Pallets with Bags
 
yea if the pallets would stay at map change that would be awesome!
still crazy plugin though
props given
keep it up

vvg125 03-28-2007 08:59

Re: Pallets with Bags
 
Quote:

Originally Posted by BioI-Iazard (Post 457547)
yea if the pallets would stay at map change that would be awesome!

It's not possible to make pallets stay the same place when you change maps. Coordinates will differ. However it is possible to make a specific .ini for each map with coordinates you put in and the pallets are loaded every time that map starts.

SAMURAI16 03-28-2007 14:24

Re: Pallets with Bags
 
Quote:

Originally Posted by vvg125 (Post 457886)
It's not possible to make pallets stay the same place when you change maps. Coordinates will differ. However it is possible to make a specific .ini for each map with coordinates you put in and the pallets are loaded every time that map starts.

maybe i will do on weekend


All times are GMT -4. The time now is 08:41.

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