Raised This Month: $ Target: $400
 0% 

Help me insert text message notice into sma file


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
meigyoku
BANNED
Join Date: Apr 2009
Old 09-26-2009 , 00:17   Help me insert text message notice into sma file
Reply With Quote #1

I download some plugins with sma, I do not know about C++, script
I want to make two message style scripts:
1. When player connect to server, display message one time in client_print, then message is not display in the next round
2. The message is display every round in client_print

I want to insert this script into sma file:
For example I see script in sma:

Code:
public PrintRule(id)
{
 if ( is_user_connected(id) && !is_user_bot(id) && !is_user_hltv(id) ){
  client_print(id,print_chat,"say /spec became Spectator")
  client_print(id,print_chat,"say /back to exit Spectator")
 }
}
meigyoku is offline
Alucard^
AMXX Moderator: Others
Join Date: Sep 2007
Location: Street
Old 09-27-2009 , 18:14   Re: Help me insert text message notice into sma file
Reply With Quote #2

If i understand....

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

#define PLUGIN    "New Plugin"
#define AUTHOR    "Alucard"
#define VERSION    "1.0"

new bool:FirstSpawn[33]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""HookSpawn"1)
}

public 
client_putinserver(id)
    
FirstSpawn[id] = true

public HookSpawn(id)
{
    
client_print(idprint_chat"Hello i am a msg for every spawn")
    
    if(
FirstSpawn[id])
        
client_print(idprint_chat"Hellooo i am the first and last message")
    
    
FirstSpawn[id] = false

__________________
Approved Plugins - Steam Profile

Public non-terminated projects:
All Admins Menu, HLTV parameters, Subnick,
Second Password (cool style), InfoZone,
Binary C4 plant/defuse, and more...

Private projects:
NoSpec (+menu), NV Surf Management,
PM Adanved System, KZ longjump2, and more...
Alucard^ is offline
Send a message via Skype™ to Alucard^
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-27-2009 , 19:03   Re: Help me insert text message notice into sma file
Reply With Quote #3

Just a few minor changes

PHP Code:
public HookSpawn(id)
{
    if ( 
is_user_aliveid ) )
    {
        if( 
FirstSpawn[id] )
        {
            
FirstSpawn[id] = false
            client_print
(idprint_chat"Hellooo i am the first and last message")
        }
        else
        {
            
client_print(idprint_chat"Hello i am a msg for every spawn")
        }
    }

__________________
Bugsy is offline
meigyoku
BANNED
Join Date: Apr 2009
Old 09-28-2009 , 08:21   Re: Help me insert text message notice into sma file
Reply With Quote #4

Thank Alucard^ and Bugsy!

It mean I combine two script above !
If i want make two scripts: one for FirstSpawn and one for every spawn. How Can I make that? ( I only want to insert those scripts into other sripts)

P/S Bugsy: I like so much your aimbot plugins but think I set config file not exactly! Can you help me for that?
meigyoku is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-28-2009 , 09:02   Re: Help me insert text message notice into sma file
Reply With Quote #5

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

#define PLUGIN    "New Plugin"
#define AUTHOR    "Alucard"
#define VERSION    "1.0"

new bool:FirstSpawn[33]

public 
plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
RegisterHam(Ham_Spawn"player""HookSpawn"1)
}

public 
client_putinserver(id)
    
FirstSpawn[id] = true

///=====select only one of the two below per plugin=====
//First spawn only
public HookSpawn(id)
{
    if ( 
is_user_aliveid ) && FirstSpawn[id] )
    {
            
FirstSpawn[id] = false
            client_print
(idprint_chat"Hello i will only appear at first spawn")
    }
}  

//Every spawn
public HookSpawn(id)
{
    if ( 
is_user_aliveid ) )
            
client_print(idprint_chat"Hello i will appear at every spawn")

__________________
Bugsy is offline
meigyoku
BANNED
Join Date: Apr 2009
Old 09-28-2009 , 13:23   Re: Help me insert text message notice into sma file
Reply With Quote #6

But when I compile:
Error: Symbol already defined: "HookSpawn" on line 33
line 32 public HookSpawn(id)
line 33 {
line 34 if ( is_user_alive( id ) )
meigyoku is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 09-28-2009 , 13:23   Re: Help me insert text message notice into sma file
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
PHP Code:
///=====select only one of the two below per plugin=====
//First spawn only
public HookSpawn(id)
{
    if ( 
is_user_aliveid ) && FirstSpawn[id] )
    {
            
FirstSpawn[id] = false
            client_print
(idprint_chat"Hello i will only appear at first spawn")
    }
}  

//Every spawn
public HookSpawn(id)
{
    if ( 
is_user_aliveid ) )
            
client_print(idprint_chat"Hello i will appear at every spawn")

__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
meigyoku
BANNED
Join Date: Apr 2009
Old 09-29-2009 , 00:45   Re: Help me insert text message notice into sma file
Reply With Quote #8

Exolent[jNr]
I do not understand you write.
Some options of people (include me) in Advanced Bans (Real Time) by Exolent but you does not reply
meigyoku is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 09-29-2009 , 03:57   Re: Help me insert text message notice into sma file
Reply With Quote #9

When he quotes someone without any other text from him it means that you need to re-read what was said, read it carefully.

Summary: You use one or the other, not both.

If you want both then you need to use what is in Bugsy's first post in this thread.
__________________
fysiks is offline
meigyoku
BANNED
Join Date: Apr 2009
Old 09-29-2009 , 15:18   Re: Help me insert text message notice into sma file
Reply With Quote #10

Ok I understand. Thanks!
I know that can not insert this script into other sma file because I do not know about C++
meigyoku 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:32.


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