Raised This Month: $94 Target: $400
 23% 

Fire Mode Information


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   Event Related        Approver:   Hawk552 (427)
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 10-23-2009 , 08:39   Fire Mode Information
Reply With Quote #1

Fire Mode Information v1.2

* Description
Displays the current fire mode setting when deploying or picking up a Famas or Glock18 and also clears the message if the weapon is holsterd.

The purpose of this plugin is to inform you of your weapons's fire mode (full/semi/auto, available only for Glock18 and Famas) when you pick it up or draw it in case you forgot or didn't even knew what mode it was set on before picking it up.

Also I added a sound effect that can be heard by players near you when you switch the fire mode.

* CVars
amx_firemodeinfo_enabled 0/1 (default: 1)
Enables/disables plugin, updated every round.

amx_firemodeinfo_sound 0/1/2 (default: 2)
Enables/disables usage of sound effects when switching fire mode, when set to 1 only the player can hear it, set it to 2 and all players near that player can hear it also.

NOTE: CVar values update every round start.

* Modules Required
- hamsandwich
- fakemeta
- engine
- cstrike

* Credits
- ConnorMcLeod - optimization, new center message function and extra sound feature tips
- Arkshine, Hawk552, Alucard^ - name issue =)

* Changelog
Version 1.0
- Initial release
Version 1.1
- Optimized code & usage
- Extended sound cvar, it now sets: no sound/only player/anyone near player
- Lowered switch volume from 0.8 to 0.5
- Added an alternative center text method that does not add over original text messages.
Version 1.1b
- Minor fix: the sound triggers on spectator mode change too, because of a typo.
Version 1.1c
- Minor fix: checks so it doesn't show up when you have a shield
Version 1.2
- Fixed rare error on cs_get_user_shield() because the player doesn't exist.
- Some minor adjustments and added checking if player is connected on each function

This plugin can be compiled via Web Compiler (aka "Get Plugin")
Attached Files
File Type: sma Get Plugin or Get Source (fire_mode_info.sma - 2084 views - 5.8 KB)
__________________

Last edited by Hunter-Digital; 06-14-2010 at 04:42. Reason: new version, 1.2
Hunter-Digital is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-23-2009 , 09:18   Re: Rate of Fire Information
Reply With Quote #2

I'm not sure the plugin name is well chosen. I was thought it was the ROF of each weapons, not the information about the weapon mode.
__________________
Arkshine is offline
Jon
Veteran Member
Join Date: Dec 2007
Old 10-23-2009 , 10:27   Re: Rate of Fire Information
Reply With Quote #3

I think most people consider rate of fire as how long the delay between each shot fired is.
Jon is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-23-2009 , 10:52   Re: Rate of Fire Information
Reply With Quote #4

Wiki says :
Quote:
Rate of fire is the frequency at which a specific weapon can fire or launch its projectiles. It is usually measured in rounds per minute (RPM or round/min), or per second (RPS or round/s).
It sounds not exactly the right term to use here, though I don't have any proposition to do, my english sucks too much.
__________________

Last edited by Arkshine; 10-23-2009 at 10:55.
Arkshine is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 10-23-2009 , 11:00   Re: Rate of Fire Information
Reply With Quote #5

Maybe "Fire Mode Selection"?
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 10-23-2009 , 12:09   Re: Rate of Fire Information
Reply With Quote #6

*Fire Mode Information
*Fire Mode Selection
*Fire Mode Status
*How the f*k is the Fire Mode?
__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Trafalete
Senior Member
Join Date: Sep 2008
Location: Bucuresti ( Printre nori
Old 10-23-2009 , 14:09   Re: Rate of Fire Information
Reply With Quote #7

Quote:
Originally Posted by Alucard^ View Post
*Fire Mode Information
*Fire Mode Selection
*Fire Mode Status
*How the f*k is the Fire Mode?
love the last suggestion
__________________


Trafalete is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-23-2009 , 15:14   Re: Rate of Fire Information
Reply With Quote #8

You could use 1 handle per forward and per weapons, this way you wouldn't have to retrieve weapon type.
If you still want to retrieve weapon type, you can use cs_get_weaponid(ent) so you don't need to check classname and use get_weaponid after.

For the owner problem, try weapon offset m_pPlayer (value:41, linuxdiff:4)

For the sound feature, you could according to cvar, emit a sound or play the sound only to player.

Nice plugin idea
__________________
- tired and retired -
ConnorMcLeod is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 10-24-2009 , 09:19   Re: Rate of Fire Information
Reply With Quote #9

Whops, okay, I'll modify it to "Fire Mode Information" after I finish the things below :} ... I don't know why I knew that the fire mode was the rof... but anyway :}

Quote:
Originally Posted by ConnorMcLeod View Post
You could use 1 handle per forward and per weapons, this way you wouldn't have to retrieve weapon type.
If you still want to retrieve weapon type, you can use cs_get_weaponid(ent) so you don't need to check classname and use get_weaponid after.
Hmm, better, less function calls, thanks :}

Quote:
Originally Posted by ConnorMcLeod View Post
For the owner problem, try weapon offset m_pPlayer (value:41, linuxdiff:4)
Okay, I'll test that out... actually, I tested it already while writing this, it works, thanks again

Quote:
Originally Posted by ConnorMcLeod View Post
For the sound feature, you could according to cvar, emit a sound or play the sound only to player.
Yes that would be a good feature... but! how can I play a sound on a single player with modified pitch ?

Also, I could add a check for other centered text events, if for example, "Bomb has been planted" is displayed, if the player hides his weapon while that message is visible it should not clear the message, but I don't know if this will work or if it's that useful
__________________

Last edited by Hunter-Digital; 10-24-2009 at 09:22.
Hunter-Digital is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 10-24-2009 , 09:32   Re: Rate of Fire Information
Reply With Quote #10

spk "soundfile (p90)"
Not sure of the syntax cause long time i haven't used that.


EDIT :

spk "weapons/mac10_boltpull(p150)" works fine.


For centered text you could use :

PHP Code:
client_print_center(idmsg[], any:...)
{
    static 
szMsg[128]
    
vformat(szMsg127msg3)
    
engfunc(EngFunc_ClientPrintfid1szMsg)

It allow multilines, so just send client_print_center(id, "^nYour text") and will not print at the same place as default game msgs.
__________________
- tired and retired -

Last edited by ConnorMcLeod; 10-24-2009 at 09:39.
ConnorMcLeod is offline
Reply


Thread Tools
Display Modes

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 20:10.


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