Raised This Month: $ Target: $400
 0% 

Hud Messages...


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
BioHazardousWaste
Senior Member
Join Date: Apr 2005
Location: Ontario, Canada =)
Old 04-23-2005 , 22:19  
Reply With Quote #6

Ok.. wtf? I was just playing a lone and it worked fine, some random asshole (not really i'm just upset) joined then it doesn't work... Relevant code follows:

Code:
public DoNewRound() {         for(new i=1;i<=32;i++)         {       if(is_user_alive(i))             //debug             client_print(0, print_console, "Testing player #%i", i)                     RefreshExperience(i)             CheckLevel(i)             UpdateFocus(i)         } } public RefreshExperience(id) {     //kaput (gebroken) lol     new ExpMessage[128]     format(ExpMessage, 127, "Exp: %i / %i", PlayerExp[id], ExperienceForLevel[PlayerLevel[id] + 1])         message_begin(MSG_ONE, get_user_msgid("StatusText"), {0, 0, 0}, id);     write_byte(0);     write_string(ExpMessage);     message_end(); }//works fine public CheckLevel(id) {     //debug     client_print(0, print_console, "Checking player %i's level (%i) exp", id, PlayerExp[id])     if (PlayerLevel[id]<100)     {           if (PlayerExp[id] >= ExperienceForLevel[PlayerLevel[id]+1])         {             PlayerLevel[id] += 1                         set_hudmessage(255, 255, 255, 2.0, 1.0, 1, 6.0, 15.0, 0.1, 0.2, 4)             show_hudmessage(id, "Congratulations on achieving level #%i", PlayerLevel[id])//broken             PlayerMaxFocus[id] = PlayerLevel[id] +10             PlayerFocus[id] = PlayerMaxFocus[id]             //debug             client_print(id, print_console, "Player #%i reached level #%i", id, PlayerLevel[id])//works             CheckLevel(id)         }     }         if (PlayerLevel[id]>0)     {         if (PlayerExp[id] < ExperienceForLevel[PlayerLevel[id]])         {             PlayerLevel[id] -= 1                     set_hudmessage(255, 255, 255, 2.0, 1.0, 1, 6.0, 15.0, 0.1, 0.2, 4)             show_hudmessage(id, "You've lost a level! You are now level #%i", PlayerLevel[id])//broken             //debug             client_print(id, print_console, "Player #%i lost a level. They are now level #%i", id, PlayerLevel[id])//works             PlayerMaxFocus[id] = PlayerLevel[id] +10             PlayerFocus[id] = PlayerMaxFocus[id]             CheckLevel(id)         }     }     } public UpdateFocus(id) {     if(is_user_alive(id))     {         PlayerMaxFocus[id] = PlayerLevel[id] + 10//check required for admin set exp command         PlayerFocus[id] = PlayerFocus[id] + 2         //debug         client_print(id, print_console, "Setting maxfocus to Level(%i) + 10 (=%i)", PlayerLevel[id], PlayerMaxFocus[id])         if (PlayerFocus[id] > PlayerMaxFocus[id])         {             PlayerFocus[id] = PlayerMaxFocus[id]         }                 //debug         //client_print(i, print_chat, "set focus to: %i", PlayerFocus[id])             new Message[128] = ""         format(Message, 127, "FOCUS: %i/%i", PlayerFocus[id], PlayerMaxFocus[id])             set_hudmessage(255, 255, 255, 0.05, 0.75, 2, 0.02, 3.0, 0.01, 0.1, 2)         show_hudmessage(id, Message)     }     new ident[1]     ident[0] = id     set_task(1.0, "RefreshFocus", 451+id, ident, 1) } //for timed function only public RefreshFocus(ident[],TaskID) {     new id = ident[0]     UpdateFocus(id) } There we go, that's done at the begining of every round, now please tell me why the messages only work when there is only 1 person in the server (game is not officialy started).  And why in God's name does the focus update for only me, and never anyone else?
__________________
"What then is truth? Truths are illusions which we have forgotten are illusions - they are metaphors that have become worn out... this (truth) is the duty to lie according to a fixed convention.

-Friedrich Nietzsche
BioHazardousWaste is offline
Send a message via MSN to BioHazardousWaste
 



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 09:51.


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