AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Native error in show_hudmessage (https://forums.alliedmods.net/showthread.php?t=11692)

.Prometheus. 03-26-2005 12:30

Native error in show_hudmessage
 
I'm not sure when this started, might have been when I upgraded to AMXX 1.01

Anyways, there seems to be nothing wrong in the code, no compile errors.

Code:
    format(hud_message,127,"Wallet: $%s^nBank balance: $%s^nJob: %s^nPay: $%s",wallet_res,bank_res,job_name_res,job_pay_res) } else {     format(hud_message,127,"Please register using amx_register in the console.") } set_hudmessage(5,175,5,-1.2,-0.7,0,0.0,99.0,0.0,0.0,4); show_hudmessage(b,hud_message);

Now before I had a set_hudmessage and show_hudmessage in place of both formats, and found it easier to do it the way shown above.

Back when I had it with two, it was only the "Please register" one that showed any signs of problems.

I'd comment it out due to bordem of the endless messages in the console, each being 2.5 seconds apart xD

So I changed it to how it is now, and I still get the error for show_hudmessage

As you may have guessed, it is inside a while() loop where b is the player id and goes from 1-32

I'd be grateful if someone could help :/

twistedeuphoria 03-26-2005 12:57

Put
Code:
if(!is_user_connected(b)) continue
to check if the player is actually there and skip their number in the loop if they aren't.

Edit: Forgot to say, add it at the beginning of the loop.

.Prometheus. 03-26-2005 13:14

Yay thanks

I actualy thought "hmm maybe it's giving an error because there is no user...". Then I thought that was dumb.....I guess I must be dumb then :/

twistedeuphoria 03-26-2005 13:15

Naw, that just means you should go with your first instinct :wink:


All times are GMT -4. The time now is 09:52.

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