Plugin Name: Advance Register System
Modification: Counter-Strike (Not Tested in other games)
Description:
With this plugin you can use for create others plugins using natives for save by account. Example: Bank of Ammo Packs that save by account, XPs that save by Account, etc.
Cvars:
Code:
cvar_maxchar = register_cvar("register_max_char", "15") // Max of Chars for Create Account
cvar_minchar = register_cvar("register_min_char", "3") // Min of Chars for Create Account
cvar_attemps = register_cvar("register_login_attemps", "4") // Max Attemps Number
cvar_bantime = register_cvar("register_bantime", "5") // Ban Time for wrong password X Times.
Natives and Forwards:
Spoiler
Code:
/*
Description: View Player's Account
Example:
new account[40]
get_user_account_name(id, account, charsmax(account)) // get_user_name Style
client_print(id, print_chat, "Your Account: %s", account)
*/
native get_user_account_name(index, account[], len)
/*
Description: View if Player are Logged
Example:
if(is_user_logged(id))
{
client_print(id, print_chat, "You Are Logged xD")
return;
}
else
{
client_print(id, print_chat, "You Aren't Logged xD")
return;
}
*/
native is_user_logged(id)
/*
Description: View if Player are Logged on Steam
Example:
if(is_user_logged_steam(id))
{
client_print(id, print_chat, "You Are Logged on Steam xD")
return;
}
else
{
client_print(id, print_chat, "You Aren't Logged on Steam xD")
return;
}
*/
native is_user_logged_steam(id)
forward user_logged_pre(id) // Executes when the person is Almost Logged
forward user_logged_post(id) // After the person performs Login
forward user_logout_post(id) // After the Exit performs Person Account
How to Install:
Put the files on correct directory
amxmodx/plugins/advance_register_system.amxx
amxmodx/data/lang/advance_register_system.txt
And open plugins.ini file and put this:
advance_register_system.amxx
Credits:
Odair: Author of Plugin [Before it was Ammo Pack's Bank + Register System]
William: For Remove Unecessary contents
[P]erfec[T] [S]cr[@]s[H]: For Fix Some Bugs and for Add the Natives and Lang for this plugin
Example of Plugins with Register Natives:
Spoiler
Bank of Ammo Packs (Automatic):
Code:
#include <amxmodx>
#include <fvault>
#include <advance_register_system>
#include <zombieplague>
#define PLUGIN "[ZP] Register Addon: Bank of Ammo Packs"
#define VERSION "1.0"
#define AUTHOR "[P]erfec[T] [S]cr[@]s[H]"
new bank_data[] = "bank_data"
public plugin_init() register_plugin(PLUGIN, VERSION, AUTHOR)
public user_logout_post(id) zp_set_user_ammo_packs(id, 0), remove_task(id)
public client_putinserver(id) zp_set_user_ammo_packs(id, 0), remove_task(id)
public client_disconnect(id) zp_set_user_ammo_packs(id, 0), remove_task(id)
public user_logged_post(id)
{
new account[40]; get_user_account_name(id, account, charsmax(account))
new data[140]
fvault_get_data(bank_data, account, data, charsmax(data))
zp_set_user_ammo_packs(id, str_to_num(data))
save_data(id)
}
public save_data(id)
{
if(!is_user_logged(id) || !is_user_connected(id)) return;
new account[40]; get_user_account_name(id, account, charsmax(account))
new string[30]; num_to_str(zp_get_user_ammo_packs(id), string, charsmax(string));
fvault_pset_data(bank_data, account, string)
set_task(5.0, "save_data", id)
}
Super Hero XP Data (Save By Register Account):
Code:
/* Plugin generated by AMXX-Studio */
#include <amxmodx>
#include <fvault>
#include <advance_register_system>
#include <superheromod>
#define PLUGIN "[SH] Register Addon: Save XP and Level"
#define VERSION "1.0"
#define AUTHOR "[P]erfec[T] [S]cr[@]s[H]"
#define TASK_AUTOSAVE 13013921
new super_hero_data[] = "super_hero_xps"
public plugin_init() register_plugin(PLUGIN, VERSION, AUTHOR)
public client_putinserver(id) reset_vars(id)
public client_disconnect(id) reset_vars(id)
public user_logout_post(id) reset_vars(id)
public user_logged_post(id)
{
new account[40]
get_user_account_name(id, account, charsmax(account))
new szData[140]
if(fvault_get_data(super_hero_data, account, szData, charsmax(szData)))
{
new str1[10], str2[10]
parse(szData, str1, charsmax(str1), str2, charsmax(str2))
sh_set_user_lvl(id, str_to_num(str1))
sh_set_user_xp(id, str_to_num(str2))
set_task(2.0, "save_data", id+TASK_AUTOSAVE, _, _, "b")
}
}
public save_data(id)
{
id -= TASK_AUTOSAVE
if(!is_user_logged(id) || !is_user_connected(id)) return PLUGIN_HANDLED
new account[40]; get_user_account_name(id, account, charsmax(account))
new szData[40]
formatex(szData, charsmax(szData), "%d %d", sh_get_user_lvl(id), sh_get_user_xp(id))
fvault_pset_data(super_hero_data, account, szData)
return PLUGIN_HANDLED
}
public reset_vars(id)
{
sh_set_user_lvl(id, 0)
sh_set_user_xp(id, 0)
remove_task(id+TASK_AUTOSAVE)
}
The last Register System was unapproved because it's obvious that such a plugin has only 1 use, and that is to support non Steam users. What makes you think that this plugin will slip through? Not to mention that this also has obvious non Steam support after looking in the code for 5 seconds.
The last Register System was unapproved because it's obvious that such a plugin has only 1 use, and that is to support non Steam users. What makes you think that this plugin will slip through? Not to mention that this also has obvious non Steam support after looking in the code for 5 seconds.
Cyber cafe account can have one SteamID, but several dozens of PCs and hundreds users .