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

Solved game_text l4d2 help


Post New Thread Reply   
 
Thread Tools Display Modes
Emilio3
Member
Join Date: Aug 2013
Location: London UK
Old 11-28-2017 , 14:15   Re: game_text l4d2 help
Reply With Quote #31

Quote:
Originally Posted by Aceleracion View Post
Change the value of HUD_MID_BOX to HUD_MID_BOT and try again.
PHP Code:
logic_script executing scriptspeakerhud

AN ERROR HAS OCCURED 
[the index 'HUD_MID_BOT' does not exist]

CALLSTACK
*FUNCTION [main()] c:/serverl4d2/left4dead2/left4dead2/scripts/vscripts/speakerhud.nut line [1]

LOCALS
[vargv] ARRAY
[
thisTABLE
SCRIPT PERF WARNING 
--- "main" ran long at 5.162896ms 
some not working
Emilio3 is offline
Aceleracion
Member
Join Date: Jul 2017
Location: Ecuador
Old 11-28-2017 , 14:26   Re: game_text l4d2 help
Reply With Quote #32

Quote:
Originally Posted by Emilio3 View Post
PHP Code:
logic_script executing scriptspeakerhud

AN ERROR HAS OCCURED 
[the index 'HUD_MID_BOT' does not exist]

CALLSTACK
*FUNCTION [main()] c:/serverl4d2/left4dead2/left4dead2/scripts/vscripts/speakerhud.nut line [1]

LOCALS
[vargv] ARRAY
[
thisTABLE
SCRIPT PERF WARNING 
--- "main" ran long at 5.162896ms 
some not working
Better let me try it and I'll let you know. It would be very helpful if you pass me the player speaking plugin to try. For the moment I will try the plugin that I have.
__________________
by Aceleración
To succeed in your goals, use your true potential

Last edited by Aceleracion; 11-28-2017 at 15:30.
Aceleracion is offline
Emilio3
Member
Join Date: Aug 2013
Location: London UK
Old 11-28-2017 , 21:39   Re: game_text l4d2 help
Reply With Quote #33

Quote:
Originally Posted by Aceleracion View Post
Better let me try it and I'll let you know. It would be very helpful if you pass me the player speaking plugin to try. For the moment I will try the plugin that I have.
i give you all before here #27 https://forums.alliedmods.net/showpo...0&postcount=27
the extencion and the sp and the plugin compiled in 1.8

Last edited by Emilio3; 11-28-2017 at 21:43.
Emilio3 is offline
Aceleracion
Member
Join Date: Jul 2017
Location: Ecuador
Old 11-29-2017 , 03:01   Re: game_text l4d2 help
Reply With Quote #34

Quote:
Originally Posted by Emilio3 View Post
i give you all before here #27 https://forums.alliedmods.net/showpo...0&postcount=27
the extencion and the sp and the plugin compiled in 1.8
I already ran the add-on and modified some things in the vscript that is generated automatically, but it already prints the names of the players. I tried it with my own plugin that I have and in yours it must work the same. This is the result:



Change the time interval to 0.8 so that the hud is refreshed in a smoother way. (I did it intuitively lol)

Uncomment the necessary lines that is in the plugin if you need them.

There is a function that is so that your static server logo is not deleted. Uncomment it if you need it.

Greetings.
Attached Files
File Type: sp Get Plugin or Get Source (speakerlist.sp - 1017 views - 7.8 KB)
File Type: smx speakerlist.smx (6.9 KB, 416 views)
__________________
by Aceleración
To succeed in your goals, use your true potential

Last edited by Aceleracion; 11-29-2017 at 03:07.
Aceleracion is offline
Emilio3
Member
Join Date: Aug 2013
Location: London UK
Old 11-29-2017 , 05:40   Re: game_text l4d2 help
Reply With Quote #35

yes my friend you are the best i have ready in new sintax
is working very good now
spanish: eres el mejor man estoy muy agradecido contigo por la ayuda ke me has prestado tan solo una cosa para poner un poko mas abajo y un poko mas a la derecha el speaaker hud cuales son los parametros es solo unos centimetros mas abajo y otros pokos mas a la derecha este es le ke tiene ahora g_ModeScript.HUD_MID_BOX , 0.75 , 0.6 , 0.25 , 0.1 pero no se cual es el de la derecha y el de abajo. bueno ya me dices cuando puedas
here the code
PHP Code:
#include <sourcemod>
#include <sdktools>
#pragma newdecls required

#define PLUGIN_FCVAR FCVAR_NOTIFY
#define PLUGIN_VERSION "1.1"
#define PLUGINS_NAME "l4d2_speakers"

forward void OnClientSpeaking(int client);

public 
Extension __ext_voice 
{
    
name "VoiceHook",
    
file "VoiceHook.ext",
    
autoload 1,
    
required 1,
}

ConVar cvar_speakerlist_type;

int iSpeakListTypeiCount;

bool ClientSpeaking[MAXPLAYERS+1];

char SpeakingPlayers[128], sPath_VscriptHUD[PLATFORM_MAX_PATH];

public 
Plugin myinfo =
{
    
name PLUGINS_NAME,
    
author "Aceleracion and Emilio3",
    
description "Player Speakers List in Hud",
    
version PLUGIN_VERSION,
    
url "n/a"
}

public 
void OnPluginStart()
{
    
cvar_speakerlist_type CreateConVar("voice_speakerlist_type",  "1""Speaker list type (0: Center text, 1: Hud Layout) [DEFAULT: 0]"PLUGIN_FCVARtrue0.0true1.0);
    
RegAdminCmd("sm_runvscript"Command_RunVscriptADMFLAG_ROOT);
    
HookConVarChange(cvar_speakerlist_typeCvar_Changed);
    
char sPath[PLATFORM_MAX_PATH];
    
strcopy(sPathsizeof(sPath), "scripts/vscripts");
    if(
DirExists(sPath) == false)
    {
        
CreateDirectory(sPath511);
    }
    
Format(sPath_VscriptHUDsizeof(sPath_VscriptHUD), "scripts/vscripts/speakerhud.nut")
    if(
FileExists(sPath_VscriptHUD) == false || FileSize(sPath_VscriptHUD) == 0)
    {
        
SaveVscriptHUD();
    }
    
CreateTimer(0.8UpdateSpeaking_TIMER_REPEAT);
}

public 
void OnClientSpeaking(int client)
{
    
ClientSpeaking[client] = true;
}

public 
void OnConfigsExecuted()
{
    
GetCvars();
}

public 
void Cvar_Changed(ConVar convar, const char[] oldValue, const char[] newValue)
{
    
GetCvars();
}

void GetCvars()
{
    
iSpeakListType GetConVarInt(cvar_speakerlist_type);
}

public 
Action Command_RunVscript(int clientint args)
{
    if(
args 1)
    {
        return 
Plugin_Handled;
    }
    
char vscriptFile[40];
    
GetCmdArg(1vscriptFilesizeof(vscriptFile));
    
int entity CreateEntityByName("logic_script");
    if( 
entity != -)
    {
        
DispatchKeyValue(entity"vscripts"vscriptFile);
        
DispatchSpawn(entity);
        
SetVariantString("OnUser1 !self:RunScriptCode::0:-1");
        
AcceptEntityInput(entity"AddOutput");
        
SetVariantString("OnUser1 !self:Kill::1:-1");
        
AcceptEntityInput(entity"AddOutput");
        
AcceptEntityInput(entity"FireUser1");
    }
    return 
Plugin_Handled;
}

public 
Action UpdateSpeaking(Handle timer)
{
    
iCount 0;
    
SpeakingPlayers[0] = '\0';
    for (
int i 1<= MaxClientsi++)
    {
        if (
ClientSpeaking[i])
        {
            if (!
IsClientInGame(i)) continue;
            
            if(
iSpeakListType)
            {
                
Format(SpeakingPlayerssizeof(SpeakingPlayers), "%s\\n> %N"SpeakingPlayersi);
            }
            else
            {
                
Format(SpeakingPlayerssizeof(SpeakingPlayers), "%s\n%N"SpeakingPlayersi);
            }
            
iCount++;
        }
        
ClientSpeaking[i] = false;
    }
    if (
iCount 0)
    {
        if(
iSpeakListType)
        {
            
UpdateDatavalHUD("%s"SpeakingPlayers);
            
ServerCommand("sm_runvscript speakerhud");
        }
        else
        {
            
PrintCenterTextAll("Players Speaking:%s"SpeakingPlayers);
        }
    }
    else
    {
        if(
iSpeakListType)
        {
            
ResetHUD();
            
ServerCommand("sm_runvscript speakerhud");
        }
    }
}

void UpdateDatavalHUD(const char[] formatany ...)
{
    
char buffer[200];
    
VFormat(buffersizeof(buffer), format2);
    
SaveVscriptHUD(buffer);
}

void ResetHUD()
{
    
SaveVscriptHUD();
}

void SaveVscriptHUD(const char[] dataval "")
{
    
Handle hFile OpenFile(sPath_VscriptHUD"w");
    if(
hFile)
    {
        
WriteFileLine(hFile"ModeHUD <-");
        
WriteFileLine(hFile"{");
        
WriteFileLine(hFile"Fields = ");
        
WriteFileLine(hFile"{");
        
WriteFileLine(hFile"logo = ");
        
WriteFileLine(hFile"{");
        
WriteFileLine(hFile"slot = g_ModeScript.HUD_FAR_RIGHT,");
        
WriteFileLine(hFile"dataval = \"UKS_Extrem\",");
        
WriteFileLine(hFile"flags = g_ModeScript.HUD_FLAG_ALIGN_CENTER | g_ModeScript.HUD_FLAG_NOBG,");
        
WriteFileLine(hFile"name = \"logo\" ");
        if(!
StrEqual(dataval""false))
        {
            
WriteFileLine(hFile"},");
            
WriteFileLine(hFile"speaker = ");
            
WriteFileLine(hFile"{");
            
WriteFileLine(hFile"slot = g_ModeScript.HUD_MID_BOX,");
            
WriteFileLine(hFile"dataval = \"%s\","dataval);
            
WriteFileLine(hFile"flags = g_ModeScript.HUD_FLAG_ALIGN_LEFT | g_ModeScript.HUD_FLAG_NOBG,");
            
WriteFileLine(hFile"name = \"speaker\" ");
            
WriteFileLine(hFile"}");
        }
        else
        {
            
WriteFileLine(hFile"}");
        }
        
WriteFileLine(hFile"}");
        
WriteFileLine(hFile"}");
        
WriteFileLine(hFile"");
        
WriteFileLine(hFile"HUDSetLayout( ModeHUD )");
        
WriteFileLine(hFile"HUDPlace( g_ModeScript.HUD_FAR_RIGHT, 0.75 , 0.04 , 0.18 , 0.08)");
        if(!
StrEqual(dataval""false))
        {
            
WriteFileLine(hFile"HUDPlace( g_ModeScript.HUD_MID_BOX , 0.75 , 0.6 , 0.25 , 0.1 )");
        }
        
WriteFileLine(hFile"g_ModeScript");
        
delete hFile;
    }


Last edited by Emilio3; 11-29-2017 at 07:49.
Emilio3 is offline
Emilio3
Member
Join Date: Aug 2013
Location: London UK
Old 11-29-2017 , 10:49   Re: game_text l4d2 help
Reply With Quote #36

g_ModeScript.HUD_MID_BOX , 0.80 , 0.7 , 0.25 , 0.1 )");
that is ok, better
Emilio3 is offline
Aceleracion
Member
Join Date: Jul 2017
Location: Ecuador
Old 11-29-2017 , 12:57   Re: game_text l4d2 help
Reply With Quote #37

Quote:
Originally Posted by Emilio3 View Post
g_ModeScript.HUD_MID_BOX , 0.80 , 0.7 , 0.25 , 0.1 )");
that is ok, better
HUDPlace (slot, x, y, w, h)
  • x: coordinate x of the hud
  • y: coordinate y of the hud
  • w: width of the hud
  • h: height of the hud

In x: If the number is positive it moves to the right, otherwise it moves to the left.
In y: If the number is positive it moves down, otherwise it moves up.

Thanks to you too. I'm glad you found the solution, although it's been a while since you posted the problem.
__________________
by Aceleración
To succeed in your goals, use your true potential

Last edited by Aceleracion; 11-29-2017 at 13:07.
Aceleracion is offline
Vip4ik
New Member
Join Date: Aug 2017
Old 12-01-2017 , 13:59   Re: game_text l4d2 help
Reply With Quote #38

spamming in console "Reload Scripted HUD! " how fix the problem ?
Vip4ik is offline
Aceleracion
Member
Join Date: Jul 2017
Location: Ecuador
Old 12-01-2017 , 22:56   Re: game_text l4d2 help
Reply With Quote #39

Quote:
Originally Posted by Vip4ik View Post
spamming in console "Reload Scripted HUD! " how fix the problem ?
It's a console message that comes out by reloading the HUD, not that there's a problem with the HUD or something like that. It is not another thing.
__________________
by Aceleración
To succeed in your goals, use your true potential
Aceleracion is offline
Vip4ik
New Member
Join Date: Aug 2017
Old 12-02-2017 , 09:51   Re: game_text l4d2 help
Reply With Quote #40

Quote:
Originally Posted by Aceleracion View Post
It's a console message that comes out by reloading the HUD, not that there's a problem with the HUD or something like that. It is not another thing.
but this plugin not work
Vip4ik is offline
Reply


Thread Tools
Display Modes

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 03:19.


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