AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Approved Plugins (https://forums.alliedmods.net/forumdisplay.php?f=8)
-   -   Steer your nade. 1.4 (https://forums.alliedmods.net/showthread.php?t=27664)

Ramono 04-26-2006 13:04

Steer your nade. 1.4
 
2 Attachment(s)
This plugin allows you to steer your own grenades.
When you trow a grenade your view will change to the one of the grenade and use your mouse to steer it.

Cvars:
Code:

amx_grencam 1/0  ( Default 1 )
enables/disables plugin

amx_smokecam 1/0  ( Default 0 )
Make the effect on a smoke grenase ( strongly recommanded "0", read bugs )

amx_gravgren 1/0 ( Default 0 )
When 1 the grenade goes down with gravity, so steer left and right only and also is more realistic, 0 is just free trow and more fun.

amx_grenexplode 1/0 ( Standard 1 )
When 1 it allows the client to let his grenate explode on a click.

Bugs:
Code:

Smoke granades can fly as long as they don't hit the ground ( to fix this set amx_smokecam to 0 )
Smoke granates stay +-30 sec after explosion, and the cam stays stuck in it ( to fix this set amx_smokecam to 0 )

Modules:
Code:

Engine
History
Code:

< 0.99 Private use + bug fixing
1.0 Public release
1.1 Used Pcvar for better amxmodxx 1.7 compatabillity + removed unused function ( thanks v3x )
1.2 fixed high ping players dont get grenade view
1.3 Added attack button = grenade explode ( thanks VEN! )
1.4 Added a cvar + added v3x suggestion.

To do:
Code:

Fix the smoke gren bugs ( If its possable )
Add speed control
attack click = explode grenade. DONE in 1.3!!!

Have fun with it!!!

( the zip file is a small movie of how it works )

Xanimos 04-26-2006 13:19

Sounds origional. I'm going to wait for client responses on how it works. Try and fix those bugs though too.

ch3cker 04-26-2006 13:20

very nice plugin
can you make it so that you can't leave the fly of the smoke ??

Ramono 04-26-2006 13:21

Quote:

Originally Posted by Suicid3
Sounds origional. I'm going to wait for client responses on how it works. Try and fix those bugs though too.

+
Quote:

Originally Posted by ch3cker
very nice plugin
can you make it so that you can't leave the fly of the smoke ??

Can't figure out how, thats why i added a cvar. ^_^
And even when fixed the "Stuck in smoke-gren bug"
You can fly around the map as long as you want.
and that is a CS thing/bug

Lt Llama 04-26-2006 13:35

Hax master :wink:

Very nice idea. In what dimensions can you control the nade? Up, down, left, right? Can you also influence the speed of the nade and make it fly as long as you want?

Is it like a guided missile with amx_gravgren 1?
Would be cool to be able to control speed of nade to.

Damn, wanna test this.

n1

+rep

Ramono 04-26-2006 13:39

Quote:

Originally Posted by Lt Llama
Hax master :wink:

Very nice idea. In what dimensions can you control the nade? Up, down, left, right? Can you also influence the speed of the nade and make it fly as long as you want?

Is it like a guided missile with amx_gravgren 1?
Would be cool to be able to control speed of nade to.

Damn, wanna test this.

n1

+rep

Yes, up down left right, anyway u want it.
The speed of the grenade is the grenades standard speed.
It makes u fly untill the nade explodes.
and with amx_gravgren "0" its like a missile, 1 is with gravity.
Controlable speed will be added in "future" versions

v3x 04-26-2006 14:00

I'll try and test it on my server before I go to sleep ( been up for about 24 hours ).

Edit: Use the pcvar natives.

Edit #2:
Code:
#include <amxmodx> #include <engine> #define PLUGIN "Steer nades" #define VERSION "1.0" #define AUTHOR "NL)Ramon(NL" new bool:isgren[33] new whosgren[33] new grencam new smokecam new gravgren public plugin_init() {     register_plugin(PLUGIN, VERSION, AUTHOR)     grencam = register_cvar("amx_grencam","1")     smokecam = register_cvar("amx_smokecam","0")     gravgren = register_cvar("amx_gravgren","0") } public trowed() {     new id = read_data(1)     set_task(0.1,"makecam",id) } public grenade_throw(id,grenid,grentype) {     if(get_pcvar_num(grencam) <= 0 || is_user_bot(id)) return PLUGIN_CONTINUE     if(get_pcvar_num(smokecam) <= 0 && grentype == 9) return PLUGIN_CONTINUE     if(grenid <= 0)     {         isgren[id] = false         return PLUGIN_CONTINUE     }     isgren[id] = true     whosgren[id] = grenid     attach_view(id,grenid)     return PLUGIN_CONTINUE } public client_PreThink(id){     if(!isgren[id]) return PLUGIN_CONTINUE     if(!is_valid_ent(whosgren[id]))     {         isgren[id] = false         attach_view(id,id)         whosgren[id] = 0         return PLUGIN_CONTINUE     }     new Float:angles[3]     entity_get_vector(id,EV_VEC_v_angle,angles)     new Float:setvel[3]     velocity_by_aim(id,get_speed(whosgren[id]),setvel)     if(get_pcvar_num(gravgren))     {         new Float:vel[3]         entity_get_vector(whosgren[id],EV_VEC_velocity,vel)         setvel[2] = vel[2]     }     entity_set_vector(whosgren[id],EV_VEC_velocity,setvel)     entity_set_vector(whosgren[id],EV_VEC_angles,angles)     return PLUGIN_CONTINUE }

Ramono 04-28-2006 18:34

Its done, but what is the big difference between cvar_num and pcvar_num?

Batman/Gorlag 04-28-2006 18:45

Using get_pcvar_num is much faster than get_cvar_num. That's the difference.

seoulxkorean 04-29-2006 19:56

i tested this but i get stuck in the gren cam just using the HE grenade =(


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

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