AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hud Not Updating Properly? o.0 (https://forums.alliedmods.net/showthread.php?t=188151)

Bombe_ 06-23-2012 00:26

Hud Not Updating Properly? o.0
 
hi. ok so my ShowHud function is not updating properly. it says Level: 0 XP: 0 SkillPoints: 0
but when i type /xp which runs the showhud function it goes to Level : 0 XP: 40 SkillPoints: 0
really fast. then goes back to 0 for all.

Code:

set_task(0.1,"ShowHud",0,"",0,"b")
and

Code:

public ShowHud(id) {
    set_hudmessage(255, 0, 0, 0.75, 0.01, 0, 6.0, 15.0);
    show_hudmessage(id, "Level: %i^nXP: %i^nSkill Points: %i", PlayerLevel[id], PlayerXP[id], PlayerSkills[id]);
}

any help would be apreciated. :) I'm new to this so yea. ^-^

YamiKaitou 06-23-2012 00:37

Re: Hud Not Updating Properly? o.0
 
id is 0 in ShowHud, pass the correct id in set_task.

Moved to Scripting Help

Bombe_ 06-23-2012 00:46

Re: Hud Not Updating Properly? o.0
 
thanks for moving, i didn't realize I posted it here. Anyway, i'm not sure what you mean by the correct id in set task. how would i know? :o

Also anther question:
when my xp goes over the required to level: ex. you need 100 xp and its at 105. it wont level up. from 0 to lvl 1? o.o so frustrating.

Spoiler

YamiKaitou 06-23-2012 01:18

Re: Hud Not Updating Properly? o.0
 
Are you wanting to show the hud message to every user?

Also, in client_connect, the user does not have an authid yet.

Bombe_ 06-23-2012 10:04

Re: Hud Not Updating Properly? o.0
 
Well, every user has its own hud. so yeah.
+
edit;
ok so I added
Code:

new authID[32];

get_user_authid(id,authID,32);

in client_connect to get their id.

edit;
Also I believe I fixed the

Quote:

Originally Posted by Bombe_ (Post 1734277)
Also anther question:
when my xp goes over the required to level: ex. you need 100 xp and its at 105. it wont level up. from 0 to lvl 1? o.o so frustrating.

thing.

now I just need the hud message to update properly. cause when I type /xp it shows the actual level and xp. but when it sets task it just shows 0 for all.

ConnorMcLeod 06-23-2012 11:21

Re: Hud Not Updating Properly? o.0
 
This is not your personal forum, don't delete your posts once you got your answer.
Next time you do this i request a ban, i hope you understand.


All times are GMT -4. The time now is 06:14.

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