Raised This Month: $ Target: $400
 0% 

Checking player's name?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stupok
Veteran Member
Join Date: Feb 2006
Old 07-16-2007 , 15:18   Re: Checking player's name?
Reply With Quote #1

The plugin below will check if a player's name is "Lol0". It will only check the player's name when he joins the server or changes his name. If it's "Lol0" then it will change his name to "Arion".

PHP Code:
#include <amxmodx>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "stupok69"


public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

public 
client_infochanged(id)
// This is called whenever a client changes an "info"
// the client's name is an "info"

// Store which client caused client_infochanged()
// in the variable id
{
    new 
name[32]
    
    
get_user_info(id"name"name31)
    
// Call this function for client #id
    
    // Get "name" info
    
    // Store the result in the name array
    
    // The last element of name is 31
    
    
if(equal(name"Lol0"))
    
// Compare the contents of name with "Lol0"
    
{
        
client_cmd(id"name Arion")
        
// Call this function for client #id
        
        // Execute this command: "name Arion"
    
}


Last edited by stupok; 07-16-2007 at 15:21.
stupok 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 21:28.


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