Raised This Month: $ Target: $400
 0% 

No showhudmessage


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 09-07-2005 , 00:21   No showhudmessage
Reply With Quote #1

This doesn't want to show the hudmessage in the showmsg function.

Code:
#include <amxmodx> #include <amxmisc> #include <engine> #include <fakemeta> #include <fun> /* Defines and news!*/ new rpgtrail new damage[33]=0 new bool:showmessage[33] /* Defines and news!*/ public plugin_init() {     register_plugin("AGMod","0.13","DahVid")     register_forward(FM_SetModel,"ChangeAmmo",0)         register_cvar("ag_speed","1")         register_clcmd("say /nostats","nostats")         register_event("CurWeapon","speed","b")     register_event("ResetHUD","speed","b")     register_event("Damage","damage_event","b","2!0","3=0","4!0")         set_task(0.3,"showmsg",2938,_,_,"b"); } public client_putinserver(id) {     damage[id]=0 } public client_connect(id) {     showmessage[id]=true } public client_disconnect(id) {     damage[id]=0 } public damage_event(id) {     new attacker=get_user_attacker(id)     new dmg=read_data(2)         damage[attacker]+=dmg } public nostats(id) {     showmessage[id]=false } public showmsg(id) {     new players[32],num,i     new message[200]     get_players(players,num)     for(i=0;i<=num;i++) {         if(!is_user_connected(id)) continue;         if(showmessage[id]==false) continue;         new id=players[i]         new ping,loss         new frags=get_user_frags(id)         new deaths=get_user_deaths(id)         get_user_ping(id,ping,loss)                 set_hudmessage(0,0,255, 0.01, 0.29, 0, 6.0, 2.0, 0.1, 0.2, 4)         format(message,199,"AGMod 0.1 Alpha ^nFrags: %i ^nDeaths: %i ^nTotal Damage: %i ^nPing: %i",frags,deaths,damage[id],ping)         show_hudmessage(id,message)     }     return PLUGIN_CONTINUE } public plugin_precache() {     precache_model("models/zombie.mdl")     rpgtrail=precache_model("sprites/laserbeam.spr") } public speed(id) {     if(!get_cvar_num("ag_speed")) {         return PLUGIN_HANDLED     }     set_user_maxspeed(id,get_user_maxspeed(id)*2.0)     return PLUGIN_HANDLED } /*Changing model for rpg_rocket.*/ public ChangeAmmo(entity,model[]) {     if(equali(model,"models/rpgrocket.mdl")==1) {         entity_set_model(entity,"models/zombie.mdl")         set_trail(entity)         return FMRES_SUPERCEDE     }     return FMRES_IGNORED } public set_trail(ent) {     if(!is_valid_ent(ent)) { return; }         message_begin(MSG_ALL,SVC_TEMPENTITY);     write_byte(22)     write_short(ent)     write_short(rpgtrail)     write_byte(50)     write_byte(20)     write_byte(0)     write_byte(0)     write_byte(255)     write_byte(255)     message_end()         return } /*Changing model for rpg_rocket.*/
pdoubleopdawg is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 09-07-2005 , 01:38  
Reply With Quote #2

Don't know if this will necessarily fix it, but your code looked a little bit strange.

Code:
public showmsg() {     new players[32],num,i     new message[200]     get_players(players,num)     for(i=0;i<num;i++) {         new player=players[i]         if(showmessage[id]==false) continue;         new ping,loss         new frags=get_user_frags(player)         new deaths=get_user_deaths(player)         get_user_ping(player,ping,loss)                 set_hudmessage(0,0,255, 0.01, 0.29, 0, 6.0, 2.0, 0.1, 0.2, 4)         format(message,199,"AGMod 0.1 Alpha ^nFrags: %i ^nDeaths: %i ^nTotal Damage: %i ^nPing: %i",frags,deaths,damage[player],ping)         show_hudmessage(player,message)     }     return PLUGIN_CONTINUE }
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
pdoubleopdawg
Senior Member
Join Date: Aug 2005
Old 09-07-2005 , 06:37  
Reply With Quote #3

Nice, it works. Although every second or so it flashes. Anyway to kill that? (It's like a fading flash, so it's quite annoying!)
pdoubleopdawg is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 09-07-2005 , 15:10  
Reply With Quote #4

Try setting the holdtime to longer?
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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 14:17.


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