This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Realistic Weapon Pickup 0.9


Post New Thread Reply   
 
Thread Tools Display Modes
danielkza
AMX Mod X Plugin Approver
Join Date: May 2007
Location: São Paulo - Brasil
Old 12-05-2008 , 17:51   Re: Realistic Weapon Pickup 0.8
Reply With Quote #11

Quote:
Originally Posted by Exolent[jNr] View Post
I'm going to add on to what arkshine said:



new bool:is_glowing[33][2049]

You should just do a bit sum.

Code:
new g_glowing_ents[33]; // to set a ent glowing for the player g_glowing_ents[id] |= (1<<ent); // to remove g_glowing_ents[id] &= ~(1<<ent); // to check if( g_glowing_ents[id] & (1<<ent) )


I think that should work fine.
Unless I'm being stupid and there is a limit for bits.
If I am being stupid, use a dynamic Array, and push/delete entities when they are(n't) glowing.

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

For your cvar with color:
You call that so many times in the plugin.
You call it every AddToFullPack frame, and every time the HUD is shown a message (every 0.1 seconds when enabled).
Instead, hook the new round event and store the colors in global variables each round.

EDIT:

Also, I don't see anywhere that you set the glowing entity to remove the glow if player moves away from the weapon.
Max 32 bits (0-31) for x86 and 64 (0-64) for x64. And In my opinion, using more memory in arrays in favor of less CPU use is better, since memory is much cheaper than new processors.
__________________

Community / No support through PM
danielkza is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-05-2008 , 17:51   Re: Realistic Weapon Pickup 0.8
Reply With Quote #12

I edited again before I even saw your post.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
shine771
Senior Member
Join Date: Jun 2007
Old 12-05-2008 , 18:16   Re: Realistic Weapon Pickup 0.8
Reply With Quote #13

That is_glowing array i had fixed some time ago. Just added that on round_start it writes cvars in global variables. Fixed the version xd too. Made classname[33] a static variable.
I never thought that my code would be That much ****** up... :O.

EDIT: @arkshine - how often you change weapons in cs, 1 round? Less than 3.

Last edited by shine771; 12-05-2008 at 18:27.
shine771 is offline
letgoofmyeggs
Senior Member
Join Date: Aug 2006
Old 12-05-2008 , 20:56   Re: Realistic Weapon Pickup 0.8
Reply With Quote #14

lol so can yu set the cvar so yu can picc up a gun all tha way across the map?
letgoofmyeggs is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 12-06-2008 , 01:09   Re: Realistic Weapon Pickup 0.8
Reply With Quote #15

Everything seems okay except for one thing you overlooked:
Code:
public addtofullpack(es_handle,e,ent,id,hostflags,player,pSet) {     if(!is_user_alive(id) || !get_pcvar_num(onoff) || !get_pcvar_num(glow) || (id==ent)) return FMRES_IGNORED         if(is_glowing[id]==ent) {         new temp_rgb[12],temp_rgb2[3][4],rgb[3]                 get_pcvar_string(glow_color,temp_rgb,11)                 parse(temp_rgb,temp_rgb2[0],3,temp_rgb2[1],3,temp_rgb2[2],3)                 rgb[0]=red         rgb[1]=green         rgb[2]=blue                 set_es(es_handle,ES_RenderMode,kRenderNormal)         set_es(es_handle,ES_RenderFx,kRenderFxGlowShell)         set_es(es_handle,ES_RenderAmt,16)         set_es(es_handle,ES_RenderColor,rgb)     }     return FMRES_IGNORED }

You still retrieved the cvar in the AddToFullPack, but you did change it to the red, green, blue instead of the cvar's values that were parsed.

Just delete the parsing and you're good.

Code:
public addtofullpack(es_handle,e,ent,id,hostflags,player,pSet) {     if(!is_user_alive(id) || !get_pcvar_num(onoff) || !get_pcvar_num(glow) || (id==ent)) return FMRES_IGNORED         if(is_glowing[id]==ent) {         new rgb[3]                 rgb[0]=red         rgb[1]=green         rgb[2]=blue                 set_es(es_handle,ES_RenderMode,kRenderNormal)         set_es(es_handle,ES_RenderFx,kRenderFxGlowShell)         set_es(es_handle,ES_RenderAmt,16)         set_es(es_handle,ES_RenderColor,rgb)     }     return FMRES_IGNORED }
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
shine771
Senior Member
Join Date: Jun 2007
Old 12-06-2008 , 05:48   Re: Realistic Weapon Pickup 0.8
Reply With Quote #16

Oh.. omg. Forgot to remove that parsing part :O. I was in a hurry. Seems like everything is ok now.
shine771 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 12-06-2008 , 05:59   Re: Realistic Weapon Pickup 0.8
Reply With Quote #17

Quote:
EDIT: @arkshine - how often you change weapons in cs, 1 round? Less than 3.
Depending the map type, a lot of times. Even on "normal" map, some people like to change often weapons. :p

Anyway don't worry about what I say, I will do my way for my server, that's all. ^^
__________________
Arkshine is offline
rpm
Member
Join Date: Aug 2007
Location: Brazil
Old 12-07-2008 , 16:02   Re: Realistic Weapon Pickup 0.8
Reply With Quote #18

nice!
rpm is offline
shine771
Senior Member
Join Date: Jun 2007
Old 12-08-2008 , 13:02   Re: Realistic Weapon Pickup 0.8
Reply With Quote #19

Someone could test it?
shine771 is offline
crazyeffect
Veteran Member
Join Date: Jul 2008
Location: Belgium
Old 12-08-2008 , 13:10   Re: Realistic Weapon Pickup 0.8
Reply With Quote #20

This works!!
__________________

Last edited by crazyeffect; 12-08-2008 at 13:19.
crazyeffect is offline
Send a message via MSN to crazyeffect
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 13:31.


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