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(PLUGIN, VERSION, AUTHOR)
}
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", name, 31)
// 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"
}
}