Raised This Month: $ Target: $400
 0% 

New Code Error


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 05-16-2012 , 09:07   Re: New Code Error
Reply With Quote #1

It's because you changed the entity name for the hook, which will be erroring ... Change it back to what I showed you.

You need to change:

PHP Code:
RegisterHam(Ham_Spawn,"players","fwhamplayerspawnpost",1
To

PHP Code:
RegisterHam(Ham_Spawn,"player","fwhamplayerspawnpost",1
And for a better message:

Change:

PHP Code:
set_hudmessage(00255,0.5,0.5,0,6.0,30,0.5,0.5,4
To

PHP Code:
set_hudmessage(00255,-1.0,0.25,0,6.0,30,0.5,0.5
And PLEASE stop using those [CODE] tags use [PHP] tags!!
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 05-16-2012 , 09:45   Re: New Code Error
Reply With Quote #2

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 #3

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 #4

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
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