Raised This Month: $ Target: $400
 0% 

Removing Things


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 07-04-2007 , 19:05   Removing Things
Reply With Quote #1

how do i remove a hudmessage that never disapears.
i've tried this but it wont work,
PHP Code:
#include <amxmodx>
#include <amxmisc>
 
#define TASKID_JUGGHUD 1023
 
public repeated_task()
{
       if(
get_pcvar_num(juggernautmodecvar) && is_user_alive(juggernaut))
       {
            
set_cvar_num("sv_autoteambalance",0)
            
set_cvar_num("mp_limitteams",0)
            
set_cvar_num("mp_freezetime",0)
            new 
players[32], num
            get_players
(players,num)
 
            for(new 
i=0;i<num;i++)
            {
             
set_player_model(players[i])
                  if(
cs_get_user_team(players[i])==CS_TEAM_T)
                  {
                        if(
players[i]!=juggernaut
                         
cs_set_user_team(players[i],CS_TEAM_CT)
                        else
                        {
                         if(
health3)
                         {
                          
set_user_health(juggernaut,health3)
                          
health3 0
                         
}
                         else
                         {
                          new 
health2 get_user_health(juggernaut)
                          if(
health2==100set_user_health(juggernaut,health)
                          else if(
health2health health2
                     
}
              }
        }
  }
  
cs_set_user_team(juggernaut,CS_TEAM_T)
  
cs_set_user_plant(juggernaut,0,0)
  
set_task(0.1,"jugghud",TASKID_JUGGHUD)
 }
}
public 
jugghud()
{
      new 
name[32]
      
get_user_name(juggernautname31)
      
set_hudmessage(02550, -1.00.0306.00.1)
      
show_hudmessage(0"Current Juggernaut: %s^nJuggernaut Health: %d",name,health)
}
 
public 
after_win()
{
      if(
get_pcvar_num(hm_showscores))
       
//show the score board
           
client_cmd(0,"+showscores")
      if(
task_exists(TASKID_JUGGHUD))
            
remove_task(TASKID_JUGGHUD)
      
client_cmd(0,"mp3 play %s",WINSOUND)
      new 
playercountPlayers[32]
      
get_players(Playersplayercount,"a")
 
      for (new 
i=0playercount; ++i)
      {
            
//stop the player from moving, godmode and strip weapons
            
set_user_maxspeed(Players[i],0.1)
            
set_user_godmode(Players[i],1);
            
strip_user_weapons(Players[i]);
            
kills[i] = 0
            deaths
[i] = 0
       
}

__________________


Last edited by flyeni6; 07-04-2007 at 19:08.
flyeni6 is offline
Send a message via AIM to flyeni6
stupok
Veteran Member
Join Date: Feb 2006
Old 07-04-2007 , 20:43   Re: Removing Things
Reply With Quote #2

I don't know what to tell you, exactly.

Generally, you can use a set_task() to display a hudmessage and then whenever you want you can remove_task() to stop displaying the hudmessage.
stupok is offline
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 07-04-2007 , 21:33   Re: Removing Things
Reply With Quote #3

yea i tried that. it didn't work. i don't know why though
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
_Master_
Senior Member
Join Date: Dec 2006
Old 07-05-2007 , 04:32   Re: Removing Things
Reply With Quote #4

Your "jugghud()" task is set inside "repeated_task()" which I guess is a... repeated task.
_Master_ is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-05-2007 , 14:46   Re: Removing Things
Reply With Quote #5

eactly what master said, you removed the jughud task, but if yourt repeated_task() function is a reapeated task, then as soon as you stop it, the task starts a new one. You will have to remove the repeated task. Or have a global var and set it to false. and everythime you are about to make a hud check that var and only start the hud task if it is true. that way you can control the flow of the hudmessage via varriable.

i mean:
Code:
new bool:var = true; //... if(var) {      set_task(0.1,"jugghud",TASKID_JUGGHUD); } //... if(task_exists(TASKID_JUGGHUD))             remove_task(TASKID_JUGGHUD) var = false;
see what I mean, that kinda deal-eo.
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
flyeni6
Senior Member
Join Date: Jun 2006
Location: CAli
Old 07-05-2007 , 16:56   Re: Removing Things
Reply With Quote #6

thank u it worked
__________________

flyeni6 is offline
Send a message via AIM to flyeni6
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-05-2007 , 17:17   Re: Removing Things
Reply With Quote #7

np
__________________
DO NOT PM me about avp mod.
Rolnaaba 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 20:45.


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