Raised This Month: $ Target: $400
 0% 

ShowHud not showing in game


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 05-21-2006 , 23:40   ShowHud not showing in game
Reply With Quote #1

i have been working on a halo mod for a week and instead of having levels, i have ranks and xp only but still working on how to get rid of the levels part... (i'll get there i hope...)
I'm stuck with the hud showing up in game with the class/xp/level/item (wc3) but mine is actually rank/xp
i just can't get the hud on the lower left hand courner to show in game...

here is my script...
Code:
#include <amxmodx> #include <amxmisc> #include <cstrike> #include <fun> #include <vault> #define RANK_PRIVATE 1 #define RANK_CORPORAL 2 #define RANK_SERGEANT 3 #define RANK_2nd LIEUTENANT 4 #define RANK_LIEUTENANT 5 #define RANK_CAPTAIN 6 #define RANK_COMMANDER 7 #define RANK_MAJOR 8 #define RANK_COLONEL 9 #define RANK_GENERAL 10 #define MAXRANKS 10 new PlayerRank[33] new PlayerXP[33] new PlayerLevel[33] new const RANKS[MAXRANKS][] = {     "Private",     "Corporal",     "Sergeant",     "2nd Lieutenant",     "Lieutenant",     "Captain",     "Commander",     "Major",     "Colonel",     "General" } new msgtext new const LEVELS[10] = {     100,     200,     400,     800,     1200,     1700,     2400,     3200,     4000,     5000 } public plugin_init()     {     register_plugin("Halo Mod", "1.0", "Mini_Midget")     register_cvar("halo_mod", "1")     register_event("DeathMsg", "DeathMsg", "a")     register_cvar("halo_mod_xp", "20")     register_event("ResetHUD", "ResetHud", "b")     msgtext = get_user_msgid("StatusText") } public SaveXP(id)     {     new authid[32];     get_user_authid(id,authid,31);         new vaultkey[64], vaultdata[64];         format(vaultkey,63,"RANK-%s-class",authid);     format(vaultdata,63,"%d",PlayerRank[id]);     set_vaultdata(vaultkey,vaultdata);         format(vaultkey,63,"RANK-%s-xp",authid);     format(vaultdata,63,"%d",PlayerXP[id]);     set_vaultdata(vaultkey,vaultdata);     } public LoadXP(id)     {     new authid[32];     get_user_authid(id,authid,31);         new vaultkey[64], vaultdata[64];         format(vaultkey,63,"RANK-%s-class",authid);     get_vaultdata(vaultkey,vaultdata,63);     PlayerRank[id] = str_to_num(vaultdata);         format(vaultkey,63,"RANK-%s-xp",authid);     get_vaultdata(vaultkey,vaultdata,63);     PlayerXP[id] = str_to_num(vaultdata);     } public client_connect(id)     {     if(get_cvar_num("SaveXP") == 1) {                 LoadXP(id)                 client_print(id, print_chat, "[Halo Mod] XP Loaded!")         client_print(id, print_chat, "[Halo Mod] You are a %s with level %s and %s XP", PlayerRank[id], PlayerLevel[id], PlayerXP[id])     } } public client_disconnect(id)     {     if(get_cvar_num("SaveXP") == 1) {                 SaveXP(id)     } } public ResetHUD(id)     {     if(PlayerRank[id] == RANK_GENERAL) {         return PLUGIN_HANDLED     }         return PLUGIN_HANDLED } public DeathMsg()     {     if(get_cvar_num("halo_mod") == 0) {         return PLUGIN_HANDLED     }         new attacker = read_data(1)         if(PlayerRank[attacker] == RANK_GENERAL) {         return PLUGIN_HANDLED     }         if(PlayerLevel[attacker] == 10) {         return PLUGIN_HANDLED     }         PlayerXP[attacker] += get_cvar_num("halo_mod_xp")         if(PlayerXP[attacker] >= LEVELS[PlayerRank[attacker]]) {                 PlayerRank[attacker] += 1                 client_print(attacker, print_chat, "[Halo Mod Congratulations! You are now promoted!", PlayerRank[attacker])                 if(get_cvar_num("SaveXP") == 1) {                         SaveXP(attacker)         }                 ShowHUD(attacker)     }           ShowHUD(attacker)         return PLUGIN_CONTINUE } public ShowHUD(id)     {                       new HUD[51]         {         format(HUD,50,"[Rank: %s Xp: %i", PlayerRank[id], PlayerXP[id])     }     message_begin(MSG_ONE,msgtext,{0,0,0}, id)     write_byte(0)     write_string(HUD)     message_end() }
__________________
It's a mystery.
Mini_Midget is offline
Hawk552
AMX Mod X Moderator
Join Date: Aug 2005
Old 05-22-2006 , 08:39  
Reply With Quote #2

You basically copied the XP mod tutorial, so it should work.

But if you want a HUD message, from what I'm guessing, then you need set_hudmessage and show_hudmessage. Both are pretty self explanatory in terms of the description in the funcwiki.
__________________
Hawk552 is offline
Send a message via AIM to Hawk552
Geesu
Veteran Member
Join Date: Mar 2004
Location: Cincinnati, OH
Old 05-22-2006 , 08:59  
Reply With Quote #3

Quote:
Code:
client_print(attacker, print_chat, "[Halo Mod Congratulations! You are now promoted!", PlayerRank[attacker])
What is PlayerRank for? I don't see a %d in that string...
__________________
Need war3ft help? DO NOT PM ME... Check the forums
Geesu is offline
Send a message via AIM to Geesu Send a message via MSN to Geesu
Mini_Midget
Veteran Member
Join Date: Jan 2006
Location: It's a mystery.
Old 05-23-2006 , 01:38  
Reply With Quote #4

EDIT:
Nvm...
i think i'll start small with my plugins...
__________________
It's a mystery.
Mini_Midget 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 16:25.


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