Post by Raheem on Oct 15, 2016 23:50:08 GMT
sVIP System
-Explore it your self. This Plugin made by me (Author: Raheem) Privately for |RrebEliii|*
months ago he is the owner of the idea so i don't publish it as he want it be private. Now i discuss with him and he no more play CS now so i publish this may someone need it.
-What's NEW??
1-New Flags inserted. From A to F. And Z.
2-You can set SVIPs members in file in your configs folder name it svips.ini
3-And also info in vipinfo.text as motd.
4-Happy Hours Support.
5-Say /svips
.
.
.
And more just explore it your self. You will need to make include file and put it in your includes folder just write in it:
native get_vip_flags(id)
Now Here is the code and Explore the plugin your self as i don't have time to explain more about it.
-Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <svip>
#include <hamsandwich>
#define VIP_A (1<<0)
#define VIP_B (1<<1)
#define VIP_C (1<<2)
#define VIP_D (1<<3)
#define VIP_E (1<<4)
#define VIP_F (1<<5)
#define VIP_Z (1<<6)
static const COLOR[] = "^x04"
new giRaevID = 0
new giVipFlags[33]
new maxplayers
new gmsgSayText
new gszLocConfigs[129];
new gszLocIni[129];
new gszLocCfg[129];
new gszLocInfo[1025];
new gszLocVipErrors[129];
new bool:gbRaeving = false;
new bool:gbSpawned[33] = false;
public plugin_init()
{
register_plugin("VIP", "1.0", "Raheem")
register_clcmd("svip","svip_menu")
register_concmd("reload","reload_vips")
new szAmxmodx[65];
get_basedir(szAmxmodx, 64);
formatex(gszLocVipErrors, 128, "%s/logs/vip_errors.txt", szAmxmodx);
get_configsdir(gszLocConfigs, 129);
formatex(gszLocIni, 128, "%s/svips.ini", gszLocConfigs);
formatex(gszLocInfo, 1024, "%s/vipinfo.txt", gszLocConfigs);
maxplayers = get_maxplayers()
gmsgSayText = get_user_msgid("SayText")
register_clcmd("say", "handle_say")
register_clcmd("say /svip", "ShowMotd")
}
public plugin_natives()
{
register_native("get_vip_flags", "native_get_vip_flags", 1);
}
public plugin_cfg()
{
if(file_exists(gszLocCfg))
{
server_cmd("exec %s", gszLocCfg);
}
else
{
log_to_vip("File ^"%s^" could not be executed!", gszLocCfg);
}
}
public svip_menu(id)
{
new time[3]
get_time("%H", time, charsmax(time))
new menu = menu_create( "\rSuper VIP Menu:", "menu_handler" )
menu_additem( menu, "Colored MP5 \r[8000$]", "", 0 );
menu_additem( menu, "Janus-3 \r[7500$]", "", 0 );
menu_additem( menu, "M4A1 Red Lightning \r[6000$]", "", 0 );
menu_additem( menu, "Golden Thanatos7 \r[2500$]", "", 0 );
menu_additem( menu, "15000 Ammo Pack \r[Free]", "", 0 );
menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
if((get_vip_flags(id) & VIP_A) || (11 > str_to_num(time) >= 1))
{
menu_display(id, menu, 0);
}
else
{
ChatColor(id, "!y[!gSVIP!y] !tYou Are Not SUPER VIP MEMBER.")
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
public menu_handler(id, menu, item)
{
new time[3]
get_time("%H", time, charsmax(time))
if(11 > str_to_num(time) >= 1) //Free time For ALL
{
switch(item)
{
case 0:
{
client_cmd(id, "g_mp5") //Colored MP5
}
case 1:
{
client_cmd(id, "g_bb") //Janus3
}
case 2:
{
client_cmd(id, "g_m4") // M4A1
}
case 3:
{
client_cmd(id, "g_th7") //Thantos
}
case 4:
{
if(get_vip_flags(id) & VIP_E)
{
client_cmd(id, "g_freeap")
}
else
{
ChatColor(id, "!y[!gSVIP!y] !tYou don't have Access To [ Free Ammo Pack ].")
}
}
}
}
else //Every Weapon With Flag
{
switch(item)
{
case 0:
{
if(get_vip_flags(id) & VIP_B)
{
client_cmd(id, "g_mp5")
}
else
{
ChatColor(id, "!y[!gSVIP!y] !tYou don't have Access To buy [ Colored MP5 ].")
}
}
case 1:
{
if(get_vip_flags(id) & VIP_C)
{
client_cmd(id, "g_bb")
}
else
{
ChatColor(id, "!y[!gSVIP!y] !tYou don't have Access To buy [ Janus-3 ].")
}
}
case 2:
{
if(get_vip_flags(id) & VIP_D)
{
client_cmd(id, "g_m4")
}
else
{
ChatColor(id, "!y[!gSVIP!y] !tYou don't have Access To buy [ Red Lightning M4A1 ].")
}
}
case 3:
{
if(get_vip_flags(id) & VIP_E)
{
client_cmd(id, "g_th7")
}
else
{
ChatColor(id, "!y[!gSVIP!y] !tYou don't have Access To buy [ Golden Thanatos7 ].")
}
}
case 4:
{
if(get_vip_flags(id) & VIP_F)
{
client_cmd(id, "g_freeap")
}
else
{
ChatColor(id, "!y[!gSVIP!y] !tYou don't have Access To [ Free AP ].")
}
}
}
}
menu_destroy(menu);
return PLUGIN_HANDLED;
}
public handle_say(id)
{
new said[192]
read_args(said,192)
if( ( containi(said, "/svips") != -1 && containi(said, "/svips") != -1 ) || contain(said, "/svips") != -1 )
set_task(0.1,"print_adminlist",id)
return PLUGIN_CONTINUE
}
public print_adminlist(user)
{
new adminnames[33][32]
new message[256]
new id, count, x, len
for(id = 1 ; id <= maxplayers ; id++)
if(is_user_connected(id))
if(get_vip_flags(id) & VIP_A)
get_user_name(id, adminnames[count++], 31)
len = format(message, 255, "%sConnected Super V.I.P's: ",COLOR)
if(count > 0)
{
for(x = 0 ; x < count ; x++) {
len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"")
if(len > 96 ) {
print_message(user, message)
len = format(message, 255, "%s ",COLOR)
}
}
print_message(user, message)
}
else
{
len += format(message[len], 255-len,"No One Connected!")
print_message(user, message)
}
}
print_message(id, msg[])
{
message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id)
write_byte(id)
write_string(msg)
message_end()
}
public client_disconnect(id)
{
if(gbRaeving && giRaevID == id)
{
gbRaeving = false;
remove_task();
giRaevID = 0;
}
giVipFlags[id] = get_vip_flags(id);
gbSpawned[id] = false;
}
public ShowMotd(id)
show_motd(id, "svip.txt")
public reload_vips(id)
{
if(get_user_flags(id) & ADMIN_ADMIN || id == 0)
{
new szName[33];
get_user_name(id, szName, 32);
log_to_vip("%s reloaded the VIPs!", szName);
for(new i; i<get_playersnum(); i++)
giVipFlags[i] = get_vip_flags(i);
}
}
log_to_vip(szString[], any:...)
{
new szTime[129];
new szLineToWrite[257];
get_time("%A %d %B - %H:%M:%S", szTime, 128);
formatex(szLineToWrite, 256, "%s - %s", szTime, szString);
write_file(gszLocVipErrors, szLineToWrite, -1);
}
/*=========================NATIVES========================*/
public native_get_vip_flags(id)
{
if(file_exists(gszLocIni))
{
new iMaxLines = file_size(gszLocIni, 1);
new iTxtLen;
new szLineToRead[129];
new szSteamID[33];
new szParse[3][65];
for(new iLineToRead=0; iLineToRead<iMaxLines; iLineToRead++)
{
get_user_authid(id, szSteamID, 32);
read_file(gszLocIni, iLineToRead, szLineToRead, 128, iTxtLen);
parse(szLineToRead, szParse[0], 64, szParse[1], 64, szParse[2], 64);
remove_quotes(szParse[0]);
remove_quotes(szParse[1]);
if(!szParse[0][0] || szParse[0][0] == ';' || (szParse[0][0] == '/' && szParse[0][1] == '/'))
{
continue;
}
if(equali(szSteamID, szParse[0]) && szParse[0][0] == 'S')
{
return read_flags(szParse[1]);
}
}
}
return VIP_Z;
}
/*==========================STOCKs=======================*/
stock ChatColor(const id, const input[], any:...)
{
new count = 1, players[32]
static msg[191]
vformat(msg, 190, input, 3)
replace_all(msg, 190, "!g", "^4") // Green Color
replace_all(msg, 190, "!y", "^1") // Default Color
replace_all(msg, 190, "!t", "^3") // Team Color
replace_all(msg, 190, "!t2", "^0") // Team2 Color
if (id) players[0] = id; else get_players(players, count, "ch")
{
for (new i = 0; i < count; i++)
{
if (is_user_connected(players[i]))
{
message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
write_byte(players[i]);
write_string(msg);
message_end();
}
}
}
}