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

NEW msg display on css?


Post New Thread Reply   
 
Thread Tools Display Modes
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 11-25-2010 , 14:10   Re: NEW msg display on css?
Reply With Quote #11

erm yeah right, it's already a bit since I last used this.
It has been introduced with the last orangebox update.

Wrote this down below quickly for you, not tested.

PHP Code:
/**
 * Prints a message to a specific client with a hint box on the right side.
 *
 * @param client       Client index
 * @param format        Formatting rules.
 * @param ...            Variable number of format parameters.
 * @noreturn
 */
stock PrintKeyHintText(client, const String:format[], any:...)
{

        if (
IsClientInGame(client))
        {
            
decl String:buffer[192];
            
SetGlobalTransTarget(client);
            
VFormat(buffersizeof(buffer), format3);
            new 
Handle:hBuffer StartMessageOne("KeyHintText"client); 
            
BfWriteByte(hBuffer1); 
            
BfWriteString(hBufferbuffer); 
            
EndMessage();
        }
}

/**
 * Prints a message to all clients with a hint box on the right side.
 *
 * @param format        Formatting rules.
 * @param ...            Variable number of format parameters.
 * @noreturn
 */
stock PrintKeyHintTextToAll(const String:format[], any:...)
{
    
decl String:buffer[192];
    
    for (new 
1<= MaxClientsi++)
    {
        if (
IsClientInGame(i))
        {
            
SetGlobalTransTarget(i);
            
VFormat(buffersizeof(buffer), format2);
            new 
Handle:hBuffer StartMessageOne("KeyHintText"i); 
            
BfWriteByte(hBuffer1); 
            
BfWriteString(hBufferbuffer); 
            
EndMessage();
        }
    }

__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0

Last edited by berni; 11-28-2010 at 15:38.
berni is offline
nvn
Junior Member
Join Date: Aug 2010
Old 11-28-2010 , 12:30   Re: NEW msg display on css?
Reply With Quote #12

If somebody have an idea how to use this natives with translation can u post en example please?
nvn is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 11-28-2010 , 12:50   Re: NEW msg display on css?
Reply With Quote #13

Quote:
Originally Posted by nvn View Post
If somebody have an idea how to use this natives with translation can u post en example please?
PHP Code:
PrintKeyHintText(client"%t""Phrase from the translation file"); 
PHP Code:
PrintKeyHintTextToAll("%t""Phrase from the translation file"); 
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 11-28-2010 , 12:54   Re: NEW msg display on css?
Reply With Quote #14

berni
There is an error in the first stock.
PHP Code:
VFormat(buffersizeof(buffer), format2); 
should be
PHP Code:
VFormat(buffersizeof(buffer), format3); 
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
nvn
Junior Member
Join Date: Aug 2010
Old 11-28-2010 , 13:29   Re: NEW msg display on css?
Reply With Quote #15

Thank you exvel.
btw maybe coz of that error my code wasnt working
nvn is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 11-28-2010 , 15:39   Re: NEW msg display on css?
Reply With Quote #16

Quote:
Originally Posted by nvn View Post
If somebody have an idea how to use this natives with translation can u post en example please?
They are stock functions, not natives

Quote:
Originally Posted by exvel View Post
berni
There is an error in the first stock.
PHP Code:
VFormat(buffersizeof(buffer), format2); 
should be
PHP Code:
VFormat(buffersizeof(buffer), format3); 
erm yes, as I said I didn't test them then, I corrected my previous post
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0

Last edited by berni; 11-28-2010 at 15:41.
berni 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 13:56.


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