Raised This Month: $51 Target: $400
 12% 

[CSGO] SetHudTextParamsEx help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
cristian20042
AlliedModders Donor
Join Date: Jun 2016
Location: Romania
Old 01-20-2019 , 18:01   [CSGO] SetHudTextParamsEx help
Reply With Quote #1

Hello. I want to make a fade between white and blue, but it only displays white.

Here's the array:
PHP Code:
int rgb1[4] = {255255255255};
int rgb2[4] = {11175193255}; 
Here's the SetHudTextParamsEx:
PHP Code:
SetHudTextParamsEx(0.00.385.0rgb1rgb210.10.10.1);  
ShowHudText(client1allhud); 
__________________
Steam - https://steamcommunity.com/id/sniperheroofficialu/
Discord - SniperHero#8545

Last edited by cristian20042; 01-20-2019 at 18:04.
cristian20042 is offline
adma
Senior Member
Join Date: Oct 2015
Old 01-20-2019 , 20:52   Re: [CSGO] SetHudTextParamsEx help
Reply With Quote #2

PHP Code:
void SetHudTextParamsEx(float xfloat yfloat holdTimeint color1[4], int color2[4], int effectfloat fxTimefloat fadeInfloat fadeOut
I have not used this, but it might be that your fxTime (0.1) should be the same as your holdTime. I am guessing that the fxTime lasts only 0.1s, and since your fade in/fade out are also 0.1, it does not change colour. Try change to:
PHP Code:
SetHudTextParamsEx(0.00.385.0rgb1rgb215.00.10.1);  
ShowHudText(client1allhud); 
adma is offline
cristian20042
AlliedModders Donor
Join Date: Jun 2016
Location: Romania
Old 01-21-2019 , 05:21   Re: [CSGO] SetHudTextParamsEx help
Reply With Quote #3

I'll try when I get home, thanks.
__________________
Steam - https://steamcommunity.com/id/sniperheroofficialu/
Discord - SniperHero#8545
cristian20042 is offline
cristian20042
AlliedModders Donor
Join Date: Jun 2016
Location: Romania
Old 01-21-2019 , 11:51   Re: [CSGO] SetHudTextParamsEx help
Reply With Quote #4

Not working...
__________________
Steam - https://steamcommunity.com/id/sniperheroofficialu/
Discord - SniperHero#8545
cristian20042 is offline
adma
Senior Member
Join Date: Oct 2015
Old 01-22-2019 , 03:10   Re: [CSGO] SetHudTextParamsEx help
Reply With Quote #5

Looks like I was misinformed, fade in/fade out does not relate to the fx time. I did some testing and I could not get effect 0/1 to do anything. This is a potential solution:
PHP Code:
#include <sourcemod>
Handle g_syncHudg_syncHud2;

public 
void OnPluginStart() {
  
g_syncHud CreateHudSynchronizer();
  
g_syncHud2 CreateHudSynchronizer();
  
RegConsoleCmd("sm_hud"sm_hud);
}

public 
Action sm_hud(int clientint args) {
  if (
client 0ShowFadingHudText(client);
}

void ShowFadingHudText(int client) {
  
CreateTimer(1.0Text1GetClientUserId(client), TIMER_REPEAT);
  
CreateTimer(0.5BeginText2GetClientUserId(client));
}

public 
Action BeginText2(Handle timerint userid) {
 
CreateTimer(1.0Text2useridTIMER_REPEAT);
}

public 
Action Text1(Handle timerint userid) {
  
int client GetClientOfUserId(userid);
  if (
client == 0) return Plugin_Stop;
  
SetHudTextParams(0.00.380.125525525525500.50.5);
  
ShowSyncHudText(clientg_syncHud"Test");
  return 
Plugin_Continue;
}

public 
Action Text2(Handle timerint userid) {
  
int client GetClientOfUserId(userid);
  if (
client == 0) return Plugin_Stop;
  
SetHudTextParams(0.00.380.11117519325500.50.5);
  
ShowSyncHudText(clientg_syncHud2"Test");
  return 
Plugin_Continue;

Idea is you have two separate hud elements, both fading in and out but one is shifted so it fades in fully when the other is faded out fully.

Last edited by adma; 01-23-2019 at 04:23. Reason: change if !IsClientInGame(client) => client == 0
adma 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 13:04.


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