It work like admin system of AMX-MODX with optimized coding so you can create flags and assign to each flag some functions
How the SQL work ?
It loads data from sql and config files, if there is a vip account not in sql file, it will be saved there and all accounts will be stored, So all accounts will be read in both files.
You must to enable the include of geoip from the source to use these fields: $city$ , $country$ , $countrycode$ , $continent$ , $continentcode$
How to enable geoip include?
Open the source file and remove these // symbols before "#include <geoip>" from line 10
What to do when the date for a specific extra has expired?
0 = ignore the entire line
1 = put a "#" symbol in the beginning of the line
2 = remove the entire line from the file
This adds can edit easly from VIPSettings file:
✓ Auto reload or command to reload vip
✓ Scoreboard
✓ Command for adding user to the vip file
✓ Connect message
✓ list vip's online
✓ Free vip time
Some pictures of the Buy Account (sub plugin):
( Requirements : AMX-MODX v1.9+ )
API
0
Full documentation can be found there, as well in include file:
/**
* Returns the chat prefix set in the plugin's configuration file.
*
* @param szBuffer Buffer to store the prefix in.
* @param iLen Maximum buffer length.
* @noreturn
*/
native get_vip_prefix( szBuffer[ ], iLen )
/**
* Returns the expiration date format.
*
* @param szBuffer Buffer to store he expiration date format in.
* @param iLen Maximum buffer length.
* @noreturn
*/
native get_expire_type( szBuffer[ ], iLen )
/**
* Returns the vip expire date set in the plugin's configuration file.
*
* @param id Client index.
* @param szBuffer Buffer to store the prefix in.
* @param iLen Maximum buffer length.
* @noreturn
*/
native get_expire_date( id, szBuffer[ ], iLen )
/**
* Set in the plugin's configuration file.
*
* @param szID Client name or authid or ip
* @param szPassword Client password
* @param szFlags Client Flags
* @param szExpireDate Client Expire Date
* @noreturn
*/
/**
* Checks if the client is VIP according to the VIP flags set in the plugin's configuration file or in subplugin's.
*
* @param id Client index.
* @return True if he is, false otherwise.
*/
native bool:is_user_vip( id )
/**
* Checks if the free vip time is active.
*
* @param id Client index.
* @return True if free vip active, false otherwise.
*/
native bool:is_event_time( )
/**
* Returns the client is VIP according to the VIP flags.
*
* @param id Client index.
* @return Client VIP.
* @ex: get_user_vip( id ) & VIP_LEVEL_A
*/
native get_user_vip( id )
/**
* Set the client as VIP.
*
* @param id Client index.
* @param szFlags Client Flags.
* @return Client VIP.
*/
native set_user_vip( id, szFlags )
/**
* Remove the client from VIP flags.
*
* @param id Client index.
* @param szFlags Client Flags select one flags to get remove
* @noreturn
*/
native remove_user_vip( id, szFlags = -1 )
/**
* Returns if the client has any of the specified vip flags.
*
* @param id Client index
* @param flags Flag string
*
* @return 1 if the user has any of the specified flags, 0 otherwise
*/
/**
* Returns if the client has all of the specified vip flags.
*
* @param id Client index
* @param flags Flag string
*
* @return 1 if the user has all of the specified flags, 0 otherwise
*/
/**
* Reloads the configuration file.
*
* @noreturn
*/
native reload_vip( );
/**
* It is called right when event enabled.
*
* @param id Client index.
* @param iStart Start time.
* @param iEnd End time.
* @param iEventFlags EventFlags.
* @param bEvent True if the event started, false otherwise.
* @noreturn
*/
/**
* It is called right after the user is added as vips using the console command or the native.
*
* @param szID Client name or authid or ip
* @param szPassword Client password
* @param szFlags Client Flags
* @param szExpireDate Client Expire Date
* @noreturn
*/
Added Geoip support to use more fields like Country, City, etc...
Added an options in the configuration file to control the expiration date ( "Remove", "Put comment", "Unread" )
Added more settings in the configuration file ( Check it out )
Added native "get_expire_type" returns the expiration date format from the configuration file
Added native "reload_vip" reload the configuration file
Replaced these two natives "get_vip_expire" - "is_free_vip_time" by "get_expire_date" - "is_event_time"
Created a new sub-plugin to buy a VIP account by money ( Requirements : AMX-MODX v1.9+ )
v1.0.5 : February, 17, 2022
Added option for file to enable or disable VIP auto reload.
Added console command to reload VIPs, It's work only if you disable option auto reload.
v1.0.4 : February, 15, 2022
Fixed a bug when free vip time started it was given a random access or full access for everyone.
v1.0.3 : February, 14, 2022
Code Optimized.
Create account file from "VIPSettings.ini" file
If the user has expired or is disabled, it will not be read from the file
Added support for IP, now you can add user by IP
Added has_vip_flag( id, szFlag[ ] ) for returns if the client has any of the specified vip flags.
Added has_all_vip_flags( id, szFlag[ ] ) for returns if the client has any of the specified vip flags or multi flags.
Added a log that show how many accounts in the file.
v1.0.2 : January, 5, 2022
Added %expiredate% field for connect message
Added native get_vip_expire( id, buffer, ilen ) for return the vip expire date.
v1.0.1 : December, 14, 2021
Create the connect message from VIPSetting.ini, if the message empty, will not show.
Added fields %name% , %authid% , %flag% for connect message.
Control the time of task's from VIPSetting.ini.
v1.0.0 : December, 10, 2021
Initial release.
CREDITS
0
➥ OciXCrom for CromChat also i added the same code of expiration date format from his plugin "ChatManager".
➥ edon1337 I learned many things "elite admin system".
#include <amxmodx>
#include <fakemeta>
#include <hamsandwich>
#include <vip>
new g_cMaxSpeed
public plugin_init( )
{
register_plugin( "VIP: Speed", "1.0.0", "Supremache" )
g_cMaxSpeed = register_cvar( "vp_max_speed", "400" );
RegisterHam( Ham_Item_PreFrame, "player", "OnPlayerResetMaxSpeed", 1 );
}
public OnPlayerResetMaxSpeed( id )
{
if( is_user_alive( id ) && is_user_vip( id ) )
{
set_pev( id, pev_maxspeed, get_pcvar_float( g_cMaxSpeed ) );
}
}
How to use: Go to addons\amxmodx\configs and create config file with this name CustomModels.ini.
How to create a model: "Model Name" "Model Flags" "Model Team" for example "vip_model" "abcde" "1"
Meh... I don't know man. Like, really? Another VIP system? It's an honest question though. What made u think this would be a good idea of putting your time and effort into something that's been already made several times?
What makes this so different from all other VIP systems, let alone OciXCrom's VIP system?
We should make and remake the plugin's those has less options or hard coding or doesn't update.
Quote:
Originally Posted by Napoleon_be
What makes this so different from all other VIP systems, let alone OciXCrom's VIP system?
I focused on make something like AMX-MODX admin system but without module and have full api so i added the impportant things to the plugin like Description and make the code full optimized, Even though i don't know about "OciXCrom's VIP system"
It's not the same, My plugin has a custom flags, that can let you use it like admin system but without module, you can create flags and assign to each flag some functions etc..
Interesting idea.
How about the expiration date hour free?
You can set the hour as static 23:59:59 so you only need "MM/DD/YYYY" on the config file. Looks much cleaner IMO
@bigdaddy424, Month/day/year?? Or you meant minute /hour/second, It's calling "free vip hours" it should be by hours and not by minute.
@Natsheh, If this is useless then i why i didn't found server without vip system, the vip system making the player special and making the server owners earning money so i remade it with adds more feature.