Configs mappában kell létrehoznod amx_login_vip mappát és azon belül egy amx_login_vip.ini fájlt. Az
ini fájlba kell beleírnod a vipeket. pl.: "Silent" "Silentjelszava"
Utána a vip betud jelentkezni konzolból így: amx_login_vip "Silent" "Silentjelszava"
vagy kijelentkezhet így: amx_logout_vip
Kód:
#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#define max_vips 64
new bool:vip[32];
public login(id)
{
new usercfg[64]
new arguser[32], argpass[32], username[32], password[32]
new line = 0
new linetext[255], linetextlength
read_argv(1,arguser,31)
read_argv(2,argpass,31)
if((arguser[0] > 0)&&(argpass[0] > 0))
{
get_customdir(usercfg, 63)
format(usercfg, 63, "%s/amx_login_vip/login_vip.ini", usercfg)
if (file_exists(usercfg))
{
while ((line = read_file(usercfg, line, linetext, 256, linetextlength)))
{
if(linetext[0] == ';')
{
continue
}
parse(linetext, username, 31, password, 31)
if((equal(username, arguser))&&(equal(password, argpass)))
{
vip[id] = true;
new text[128]
format(text, 128, "[INFO] Sikeresen bejelentkeztel")
client_print(id, print_console, text)
return PLUGIN_HANDLED
}
}
client_print(id, print_console, "[INFO] Rossz felhasznalo es/vagy jelszo.")
}
}
return PLUGIN_HANDLED
}
public logout(id)
{
vip[id] = false;
client_print(id, print_console, "[INFO] Kijelentkeztel a VIP-bol.")
return PLUGIN_HANDLED
}
public plugin_init()
{
register_plugin("VIP","1.0","James Romeril & Silent");
register_clcmd("amx_login_vip","login",-1,"");
register_clcmd("amx_logout_vip","logout",-1,"");
register_logevent("RoundStart", 2, "1=Round_Start");
register_cvar("hs_mode","ab")
register_event("DeathMsg", "eDeath", "a", "1>0");
}
public client_connect(id)
{
vip[id] = false;
}
public client_disconnect(id)
{
vip[id] = false;
}
public eDeath()
{
new killer = read_data(1);
new hsmode[4]
get_cvar_string("hs_mode",hsmode,4)
new hsmode_bit = read_flags(hsmode)
if (hsmode_bit & 1)
{
cs_set_user_money(killer, cs_get_user_money(killer) + 100);
}
if(vip[killer] && hsmode_bit & 1)
{
cs_set_user_money(killer, cs_get_user_money(killer) + 100);
}
}
public RoundStart()
{
new players[32], iNum;
get_players(players, iNum);
for(new i=0; i<iNum; i++)
{
new pId = players[i];
if(vip[pId])
{
cs_set_user_vip (pId, 1, 0, 1)
give_item(pId, "weapon_hegrenade");
give_item(pId, "weapon_hegrenade");
give_item(pId, "weapon_smokegrenade");
give_item(pId, "weapon_smokegrenade");
give_item(pId, "weapon_flashbang");
give_item(pId, "weapon_flashbang");
}
}
}