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

I need to function - in the plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
1ka
Senior Member
Join Date: Jun 2012
Old 06-24-2012 , 06:47   I need to function - in the plugin
Reply With Quote #1

HTML Code:
public client_authorized(id)
   set_task(10.0, "Checkallplayernames", _, _, _, "b")

(((???
If their name contains the symbol "9".
The player id-Myfeature..
???)))

public Myfeature(id)
{
My feature
}

Please make it here, If anyone is able to.
__________________
Sorry for my bad english.

Last edited by 1ka; 06-24-2012 at 06:51.
1ka is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-24-2012 , 07:02   Re: I need to function - in the plugin
Reply With Quote #2

PHP Code:
/* Script generated by Pawn Studio */

#include <amxmodx>

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

#define TASK_NAME    1000

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
// Add your own code here
}

public 
client_authorized(id)
{
    
set_task10.0"CheckNames"id TASK_NAME__"a");
}

public 
CheckNames(id)
{
    
id -= TASK_NAME;
    
    if( !
is_user_connected(id) )
    {
        return 
PLUGIN_HANDLED;
    }
    
    new 
szName[32];
    
get_user_nameidszNamecharsmax(szName) )
    
    if( 
containszName"9" ) )
    {
        
ExecuteFeature(id)
    }
    
    return 
PLUGIN_HANDLED;
}

public 
ExecuteFeature(id)
{
    if( !
is_user_connected(id) )
    {
        return 
PLUGIN_HANDLED;
    }
    
    
// Do what you want to the player
    
    
return PLUGIN_HANDLED;

__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.

Last edited by GXLZPGX; 06-24-2012 at 07:05.
GXLZPGX is offline
1ka
Senior Member
Join Date: Jun 2012
Old 06-24-2012 , 07:29   Re: I need to function - in the plugin
Reply With Quote #3

PHP Code:
#include <amxmodx> 

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

#define TASK_NAME    1000 

public plugin_init() 

    
register_plugin(PLUGINVERSIONAUTHOR
    
// Add your own code here 


public 
client_authorized(id

    
set_task10.0"CheckNames"id TASK_NAME, .flags="b" ); 


public 
CheckNames(id

    
id -= TASK_NAME
     
    if( !
is_user_connected(id) ) 
    { 
        return 
PLUGIN_HANDLED
    } 
     
    new 
szName[32]; 
    
get_user_nameidszNamecharsmax(szName) ) 
     
    if( 
containszName"9" ) ) 
    { 
        
ExecuteFeature(id
    } 
     
    return 
PLUGIN_HANDLED


public 
ExecuteFeature(id)
{
    if( !
is_user_connected(id) )
    {
        return 
PLUGIN_HANDLED;
    }
    
    
client_print(idprint_chat"[AMXX] your name contains the symbol 9.")
    
    return 
PLUGIN_HANDLED;

Thank you, but,
If my name does not contain these symbol 9, the result is the same.
Just please
__________________
Sorry for my bad english.
1ka is offline
<VeCo>
Veteran Member
Join Date: Jul 2009
Location: Bulgaria
Old 06-24-2012 , 07:40   Re: I need to function - in the plugin
Reply With Quote #4

if( contain( szName, "9" ) != -1 )
__________________
<VeCo> is offline
1ka
Senior Member
Join Date: Jun 2012
Old 06-24-2012 , 07:47   Re: I need to function - in the plugin
Reply With Quote #5

Already working correctly :-)
Thank you very much everyone.
__________________
Sorry for my bad english.

Last edited by 1ka; 06-24-2012 at 07:47.
1ka is offline
GXLZPGX
Veteran Member
Join Date: Sep 2009
Old 06-24-2012 , 08:45   Re: I need to function - in the plugin
Reply With Quote #6

Quote:
Originally Posted by <VeCo> View Post
if( contain( szName, "9" ) != -1 )
+1
__________________
Currently accepting payment US DOLLARS ONLY for custom plugins, contact me through PM.
GXLZPGX 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 09:58.


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