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

Bomb Timer Line 1.1 [UPDATED]


Post New Thread Reply   
 
Thread Tools Display Modes
Plugin Info:     Modification:   Counter-Strike        Category:   General Purpose        Approver:   Emp` (115)
shine771
Senior Member
Join Date: Jun 2007
Old 06-24-2008 , 15:55   Bomb Timer Line 1.1 [UPDATED]
Reply With Quote #1

Bomb Timer Line
1.1

Description: When you plant c4. It shows a line(>|) thats moving towards another Line(|<<< C4). The distance between those 2 lines depends on a cvar - mp_c4timer. When both lines collide. C4 Explodes.

Cvars:
btl_only_for_ts (1/0) (1 - Only Terrorists will see the Timer Line, 0 - everyone including CT's will see the Timer Line)

I recommend: Do not set mp_c4timer below 0 and above 50. Just an recommendation.

Changes:
v0.7
*Initial Release
v0.8
*Optimized Code(Use switch instead of if/else,shortened the code a little bit, using cvar pointer instead of get_cvar_num)
v0.9
*Optimized Code a little
*Fixed the glitch when someone joins a server he can't see the moving line.
v1.0
*Recoded the plugin. Fixed Many glitches..
*Now when the bomb explodes, it changes the C4 text to [DEFUSED]/[BOMB] depending which team won.
v1.1
*Fixed the glitch > if bomb doesn't explode but the round ends.. and server has freeze time it still shows the line until freezetime ends.


Screenshots:
[IMG]http://img137.**************/img137/9472/screenshotbtlmw7.th.jpg[/IMG]



Attached Files
File Type: sma Get Plugin or Get Source (bomb_timer_line.sma - 10123 views - 3.3 KB)

Last edited by shine771; 07-22-2008 at 13:41.
shine771 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-24-2008 , 16:39   Re: Bomb Timer Line 0.7
Reply With Quote #2

equali(data[11],"P")

Why don't just use : data[11] == 'P' ?


get_cvar_num("mp_c4timer")

I would use a pointer for that. ( get_cvar_pointer )


new Float:addtime = temp / 90
linestart = (0.50 - temp) + addtime


To avoit to use an extra-var, I would do directly : linestart = (0.50 - temp) + ( temp / 90 )
Even id it's not really necessary.
__________________

Last edited by Arkshine; 06-24-2008 at 16:44.
Arkshine is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 06-24-2008 , 16:43   Re: Bomb Timer Line 0.7
Reply With Quote #3

Also, use pcvars for all cvars.

Use get_cvar_pointer if the cvar is already registered. Then use the get_pcvar_num like normal once you have saved the pointer
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-24-2008 , 16:47   Re: Bomb Timer Line 0.7
Reply With Quote #4

Forget that :

if(equali(data[11],"P")) show_hud()
else if(equali(data[11],"D")) remove_hud()


Would be better to do :

Code:
switch ( data[11] ) {     case 'P' : show_hud()     case 'D' : remove_hud() }
__________________
Arkshine is offline
shine771
Senior Member
Join Date: Jun 2007
Old 06-24-2008 , 17:00   Re: Bomb Timer Line 0.8
Reply With Quote #5

Ok optimized the code. Maybe say what you think about the plugin.. any suggestions?
shine771 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 06-24-2008 , 17:06   Re: Bomb Timer Line 0.8
Reply With Quote #6

Absolutely not tested. Will see later.

Also, you can do the same thing here :

new e_time2 = get_pcvar_num(e_time)
new Float:temp = e_time2 * 0.01


->

new Float:temp = get_pcvar_num(e_time) * 0.01
__________________
Arkshine is offline
shine771
Senior Member
Join Date: Jun 2007
Old 06-24-2008 , 17:11   Re: Bomb Timer Line 0.8
Reply With Quote #7

Damn.. i'll optimize that in next version.
shine771 is offline
AntiBots
Veteran Member
Join Date: May 2008
Location: Brazil
Old 06-24-2008 , 21:30   Re: Bomb Timer Line 0.8
Reply With Quote #8

good idea
AntiBots is offline
Send a message via ICQ to AntiBots Send a message via MSN to AntiBots Send a message via Skype™ to AntiBots
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 06-29-2008 , 22:52   Re: Bomb Timer Line 0.8
Reply With Quote #9

wow i love the idea, testing...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 07-03-2008 , 02:22   Re: Bomb Timer Line 0.8
Reply With Quote #10

sry for bump but.. emm it doesnt work for me... the plugin is runing but i dont see the hud line
Alucard^ is offline
Send a message via Skype™ to Alucard^
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 09:23.


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