Raised This Month: $51 Target: $400
 12% 

#*Bomb(c4) Plugin*#


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   ALL        Category:   Technical/Development       
echo_cs
Senior Member
Join Date: Dec 2011
Old 12-12-2011 , 11:42   #*Bomb(c4) Plugin*#
Reply With Quote #1



Quote:
********************************************* ******
* C4 Plugin - V1.0
*
* AUTHOR: echo_cs
*
* Description:
* + Call when the C4 is Planted, defused, defusing, explode
* + Count for 10 end c4 timer with sound and hudmessage
* + In the hudmessage the name of planter or defuser will viwed
* + random choose sound
*
* Cvar(s):
* bm_enabled 1 ==> PLUGIN ON
* bm_enabled 0 ==> PLUGIN OFF
********************************************* ******
Includes:
PHP Code:
// includes
#include <amxmodx>
#include <amxmisc>
#include <csx> 
Defines:
PHP Code:
// register plugin defines
#define PLUGIN "Bomb Plugin"
#define VERSION "1.0"
#define AUTHOR "echo_cs"

// sound Defines
#define NINE    "misc/nine.wav"
#define EIGTH   "misc/eight.wav"
#define SEVEN   "misc/seven.wav"
#define SIX     "misc/six.wav"
#define FIVE    "misc/five.wav"
#define FOOR    "misc/foor.wav"
#define THREE   "misc/three.wav"
#define TWO     "misc/two.wav"
#define ONE     "misc/one.wav" 
Plugin Main:
PHP Code:
// register the cvar and the plugin
public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_cvar("bm_enabled""1"// amx_cvar bm_enabled 1 = ON || amx_cvar bm_enabled 0 = OFF

Plugin precache:
PHP Code:
// plugin precache
public plugin_precache() {
    
precache_sound(NINE)
    
precache_sound(EIGTH)
    
precache_sound(SEVEN)
    
precache_sound(SIX)
    
precache_sound(FIVE)
    
precache_sound(FOOR)
    
precache_sound(THREE)
    
precache_sound(TWO)
    
precache_sound(ONE)
    
precache_sound("misc/good_job_team.wav")
    
precache_sound("misc/defusing_bomb.wav")
    
precache_sound("misc/im_gonna_go_plant.wav")
    
precache_sound("im_gonna_go_plant_the_bomb.wav")
    
precache_sound("misc/defusing.wav")
    
precache_sound("defusing_bomb_now.wav")
    
precache_sound("misc/good_one_sir.wav")
    
precache_sound("misc/good_one_sir2.wav")
    return 
PLUGIN_HANDLED 

Test it It's nice
Attached Files
File Type: zip sound.zip (179.4 KB, 365 views)
File Type: sma Get Plugin or Get Source (c4.sma - 965 views - 6.0 KB)
__________________
Pawn (5%)

C (80%)

C++ (20%)

SQL (5%)

Last edited by echo_cs; 12-12-2011 at 14:32.
echo_cs is offline
Xpawn
Junior Member
Join Date: Dec 2011
Old 12-12-2011 , 12:13   Re: C4 Plugin V1.0
Reply With Quote #2

It look nice Good job
your plugin is better than showinfo plugin
__________________
New Member
Xpawn is offline
Send a message via MSN to Xpawn
Korxu
Senior Member
Join Date: Sep 2010
Old 12-12-2011 , 12:29   Re: #*Bomb(c4) Plugin*#
Reply With Quote #3

- Use cvar pointers ( pCvars ), it is required.
- Instead of create macros ( #define ), do a simple array of all the sound and precache it with a for-loop.
- In some functions, you create a variable after check if the plugin is enabled. Do the check before create variables.
- Don't set a lot of task, use only one and decrease a variable to play the next sound.
- Use 'charsmax ( )' instead of 'size of the variable less one'.
Korxu is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 12-12-2011 , 12:53   Re: #*Bomb(c4) Plugin*#
Reply With Quote #4

- Don't use Paint.
- Don't use Comic Sans
__________________
xPaw is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 12-12-2011 , 13:10   Re: #*Bomb(c4) Plugin*#
Reply With Quote #5

Quote:
Originally Posted by Korxu View Post
- Use 'charsmax ( )' instead of 'size of the variable less one'.
Code:
#define charsmax(%0)  sizeof(%0)-1
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Korxu
Senior Member
Join Date: Sep 2010
Old 12-12-2011 , 13:18   Re: #*Bomb(c4) Plugin*#
Reply With Quote #6

Quote:
Originally Posted by Devil259 View Post
Code:
#define charsmax(%0)  sizeof(%0)-1
Yes, it is the same, I know it, but he must to use it instead of the hard-coding that he is doing.
Korxu is offline
echo_cs
Senior Member
Join Date: Dec 2011
Old 12-12-2011 , 13:59   Re: #*Bomb(c4) Plugin*#
Reply With Quote #7

What I do For

Quote:
- Use cvar pointers ( pCvars ), it is required.
- Instead of create macros ( #define ), do a simple array of all the sound and precache it with a for-loop.
- In some functions, you create a variable after check if the plugin is enabled. Do the check before create variables.
- Don't set a lot of task, use only one and decrease a variable to play the next sound.
- Use 'charsmax ( )' instead of 'size of the variable less one'.
Help me Please
__________________
Pawn (5%)

C (80%)

C++ (20%)

SQL (5%)
echo_cs is offline
echo_cs
Senior Member
Join Date: Dec 2011
Old 12-12-2011 , 14:02   Re: #*Bomb(c4) Plugin*#
Reply With Quote #8

Update:
[||||||||||]

Thanks all
__________________
Pawn (5%)

C (80%)

C++ (20%)

SQL (5%)

Last edited by echo_cs; 12-12-2011 at 14:12.
echo_cs is offline
JoKeR LauGh
Veteran Member
Join Date: May 2011
Location: Malaysia
Old 12-12-2011 , 14:10   Re: #*Bomb(c4) Plugin*#
Reply With Quote #9

use "edit" button instead of making a lot of post .
__________________
Quote:
Originally Posted by addons_zz View Post
Also, just to not read `the article`, read all you find. Read and read, for ever and ever. Never stop reading.
Why? Because there is not one single universal truth which holds the meaning for everything.
JoKeR LauGh is offline
echo_cs
Senior Member
Join Date: Dec 2011
Old 12-12-2011 , 14:13   Re: #*Bomb(c4) Plugin*#
Reply With Quote #10

Quote:
Originally Posted by JoKeR LauGh View Post
use "edit" button instead of making a lot of post .
Plugin Updeted
thanks JoKeR LauGh
__________________
Pawn (5%)

C (80%)

C++ (20%)

SQL (5%)
echo_cs is offline
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 12:31.


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