Raised This Month: $ Target: $400
 0% 

New Code Error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-16-2012 , 09:45   Re: New Code Error
Reply With Quote #1

Quote:
Originally Posted by hornet View Post
And PLEASE stop using those [CODE] tags use [PHP] tags!!
That is a matter of preference. As long as [code] or [php] tags are used then it's okay.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-16-2012 , 11:28   Re: New Code Error
Reply With Quote #2

Quote:
Originally Posted by Exolent[jNr] View Post
That is a matter of preference. As long as [code] or [php] tags are used then it's okay.
I did said please :p

--

Like that.

PHP Code:
#include <amxmodx>
#include <hamsandwich>

#define PLUGIN "HUD-Message"
#define VERSION "1.0"
#define AUTHOR "Waleed Baig"

//create a boolean variable for all players
new bool:g_bWelcomeMsg33 ];

public 
plugin_init() 
{
    
register_pluginPLUGINVERSIONAUTHOR );
    
    
RegisterHamHam_Spawn"player""fwHamPlayerSpawnPost");
}

public 
client_connectiPlayer )
{
    
//reset the variable when player connects
    
g_bWelcomeMsgiPlayer ] = false;
}

public 
fwHamPlayerSpawnPostiPlayer )
{
    if( 
is_user_aliveiPlayer) )
    {    
        
//if user has not seen the welcome message on spawn...
        
if( !g_bWelcomeMsgiPlayer ] )
        {
            
//...show the welcome message
            
set_hudmessage00255, -1.00.2506.030.00.50.5 );
            
show_hudmessageiPlayer"I AM TRYING TO SHOW THIS MESSAGE" );
            
            
//player has seen message and will not see it again until next time he/she visits
            
g_bWelcomeMsgiPlayer ] = true;
        }
    }

__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.

Last edited by hornet; 05-16-2012 at 12:00.
hornet is offline
Waleed
Senior Member
Join Date: May 2012
Location: Pakistan
Old 05-16-2012 , 10:40   Re: New Code Error
Reply With Quote #3

Thanks,It worked,But now I want to show it only once

i.e: When new player joins my server,He will see it,But when he respawns he should not see it again

But my code shows message again and again whenever I respawned.Thankss for all this help.
Waleed is offline
Send a message via Skype™ to Waleed
Waleed
Senior Member
Join Date: May 2012
Location: Pakistan
Old 05-16-2012 , 11:46   Re: New Code Error
Reply With Quote #4

nops,It isn't working.Nothing happening....
Waleed is offline
Send a message via Skype™ to Waleed
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-16-2012 , 12:00   Re: New Code Error
Reply With Quote #5

Yeah whoops I copied your code and editted it ... the one with the bad hook. Code editted. Try now.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Waleed
Senior Member
Join Date: May 2012
Location: Pakistan
Old 05-16-2012 , 12:31   Re: New Code Error
Reply With Quote #6

Its working thanks,But how did you find it?
I am newbie,I want to know this.
Waleed is offline
Send a message via Skype™ to Waleed
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-16-2012 , 12:42   Re: New Code Error
Reply With Quote #7

Because I test on a LAN server, so it prints the error messages straight to my console.
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet 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 00:21.


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