Raised This Month: $ Target: $400
 0% 

[SNIPPET][CSS] using new entity env_hudhint


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blodia
Veteran Member
Join Date: Sep 2009
Location: UK
Old 07-23-2010 , 18:12   [SNIPPET][CSS] using new entity env_hudhint
Reply With Quote #1

i wasn't sure where to post this so sorry if this is the wrong section, css can now use env_hudhint which means css can also use the "KeyHintText" usermessage e.g

PHP Code:
new String:Message[10] = "hello";
new 
Handle:hBuffer StartMessageOne("KeyHintText"client);
BfWriteByte(hBuffer1);
BfWriteString(hBufferMessage);
EndMessage(); 
this shows a message on the bottom right of the screen, use StartMessageAll("KeyHintText") if you want to send a message to everyone.

if you want to use the entity way.

PHP Code:
new HHIndex CreateEntityByName("env_hudhint");
if (
HHIndex != -1)
 {
    
DispatchKeyValue(HHIndex"message""hello");
    
DispatchKeyValue(HHIndex"spawnflags""1");
    
    
DispatchSpawn(HHIndex);
    
ActivateEntity(HHIndex);
    
    
AcceptEntityInput(HHIndex"ShowHudHint");
 } 
i think this way will show to all clients.

Last edited by blodia; 07-23-2010 at 19:58. Reason: changed topic name
blodia is offline
psychonic

BAFFLED
Join Date: May 2008
Old 07-23-2010 , 19:38   Re: new css entity env_hudhint
Reply With Quote #2

Nice example. Moved to snippets
psychonic is offline
Chrisber
AlliedModders Donor
Join Date: Jul 2007
Location: localhost
Old 07-23-2010 , 20:47   Re: [SNIPPET][CSS] using new entity env_hudhint
Reply With Quote #3

More information:
The hint holds for exactly 6 seconds and fades out then.

Screenshot see below.
Attached Thumbnails
Click image for larger version

Name:	Unbenannt.jpg
Views:	1358
Size:	20.7 KB
ID:	70436  
Chrisber is offline
Greyscale
SourceMod Plugin Approver
Join Date: Dec 2007
Location: strYoMommasHouse[you];
Old 07-23-2010 , 22:12   Re: [SNIPPET][CSS] using new entity env_hudhint
Reply With Quote #4

Is that even visible to the naked eye?
__________________
Greyscale is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 07-23-2010 , 22:15   Re: [SNIPPET][CSS] using new entity env_hudhint
Reply With Quote #5

Thanks blodia
KyleS is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 07-27-2010 , 00:19   Re: [SNIPPET][CSS] using new entity env_hudhint
Reply With Quote #6

Sorry for the double post, however I can't really get this going.

Code:
public OnMapStart()
{
	ServerTimeStart();
}

public ServerTimeStart()
{
	new HHIndex = CreateEntityByName("env_hudhint");
	if (HHIndex != -1)
	{
		CreateTimer(1.0, PrintTimeEnt, HHIndex, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
	}
}

public Action:PrintTimeEnt(Handle:timer, any:HHIndex)
{
	decl String:Time[16];
	FormatTime(Time, sizeof(Time), "%H%M", (GetTime()));
	DispatchKeyValue(HHIndex, "message", Time);
	DispatchKeyValue(HHIndex, "spawnflags", "1");
	
	DispatchSpawn(HHIndex);
	ActivateEntity(HHIndex);
	AcceptEntityInput(HHIndex, "ShowHudHint");
}
AMPasteLink (incase the above has formatting issues): http://ampaste.net/f6e533a47
KyleS is offline
Chrisber
AlliedModders Donor
Join Date: Jul 2007
Location: localhost
Old 07-27-2010 , 07:12   Re: [SNIPPET][CSS] using new entity env_hudhint
Reply With Quote #7

Why don't you use the usermessage version? It is less hacky.

Chris
Chrisber is offline
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 07-27-2010 , 10:38   Re: [SNIPPET][CSS] using new entity env_hudhint
Reply With Quote #8

Quote:
Originally Posted by Chrisber View Post
Why don't you use the usermessage version? It is less hacky.

Chris
True, I'll try that when I get home

EDIT:
Yeah I'm a goof, got it. You can't pass the handle through a timer, at least I don't think...

EDIT2:
Don't even try to use new lines (\n), Server will segfault.

Last edited by KyleS; 07-27-2010 at 20:18.
KyleS is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 08-10-2010 , 07:30   Re: [SNIPPET][CSS] using new entity env_hudhint
Reply With Quote #9

Quote:
Originally Posted by Kyle12 View Post
Don't even try to use new lines (\n), Server will segfault.
Why? Works fine for me.

__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
GoD-Tony
Veteran Member
Join Date: Jul 2005
Old 08-10-2010 , 08:34   Re: [SNIPPET][CSS] using new entity env_hudhint
Reply With Quote #10

Quote:
Originally Posted by exvel View Post
Why? Works fine for me.
Can you post the code you used? Thanks.
GoD-Tony 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 18:47.


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