Raised This Month: $ Target: $400
 0% 

[solved]Hud problems.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Xum
Member
Join Date: Jun 2006
Old 07-06-2006 , 16:19   [solved]Hud problems.
Reply With Quote #1

How can i make a hudmsg to be seen every round, without disapearing from screen.
__________________
[IMG]http://img236.**************/img236/9858/xulogo2pq.gif[/IMG]Xu Share Website CjtServer
My Superhero 22/7 gameserver
ip: 64.94.171.241:27055 and the pasword is: qwerty

Last edited by Xum; 07-07-2006 at 16:04.
Xum is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-06-2006 , 17:03   Re: Hud problems.
Reply With Quote #2

Code:
/* Show HUD Message */
#include <amxmodx></p>
#include <amxmisc></p>
#define PLUGIN "Show Hud Message"</p>
#define VERSION "1.0"</p>
#define AUTHOR "Rolnaaba"</p>
 
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
}
public startround(id)
{
  set_hudmessage(0, 0, 255, -1.0, -1.0, 0, 6.0, 12.0)
  show_hudmessage(id, "YOUR TEXT HERE")
  set_task(0.2, "show_hudmsg")
}
public show_hudmsg(id)
{
 set_hudmessage(0, 0, 255, -1.0, -1.0, 0, 6.0, 12.0)
 show_hudmessage(id, "YOUR TEXT HERE")
 set_task(0.2, "show_hudmsg")
}
just change YOUR TEXT HERE to w/e you want (make sure to have both YOUR TEXT HERE messages the same
__________________
DO NOT PM me about avp mod.

Last edited by Rolnaaba; 07-06-2006 at 17:07.
Rolnaaba is offline
Xum
Member
Join Date: Jun 2006
Old 07-06-2006 , 17:33   Re: Hud problems.
Reply With Quote #3

Code:
// Credits to Gizmo #include <amxmodx> #include <amxmisc>  new argMessage[256]          public plugin_init()  {     register_plugin("HUDmsg", "1.0", "Hip_hop_x")       register_cvar("sv_hudmsg", "1", 0)       register_concmd("amx_hudcenter", "cmd_message", ADMIN_CHAT, "message in the center")         register_concmd("amx_hudmsg", "cmd_extrem", ADMIN_ALL, "<message up>")        }    public startround(id) {      if(get_cvar_num("sv_hudmsg") == 0){ return PLUGIN_HANDLED         } set_task(2, argMessage)     }        public cmd_message (id)  {         if(!access(id, ADMIN_CHAT))         {                 console_print(id, "[AMXX] You have no access to this command!");                 return PLUGIN_HANDLED         }                     read_args(argMessage, 255)         set_hudmessage(130, 90, 70, -1.0, 0.45, 0, 1.0, 999991.0, 0.1, 0.2, -1)               show_hudmessage(0, argMessage) return PLUGIN_HANDLED }  public cmd_extrem(id) {         if(!access(id, ADMIN_CHAT)) {                 console_print(id, "[AMXX] You have no access to this command!");             return PLUGIN_HANDLED           }               read_args(argMessage, 255)     set_hudmessage(150, 89, 37, -1.0, 0.10, 0, 1.0, 999991.0, 0.1, 0.2, -1)         show_hudmessage(0, argMessage)       return PLUGIN_HANDLED  }        public recl(id)     {         console_print(id, "[Xu Message] For more plugins vizit xu-share.tk")     }    public client_connect(id)  {      new name[18]     get_user_name(id, name, 17)      if(get_cvar_num("sv_hudmsg") == 1) {         set_hudmessage(190, 30, 0, -1.0, 0.15, 0, 1.0, 21.0, 0.1, 0.2, -1)         show_hudmessage(0, "%s connecting", name)     } } public     client_disconnect(id) {     new name[18]     get_user_name(id, name, 17)         if(get_cvar_num("sv_hudmsg") == 1) {         set_hudmessage(190, 30, 0, -1.0, 0.15, 0, 1.0, 21.0, 0.1, 0.2, -1)         show_hudmessage(0, "%s has disconnected", name)     } }


If i die i can't see the message.
__________________
[IMG]http://img236.**************/img236/9858/xulogo2pq.gif[/IMG]Xu Share Website CjtServer
My Superhero 22/7 gameserver
ip: 64.94.171.241:27055 and the pasword is: qwerty
Xum is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-07-2006 , 11:02   Re: Hud problems.
Reply With Quote #4

because you never defined for the message to say when ur dead:
Code:
register_event("DeathMsg", "DeathMsg", "a")   public DeathMsg { //message code here }

also add this to plugin init i forgot to type it on my post:
Code:
register_event("ResetHUD", "startround", "be")
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
Xum
Member
Join Date: Jun 2006
Old 07-07-2006 , 12:28   Re: Hud problems.
Reply With Quote #5

thx
__________________
[IMG]http://img236.**************/img236/9858/xulogo2pq.gif[/IMG]Xu Share Website CjtServer
My Superhero 22/7 gameserver
ip: 64.94.171.241:27055 and the pasword is: qwerty
Xum is offline
Zenith77
Veteran Member
Join Date: Aug 2005
Old 07-07-2006 , 12:45   Re: Hud problems.
Reply With Quote #6

The ResetHud event is called on when a person spawns, not every round. Use register_logevent(). Although, the end result will usually be the same, some other plugin may force people to spawn early or something else, causing the message to be displayed every spawn.

*edit*
Why in the world do you have a message to v3x ("v3x Check your PM's!") in your sig rolnaaba
__________________
Quote:
Originally Posted by phorelyph View Post
your retatred
Zenith77 is offline
Rolnaaba
Veteran Member
Join Date: May 2006
Old 07-07-2006 , 12:47   Re: Hud problems.
Reply With Quote #7

reset hud wwill show it when they spawn and then when they die it goes away so retype it n the deathmsg problem solved...
__________________
DO NOT PM me about avp mod.
Rolnaaba is offline
kalhimeo
AlliedModders Donor
Join Date: Dec 2005
Old 07-19-2006 , 21:32   Re: [solved]Hud problems.
Reply With Quote #8

--- EDIT --- problem solved

Hi,

i m a beginner in AMX MOD X scripting but i succeded in some commands

Basicly, i send an HUD to different players based on steamid or to evey players (@all or @ct or @t) and i would like tho make the HUD stay after "spawn" and "death".

The difference from the sample above is that the messages that i send are different depending of the target (player). Also it should not re-send the HUD when the HUD has a timer (i consider 9999 as infinite timer, other timers shouldn't re-send the HUD)

Here is my (updated) code
Code:
new msaymsg[33]

public plugin_init()
{
  register_plugin(PLUGIN, VERSION, AUTHOR)
  register_srvcmd("amx_msay","cmd_msay")
  register_event("ResetHUD", "evnt_resethud", "be")
  register_event("DeathMsg", "evnt_deathmsg", "a")
}

public cmd_msay(id, level, cid)
{
  new sw1tch[11]
  read_argv(1, sw1tch, 10)
  if (sw1tch[0] == '@')
  {
    new arg4[5]
    read_argv(2, arg4, 4)
    new arg0[300]
    read_args(arg0, 299)
    new length = strlen(sw1tch) + strlen(arg4) + 2
    remove_quotes(arg0[length])
    new players[32]
    new player,num,i
    if (equali(sw1tch[1], "CT"))
    {
      get_players(players,num,"ceh","CT")
    } else if (equali(sw1tch[1], "T")) {
      get_players(players,num,"ceh","TERRORIST")
    } else if (equali(sw1tch[1], "ALL")) {
      get_players(players,num,"ch")
    }
    new message[552]
    format(message,551,"%s",arg0[length])
    replace_all(message,551,"%n","\n")
    replace_all(message,551,"\n","^n")
    if(equali(arg4, "0"))
    {
      arg4 = "9999"
    }
    new Float:time = floatstr(arg4)
    set_hudmessage(255,255,255,0.01,0.33,0,time,time,0.01,0.01,1)
    for(i=0;i<num;i++) 
    {
      player = players[i]
      if(!is_user_connected(player)) continue
      else if(player) 
      {
        if (equali(arg4, "9999"))
        {
          msaymsg[player] = message
        } else {
          msaymsg[player] = "0"
        }
        show_hudmessage(player,message)
      }
    }
    server_print("MSAY to %s: ^"%s^"",sw1tch,message)
  } else {
    new arg1[8]
    new arg2[16]
    new arg3[16]
    read_argv(1, arg1, 7)
    read_argv(3, arg2, 15)
    read_argv(5, arg3, 15)
    new target[35]
    format(target,34,"%s:%s:%s",arg1,arg2,arg3)
    new arg4[5]
    read_argv(6, arg4, 4)
    new arg0[300]
    read_args(arg0, 299)
    new length = strlen(target) + strlen(arg4) + 2
    remove_quotes(arg0[length])
    new targetuser = find_player("chj",target)
    if(!is_user_connected(targetuser)) 
    {
      return PLUGIN_HANDLED
    }
    new message[552]
    format(message,551,"%s",arg0[length])
    replace_all(message,551,"%n","\n")
    replace_all(message,551,"\n","^n")
    if(equali(arg4, "0"))
    {
      arg4 = "9999"  
      msaymsg[targetuser] = message
    } else {
      msaymsg[targetuser] = "0"
    }
    new Float:time = floatstr(arg4)
    set_hudmessage(255,255,255,0.01,0.33,0,time,time,0.01,0.01,1)
    show_hudmessage(targetuser,message)
    server_print("MSAY to %s: ^"%s^"",target,message)    
  }
  return PLUGIN_HANDLED
}

public evnt_resethud(id)
{
  set_hudmessage(255,255,255,0.01,0.33,0,9999.0,9999.0,0.01,0.01,1)
  if(!equali(msaymsg[id], "0"))
  {
    show_hudmessage(id,msaymsg[id])
  }
}


public evnt_deathmsg()
{
  new id = read_data(2)
  set_hudmessage(255,255,255,0.01,0.33,0,9999.0,9999.0,0.01,0.01,1)
  if(!equali(msaymsg[id], "0"))
  {
    show_hudmessage(id,msaymsg[id])
  }
}


public client_connect(id)
{
   msaymsg[id] = "0"
}

public client_disconnect(id)
{
   msaymsg[id] = "0"
}

Last edited by kalhimeo; 07-20-2006 at 05:38.
kalhimeo 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 08:05.


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