Raised This Month: $ Target: $400
 0% 

Help Me To Fix C4 Count Down


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xvil
BANNED
Join Date: Feb 2012
Old 02-28-2012 , 06:21   Help Me To Fix C4 Count Down
Reply With Quote #1

I'd like to use the tasks for Countdown C4 but there is an error

Description: This Plugin is for Bomb(C4) when you plant a bomb a tasks was set to the cound Down With sounds and hudmessages
if you are planting or defusing bomb the plugin show a hudmessages
if the round is end or restart the tasks will remove


The error in this function:
I change Many Thinks But it dosn't work
PHP Code:
public bomb_planting(planter) { 
     
    new 
PLname[32
    new 
randim random_num(0,1
     
    if(!
get_pcvar_num(g_Cvar)) 
        return 
PLUGIN_CONTINUE 
         
    get_user_name
(planterPLname31
    
set_hudmessage(00255, -1.0, -1.002.01.0
    
show_hudmessage(0"%s is planting The bomb"PLname
     
    switch(
randim
  { 
    case 
0client_cmd(0,"spk im_gonna_go_plant_the_bomb.wav"
    case 
1client_cmd(0,"spk misc/im_gonna_go_plant.wav"
  } 
     
    return 
PLUGIN_HANDLED 
     

// called when the bomb is planted 
public bomb_planted(planter) { 
    new 
Name[32]; 
     
    if(!
get_pcvar_num(g_Cvar)) 
        return 
PLUGIN_CONTINUE 
         
    get_user_name
(planterName31
     
    
set_hudmessage(255,0,0,-1.0,-1.0,0,0.3,1.0
    
show_hudmessage(0"Bomb has been planted from %s"Name
     
    new 
bomb
    bomb 
fm_find_ent_by_model(-1"grenade""models/w_c4.mdl")
    
    new 
float:ftime cs_get_c4_explode_time(bomb)
    
    new 
float:ftm1 ftime 9.0
    
new float:ftm2 ftime 8.0
    
new float:ftm3 ftime 7.0
    
new float:ftm4 ftime 6.0
    
new float:ftm5 ftime 5.0
    
new float:ftm6 ftime 4.0
    
new float:ftm7 ftime 3.0
    
new float:ftm8 ftime 2.0
    
new float:ftm9 ftime 1.0
    
    
// task for the 10 end C4 timer 
    
set_task(ftm1"one"0
    
set_task(ftm2"two"0
    
set_task(ftm3 "three"0
    
set_task(ftm4"foor"0
    
set_task(ftm5"five"0
    
set_task(ftm6"six"0);
    
set_task(ftm7"seven"0
    
set_task(ftm8"eigth"0
    
set_task(ftm9"nine"0
    return 
PLUGIN_CONTINUE 

The Full Script:
Spoiler


The Plugin is already made but I fix many errors
http://forums.alliedmods.net/showthread.php?t=173910

Compiler Result:
Spoiler

Last edited by Xvil; 02-29-2012 at 08:26.
Xvil is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 02-28-2012 , 06:30   Re: Help Me
Reply With Quote #2

Please put a descriptive title.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
drekes
Veteran Member
Join Date: Jul 2009
Location: Vault 11
Old 02-28-2012 , 06:35   Re: Help Me
Reply With Quote #3

new Float: num
__________________

Quote:
Originally Posted by nikhilgupta345 View Post
You're retarded.
drekes is offline
Send a message via MSN to drekes
Xvil
BANNED
Join Date: Feb 2012
Old 02-28-2012 , 13:54   Re: Help Me
Reply With Quote #4

Description Added

Last edited by Xvil; 02-28-2012 at 13:59.
Xvil is offline
Xvil
BANNED
Join Date: Feb 2012
Old 02-29-2012 , 08:28   Re: Help Me To Fix C4 Count Down
Reply With Quote #5

New Changes

Spoiler
Xvil is offline
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 02-29-2012 , 09:19   Re: Help Me To Fix C4 Count Down
Reply With Quote #6

PHP Code:
new float:ftime cs_get_c4_explode_time(bomb)
    
new 
float:ftm1 ftime 9.0
new float:ftm2 ftime 8.0
new float:ftm3 ftime 7.0
new float:ftm4 ftime 6.0
new float:ftm5 ftime 5.0
new float:ftm6 ftime 4.0
new float:ftm7 ftime 3.0
new float:ftm8 ftime 2.0
new float:ftm9 ftime 1.0

// task for the 10 end C4 timer 
set_task(ftm1"one"0
set_task(ftm2"two"0
set_task(ftm3 "three"0
set_task(ftm4"foor"0
set_task(ftm5"five"0
set_task(ftm6"six"0);
set_task(ftm7"seven"0
set_task(ftm8"eigth"0
set_task(ftm9"nine"0
-->

PHP Code:
new const functions[ ] = { "one""two""three""four""five""six""seven""eight""nine" };

new 
Float:ftime cs_get_c4_explode_time(bomb)
    
for( new 
isizeof functionsi++ )
    
set_task( ( ftime - ( 1.0 ) ), functions], ); 
This won't solve your problem but it's an optimization.
P.S: Use 'Float' instead of 'float'.
__________________

Last edited by Neeeeeeeeeel.-; 02-29-2012 at 09:28.
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Lolz0r
Veteran Member
Join Date: Nov 2010
Location: Balgaria
Old 02-29-2012 , 13:41   Re: Help Me To Fix C4 Count Down
Reply With Quote #7

Nice idea, I hope someone fix it.
Lolz0r is offline
Old 02-29-2012, 14:15
Xvil
This message has been deleted by Xvil. Reason: Not Working
Neeeeeeeeeel.-
Some Guy Yellin'
Join Date: Jul 2010
Location: Argentina
Old 02-29-2012 , 14:20   Re: Help Me To Fix C4 Count Down
Reply With Quote #8

Quote:
Originally Posted by Xvil View Post
Thanks all the plugin Work


Spoiler
Check the const functions, there are some that have incorrect names.
__________________
Neeeeeeeeeel.- is offline
Send a message via Skype™ to Neeeeeeeeeel.-
Old 03-01-2012, 07:10
Xvil
This message has been deleted by Xvil. Reason: Script Not Correct
Old 03-02-2012, 10:59
Xvil
This message has been deleted by Xvil. Reason: Sorry
Xvil
BANNED
Join Date: Feb 2012
Old 03-02-2012 , 13:10   Re: Help Me To Fix C4 Count Down
Reply With Quote #9

Finally, My Plugin Work

Test Events OK
Test CountDown OK

Spoiler

Last edited by Xvil; 03-02-2012 at 14:01.
Xvil 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 21:17.


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