Raised This Month: $ Target: $400
 0% 

Removing Spectator Banner


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
johnally
Member
Join Date: May 2011
Location: Mauritius
Old 05-12-2011 , 17:28   Removing Spectator Banner
Reply With Quote #1

Here I am again. I hate starting new threads but after some search, I guess It is a must :/

I used the coding below to add a spectator banner top-left.

PHP Code:
// sum of tga files
#define TGASUM 1

// tga of banners
new szTga[TGASUM][] ={
"gfx/banner1.tga"

PHP Code:
public joined_team()
{
    new 
id get_id();

    if ( 
g_SendOnce[id] && is_user_connected(id) )
    {
        
// random select one tga
        
new index random_num0TGASUM 1)
        
g_SendOnce[id] = false

        
// send show tga command to client
        
message_beginMSG_ONESVC_DIRECTOR_id )
        
write_bytestrlenszTga[index]) + // command length in bytes
        
write_byteDRC_CMD_BANNER )
        
write_stringszTga[index] ) // banner file
        
message_end()
   }

However, when client disconnects from server and connects somewhere else, he still sees the banner as I guess it was cached.

Is there a way to clear the banner from cache or add null data to replace the banner?

Btw, I am really thankful of the help you are giving me guys
__________________
No allowed!

johnally is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-12-2011 , 18:36   Re: Removing Spectator Banner
Reply With Quote #2

Have you tried...

Code:
message_begin(MSG_ONE, SVC_DIRECTOR, _, id)
write_byte(2) // or 3 ?
write_byte(DRC_CMD_BANNER)
write_string("")
message_end()
?
__________________
Hunter-Digital is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-12-2011 , 19:05   Re: Removing Spectator Banner
Reply With Quote #3

And how are you going to do this after they already left the server? (or does it not take immediate affect when sending that message?)
__________________
fysiks is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 05-12-2011 , 23:17   Re: Removing Spectator Banner
Reply With Quote #4

Yeah that too, you can't send anything to the client if they disconnect.

Unless you want to disable the banner on your server to prevent players of seeing banners of their previous server.
__________________
Hunter-Digital is offline
johnally
Member
Join Date: May 2011
Location: Mauritius
Old 05-13-2011 , 09:31   Re: Removing Spectator Banner
Reply With Quote #5

I'm not very sure if client_disconnect catches the event when the player is leaving or when he already left. That is a big consideration. :s

Thanks hunter-digital .. Parsing an empty string might be the solution. Will test that as soon as I get my web interface down..

Thanks, you all.. From now on, I'll take a stick and poke my way through
__________________
No allowed!

johnally is offline
SonicSonedit
Veteran Member
Join Date: Nov 2008
Location: Silent Hill
Old 05-13-2011 , 12:17   Re: Removing Spectator Banner
Reply With Quote #6

johnally
Quote:
Originally Posted by johnally
I'm not very sure if client_disconnect catches the event when the player is leaving or when he already left.
After player already left.
__________________

SonicSonedit is offline
johnally
Member
Join Date: May 2011
Location: Mauritius
Old 05-13-2011 , 18:21   Re: Removing Spectator Banner
Reply With Quote #7

Thanks sonicsonedit Now I can rest in peace
__________________
No allowed!

johnally 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 04:27.


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