Raised This Month: $ Target: $400
 0% 

Help Me With Hud For Spectator


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Arje
Senior Member
Join Date: Apr 2020
Location: Córdoba, Argentina
Old 05-20-2020 , 12:45   Re: Help Me With Hud For Spectator
Reply With Quote #1

Quote:
Originally Posted by Gabe Iggy View Post
If the first parameter of ShowSyncHudMsg is 0 it will show to all players.

Loop through all players and check if they're spectator with cs_get_user_team()

Code:
public show() {     if(!c4pl)     {         remove_task(652450)         return     }     if(c4cd>=0.0)     {         temp=c4cd/c4max         if(temp>=0.5)         {             r=510*(1.0-temp)             g=255.0         }         if(temp<0.5)         {             r=255.0             g=510*temp         }             for(new i = 1; i <= get_maxplayers();i++)     {         if(is_user_connected(i) && cs_get_user_team(i) == CS_TEAM_SPECTATOR)         {             set_hudmessage(floatround(r),floatround(g),0,-1.0,0.80,0,_,1.0,_,_,4)             ShowSyncHudMsg(i,msg,"Anda a Defusear la bomba!!! Faltan %d segundos antes de que explote.",floatround(c4cd))         }     }     c4cd-=1.0 }

Untested
Thank you! works correctly;
I had corrected it before, I had a small typing error, but you corrected the code so I don't have to upload mine, thanks again!
Arje 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 17:03.


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