Raised This Month: $ Target: $400
 0% 

[ZM] little help with zp vip


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Jumper
Member
Join Date: Aug 2009
Old 07-27-2010 , 10:51   [ZM] little help with zp vip
Reply With Quote #1

can some one add for me this line in this plugin ( zombie vip )

return PLUGIN_CONTINUE

}

public plugin_precache() {
precache_model("models/player/smith/smith.mdl")
precache_model("models/player/smith/smith.mdl")

return PLUGIN_CONTINUE
}

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <hamsandwich>
#include <zombieplague>

////////// PLUGIN SETTINGS //////////
#define MODE 3
#define CHAT_PREFIX "[VIP]"

// (Only if MODE 1 is turrned OFF. Otherwise set flags in vips.ini.) //
#define VIPACCES ADMIN_LEVEL_H
#define MJACCES ADMIN_LEVEL_H
////////// SETTINGS END //////////

// Flags
#define FLAG_A (1<<0)
#define FLAG_B (1<<1)
#define FLAG_C (1<<2)
#define FLAG_D (1<<3)
#define FLAG_E (1<<4)
#define FLAG_K (1<<10)

#define VERSION "1.6"

#if cellbits == 32
const OFFSET_CLIPAMMO 51
#else
const OFFSET_CLIPAMMO 65
#endif
const OFFSET_LINUX_WEAPONS 4

const DMG_HEGRENADE = (1<<24)

#if MODE & (1<<0) || MODE & (1<<1)
new amx_password_field_string[31]
#endif
#if MODE & (1<<0)
new g_user_privileges[33]
enum _:database_items
{
    
auth[50],
    
password[50],
    
accessflags,
    
flags
}
new 
vips_database[database_items]
new Array:
database_holder
#endif
#if MODE & (1<<1)
const ZV_PLUGIN_HANDLED 97
enum _
:items
{
    
i_name[31],
    
i_description[31],
    
i_cost,
    
i_team
}
new 
g_register_in_zp_extra
new g_zp_extra_item_number
new g_menu_close
new extra_items[items]
new Array:
items_database
new g_registered_items_count
new g_forward_return
new g_extra_item_selected
#endif
#if MODE == 3
new g_vip_buy_time
new g_vip_cost_ammo
new g_vip_buy_flags
new days
new months
new years
#endif
new const MAXCLIP[] = { -113, -11017, -130301302025303525122010301008303020273030, -150 }
static const 
CONTACT[] = ""
new g_jumpsg_armorg_killammog_infectammog_infecthealthg_nemhealthg_show_vipsg_unlimited_clipg_damage_rewardg_damage_increase
new g_bit
new maxplayersg_msgSayText
new jumpnum[33]
new 
bool:dojump[33]
new 
Float:g_damage[33]

public 
plugin_init() {
    
    
register_plugin("ZM VIP"VERSION"aaarnas")
    
RegisterHam(Ham_Spawn"player""FwdHamPlayerSpawnPost"1)
    
RegisterHam(Ham_Killed"player""fw_PlayerKilled")
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
register_event("ResetHUD""HUDReset""be")
    
register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")

    
maxplayers get_maxplayers()
    
g_msgSayText get_user_msgid("SayText")
    
    
g_jumps register_cvar("zp_vip_jumps""1")
    
g_bit get_pcvar_num(register_cvar("zp_vip_allow_jump""3"))
    
g_armor register_cvar("zp_vip_armor""65")
    
g_killammo register_cvar("zp_vip_killammo""2")
    
g_infectammo register_cvar("zp_vip_infectammo""2")
    
g_infecthealth register_cvar("zp_vip_infecthealth""300")
    
g_nemhealth register_cvar("zp_vip_nemextra""1")
    
g_show_vips register_cvar("zp_vip_show""1")
    
g_unlimited_clip register_cvar("zp_vip_unlimited_ammo""0")
    
g_damage_reward register_cvar("zp_vip_damage_reward""500")
    
g_damage_increase register_cvar("zp_vip_damage_increase""1.5")
    
register_cvar("amx_contactinfo"CONTACTFCVAR_SERVER)
    
register_cvar("zp_vip_version"VERSIONFCVAR_SERVER|FCVAR_SPONLY)
    
set_cvar_string("zp_vip_version"VERSION)
#if MODE & (1<<0) || MODE & (1<<1)
    
get_cvar_string("amx_password_field"amx_password_field_string30)
    
register_dictionary("zm_vip.txt")
#endif
#if MODE & (1<<0) && MODE & (1<<1)
    
g_vip_cost_ammo register_cvar("zp_vip_cost_ammo""0")
    
g_vip_buy_time register_cvar("zp_vip_buy_time""7")
    
g_vip_buy_flags register_cvar("zp_vip_buy_flags""abcd")
    
set_task(5.0,"check_date",0)
#endif
#if MODE & (1<<0)
    
register_concmd("amx_reloadvips""reload_vips"ADMIN_CFG)
    
reload_vips()
#endif
#if MODE & (1<<1)
    
register_clcmd("say /vm""menu_open")
    
g_register_in_zp_extra register_cvar("zp_vip_register_in_zp_extra""1")
    
g_menu_close register_cvar("zp_vip_menu_close""1")
    
items_database ArrayCreate(items)
    
    new 
temp[31]
    
formatex(temp30"%L"LANG_PLAYER"VIP_EXTRA_NAME")
    if(
get_pcvar_num(g_register_in_zp_extra)) g_zp_extra_item_number zp_register_extra_item(temp00)
    
g_extra_item_selected CreateMultiForward("zv_extra_item_selected"ET_CONTINUEFP_CELLFP_CELL)
#endif
    
register_clcmd("say /vips""print_adminlist")
    
register_clcmd("say /vip""ShowMotd")
}
public 
plugin_cfg()
{
    new 
directory[31]
    
get_configsdir(directory30)
    
server_cmd("exec %s/zm_vip.cfg"directory)
}
#if MODE & (1<<1) || MODE & (1<<0)
public plugin_natives() {
#if MODE & (1<<1)
    
register_native("zv_register_extra_item""native_zv_register_extra_item"1)
#endif
#if MODE & (1<<0)
    
register_native("zv_get_user_flags""native_zv_get_user_flags"1)
#endif    
}
#endif
public FwdHamPlayerSpawnPost(id) {
#if MODE & (1<<0)
    
if(!(g_user_privileges[id] & FLAG_A))
#else
    
if(!(get_user_flags(id) & VIPACCES))
#endif
        
return PLUGIN_HANDLED;

    if(
pev(idpev_armorvalue) < get_pcvar_num(g_armor))
    
set_pev(idpev_armorvaluefloat(get_pcvar_num(g_armor)))
    return 
HAM_IGNORED;
}

public 
fw_PlayerKilled(victimattacker) {
#if MODE & (1<<0)
    
if(is_user_alive(attacker) && g_user_privileges[attacker] & FLAG_A) {
#else
    
if(is_user_alive(attacker) && get_user_flags(attacker) & VIPACCES) {
#endif
        
if(zp_get_user_zombie(attacker) && !(zp_get_user_nemesis(attacker) && !get_pcvar_num(g_nemhealth))) fm_set_user_health(attacker, (pev(attackerpev_health) + get_pcvar_num(g_infecthealth)))
        
zp_set_user_ammo_packs(attackerzp_get_user_ammo_packs(attacker) + get_pcvar_num(g_killammo))
    }
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type) {
    
    if(
victim == attacker)
        return 
HAM_IGNORED
        
    
if(damage_type DMG_HEGRENADE)
        return 
HAM_IGNORED
        
    
if(!is_user_connected(attacker))
        return 
HAM_IGNORED
    
    
if(zp_get_user_zombie(attacker) || zp_get_user_survivor(attacker))
        return 
HAM_IGNORED
        
#if MODE & (1<<0)
    
if(g_user_privileges[attacker] & FLAG_D) {
#else
    
if(get_user_flags(attacker) & VIPACCES) {
#endif
        
if(get_pcvar_num(g_damage_reward) != 0) {
            
g_damage[attacker]+damage
            
if(g_damage[attacker] > float(get_pcvar_num(g_damage_reward))) {
                
zp_set_user_ammo_packs(attackerzp_get_user_ammo_packs(attacker)+1)
                
g_damage[attacker] -= float(get_pcvar_num(g_damage_reward))
            }
        }    
    }
#if MODE & (1<<0)
    
if(g_user_privileges[attacker] & FLAG_D) {
#else
    
if(get_user_flags(attacker) & VIPACCES) {
#endif
        
damage *= get_pcvar_float(g_damage_increase)
        
SetHamParamFloat(4damage)
    }
    return 
HAM_IGNORED    
    
}

public 
zp_user_infected_post(idinfectornemesis) {
    
    
setVip()
#if MODE & (1<<0)
    
if(g_user_privileges[infector] & FLAG_A) {
#else
    
if(get_user_flags(infector) & VIPACCES) {
#endif
        
fm_set_user_health(infector, (pev(infectorpev_health) + get_pcvar_num(g_infecthealth)))
        
zp_set_user_ammo_packs(infectorzp_get_user_ammo_packs(infector) + get_pcvar_num(g_infectammo))
    }    
}

public 
client_connect(id) {
    
    
jumpnum[id] = 0
    g_damage
[id] = 0.0
    dojump
[id] = false
#if MODE & (1<<0)
    
set_flags(id)
    if(
get_pcvar_num(g_show_vips) == && g_user_privileges[id] & FLAG_A) {
#else
    
if(get_pcvar_num(g_show_vips) == && get_user_flags(id) & VIPACCES) {
#endif
        
new name[100]
        
get_user_name(idname100)
        
client_printcolor(0"/g%L"LANG_PLAYER"VIP_CONNECTED"name)
    }
}
#if MODE & (1<<1)
public zp_extra_item_selected(iditem_id)
    if(
item_id == g_zp_extra_item_number)
        
menu_open(id)

public 
menu_open(id) {
#if MODE & (1<<0)
    
if(g_user_privileges[id] & FLAG_E)
        
vip_menu(id)
    else if(
g_user_privileges[id] > 0client_printcolor(id"/g%s /y%L"CHAT_PREFIXid"OFF")    
#else
    
if(get_user_flags(id) & VIPACCES)
        
vip_menu(id)
#endif
#if MODE & (1<<0)
    
else if(get_pcvar_num(g_vip_cost_ammo) != 0)
        
buy_meniu(id)
#endif
    
else client_printcolor(id"/g%s /y%L"CHAT_PREFIXid"NOT_A_VIP")    
    return 
ZP_PLUGIN_HANDLED
}
    
public 
vip_menu(id)
{
    if(
g_registered_items_count == 0) {
        
client_printcolor(id"/g%s /y%L"CHAT_PREFIXid"OFF")
        return 
PLUGIN_HANDLED
    
}
    new 
buttons_string[16], menu_string[31], menu
    formatex
(menu_string30"\r%L"id"MENU_TOP")
    
menu menu_create(menu_string"vip_menu_handler")
    static 
imenu_item[61], team_checknum[3], ammo_packscheck
    check 
0
    team_check 
0
    ammo_packs 
zp_get_user_ammo_packs(id)
    if(
zp_get_user_zombie(id) && !zp_get_user_nemesis(id)) team_check |= FLAG_A
    
else if(!zp_get_user_zombie(id)) team_check |= FLAG_B
    
else if(zp_get_user_nemesis(id)) team_check |= FLAG_C
    
else if(zp_get_user_survivor(id)) team_check |= FLAG_D
    
for(i=0g_registered_items_counti++) {
        
ArrayGetArray(items_databaseiextra_items)
        if(
extra_items[i_team] == || team_check extra_items[i_team]) {
            
formatex(menu_item61"%s \r[%s] %s[%d %L]"extra_items[i_name], extra_items[i_description], ammo_packs extra_items[i_cost] ? "\r" "\y"extra_items[i_cost], id"AMMO")
            
formatex(num2"%d"i)
            
menu_additem(menumenu_itemnum0)
            
check++
        }
    }
    if(
check == 0) {
        
client_printcolor(id"/g%s /y%L"CHAT_PREFIXid"NO_ITEMS")
        return 
1
    
}
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
formatex(buttons_string15"%L"id"NEXT")
    
menu_setprop(menuMPROP_NEXTNAMEbuttons_string)
    
formatex(buttons_string15"%L"id"BACK")
    
menu_setprop(menuMPROP_BACKNAMEbuttons_string)
    
formatex(buttons_string15"%L"id"EXIT")
    
menu_setprop(menuMPROP_EXITNAMEbuttons_string)
    
menu_display(idmenu0)
    
    return 
1
}
 
public 
vip_menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    new 
data[6], iName[64], item_idammo_packs
    
new accesscallback
    menu_item_getinfo
(menuitemaccessdata,5iName63callback)
    
item_id str_to_num(data)
    
ammo_packs zp_get_user_ammo_packs(id)
    
ArrayGetArray(items_databaseitem_idextra_items)
    if(
ammo_packs >= extra_items[i_cost]) zp_set_user_ammo_packs(idammo_packs extra_items[i_cost])
    else {
        
client_printcolor(id"/g%s %L"CHAT_PREFIXid"MISSING_AMMO"extra_items[i_cost]-ammo_packs)
        if(
g_menu_closemenu_destroy(menu)
        else 
vip_menu(id)
        return 
PLUGIN_HANDLED
    
}
    
item_id++
    
ExecuteForward(g_extra_item_selectedg_forward_returniditem_id)
    if (
g_forward_return >= ZV_PLUGIN_HANDLED)
        
zp_set_user_ammo_packs(idammo_packs)
    
    if(
g_menu_closemenu_destroy(menu)
    else 
vip_menu(id)
    return 
PLUGIN_HANDLED
}
#endif
#if MODE & (1<<0) && MODE & (1<<1)
public buy_meniu(id)
{
    new 
buttons_string[16], menu_string[101], menu_item[31], menu
    formatex
(menu_string100"\r%L"id"BUY_MENU_TOP"get_pcvar_num(g_vip_cost_ammo), get_pcvar_num(g_vip_buy_time))
    
menu menu_create(menu_string"buy_menu_handler")
    
    
formatex(menu_item30"%L"id"BUY_MENU_TYPE1")
    
menu_additem(menumenu_item"1"0)
    
formatex(menu_item30"%L"id"BUY_MENU_TYPE2")
    
menu_additem(menumenu_item"2"0)
    
formatex(menu_item30"%L"id"BUY_MENU_TYPE3")
    
menu_additem(menumenu_item"3"0)
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
formatex(buttons_string15"%L"id"EXIT")
    
menu_setprop(menuMPROP_EXITNAMEbuttons_string)
    
menu_display(idmenu0)
}
 
public 
buy_menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}

    new 
data[6], iName[64], keyammo_packs
    
new accesscallback
    menu_item_getinfo
(menuitemaccessdata,5iName63callback)

    
key str_to_num(data)
    
ammo_packs zp_get_user_ammo_packs(id)
    if(
key 1) {
        if(
ammo_packs >= get_pcvar_num(g_vip_cost_ammo)) {
            
amx_tempadmin(idkey)
            
zp_set_user_ammo_packs(idammo_packs get_pcvar_num(g_vip_cost_ammo))
            
client_printcolor(id"/g%s /y%L"CHAT_PREFIXid"BOUGHT_VIP"get_pcvar_num(g_vip_buy_time))
            
        }
        else 
client_printcolor(id"/g%s /y%L"CHAT_PREFIXid"MISSING_AMMO"get_pcvar_num(g_vip_cost_ammo)-ammo_packs)
    }
    else {
        
nick_buy_meniu(id)
        return 
PLUGIN_HANDLED
    
}
    
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
}

public 
nick_buy_meniu(id)
{
    new 
buttons_string[16], menu_string[151], menu_item[81], menuclient_password[21]
    
get_user_info(idamx_password_field_stringclient_password20)
    
formatex(menu_string150"\r%L"id"NICK_BUY_MENU_TOP"client_password)
    
menu menu_create(menu_string"nick_buy_menu_handler")
    
    
formatex(menu_item80"%L"id"NICK_BUY_MENU_TYPE1")
    
menu_additem(menumenu_item"1"0)
    
formatex(menu_item80"%L"id"NICK_BUY_MENU_TYPE2")
    
menu_additem(menumenu_item"2"0)
    
formatex(menu_item80"%L"id"NICK_BUY_MENU_TYPE3"get_pcvar_num(g_vip_cost_ammo) ,get_pcvar_num(g_vip_buy_time))
    
menu_additem(menumenu_item"3"0)
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
formatex(buttons_string15"%L"id"BACK")
    
menu_setprop(menuMPROP_EXITNAMEbuttons_string)
    
menu_display(idmenu0)
    
}
 
public 
nick_buy_menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
buy_meniu(id)
        return 
PLUGIN_HANDLED
    
}

    new 
data[6], iName[64]
    new 
accesscallback
    menu_item_getinfo
(menuitemaccessdata,5iName63callback)

    new 
key str_to_num(data)
    switch(
key) {
        case 
1: {
            
generate_password(id)
            
nick_buy_meniu(id)
        }
        case 
2nick_buy_meniu_sec(id)
        case 
3: {
            
amx_tempadmin(id1)
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_HANDLED
}
public 
nick_buy_meniu_sec(id)
{
    new 
menu_string[151], menu_item[51], menu
    formatex
(menu_string150"\r%L"id"NICK_BUY_MENU_SEC_TOP")
    
menu menu_create(menu_string"nick_buy_menu_sec_handler")
    
    
formatex(menu_item50"%L"id"EXIT")
    
menu_additem(menumenu_item"1"0)
    
    
menu_setprop(menuMPROP_EXITMEXIT_NEVER)
    
menu_display(idmenu0)
}
 
public 
nick_buy_menu_sec_handler(idmenuitem)
{
    
nick_buy_meniu(id)
}
#endif
public message_cur_weapon(msg_idmsg_destmsg_entity)
{
    if (!
get_pcvar_num(g_unlimited_clip)) return
#if MODE & (1<<0)
    
if (!(g_user_privileges[msg_entity] & FLAG_C)) return
#else
    
if (!(get_user_flags(msg_entity) & VIPACCES)) return
#endif
    
if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1) return
    
    static 
weaponclip
    weapon 
get_msg_arg_int(2)
    
clip get_msg_arg_int(3)
    
    if (
MAXCLIP[weapon] > 2)
    {
        
set_msg_arg_int(3get_msg_argtype(3), MAXCLIP[weapon])
        
        if (
clip 2)
        {
            static 
wname[32], weapon_ent
            get_weaponname
(weaponwnamesizeof wname 1)
            
weapon_ent fm_find_ent_by_owner(-1wnamemsg_entity)
            
fm_set_weapon_ammo(weapon_entMAXCLIP[weapon])
        }
    }
}

public 
HUDReset()
    
setVip()
    
public 
setVip()
{
    new 
players[32], pNum
    get_players
(playerspNum"a")

    for (new 
0pNumi++)
    {
        new 
id players[i]
#if MODE & (1<<0)    
        
if (g_user_privileges[id] & FLAG_A)
#else
        
if (get_user_flags(id) & VIPACCES)
#endif
        
{
            
message_begin(MSG_ALLget_user_msgid("ScoreAttrib"))
            
write_byte(id)
            
write_byte(4)
            
message_end()
        }
    }
    return 
PLUGIN_HANDLED
}

public 
print_adminlist(user
{
    new 
adminnames[33][32]
    new 
message[256]
    new 
contactinfo[256], contact[112]
    new 
idcountxlen
    
    
for(id id <= maxplayers id++)
        if(
is_user_connected(id))
#if MODE & (1<<0)
            
if(g_user_privileges[id] & FLAG_A)
#else
            
if(get_user_flags(id) & VIPACCES)
#endif
                
get_user_name(idadminnames[count++], 31)

    
len format(message255"%L "id"VIP_STATUS")
    if(
count 0) {
        for(
count x++) {
            
len += format(message[len], 255-len"%s%s "adminnames[x], < (count-1) ? ", ":"")
            if(
len 96 ) {
                
client_printcolor(user"/g%s"message)
                
len format(message255"")
            }
        }
        
client_printcolor(user"/g%s"message)
    }
    else {
        
len += format(message[len], 255-len"%L "id"VIP_STATUS_N")
        
client_printcolor(user"/g%s"message)
    }
    
    
get_cvar_string("amx_contactinfo"contact63)
    if(
contact[0])  {
        
format(contactinfo111"%L "id"VIP_STATUS_CON"contact)
        
client_printcolor(user"/g%s"contactinfo)
    }
    
}

public 
client_disconnect(id)
{
    
jumpnum[id] = 0
    g_damage
[id] = 0.0
    dojump
[id] = false
}

public 
client_PreThink(id)
{
#if MODE & (1<<0)
    
if(!is_user_alive(id) || !g_jumps || (!(g_user_privileges[id] & FLAG_B))) return PLUGIN_CONTINUE
#else
    
if(!is_user_alive(id) || !g_jumps || (!(get_user_flags(id) & MJACCES))) return PLUGIN_CONTINUE
#endif
    
new nbut get_user_button(id)
    new 
obut get_user_oldbutton(id)
    if((
nbut IN_JUMP) && !(get_entity_flags(id) & FL_ONGROUND) && !(obut IN_JUMP))
    {
        if(
jumpnum[id] < get_pcvar_num(g_jumps) && 
        ((
g_bit FLAG_D && zp_get_user_nemesis(id)) || 
        (
g_bit FLAG_C && zp_get_user_survivor(id)) || 
        (
g_bit FLAG_A && !zp_get_user_zombie(id)) ||
        (
g_bit FLAG_B && zp_get_user_zombie(id) && !zp_get_user_nemesis(id))))
        {
            
dojump[id] = true
            jumpnum
[id]++
            return 
PLUGIN_CONTINUE
        
}
    }
    if((
nbut IN_JUMP) && (get_entity_flags(id) & FL_ONGROUND))
    {
        
jumpnum[id] = 0
        
return PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE
}

public 
client_PostThink(id)
{
#if MODE & (1<<0)
    
if(!is_user_alive(id) || !get_pcvar_num(g_jumps) || (!(g_user_privileges[id] & FLAG_B))) return PLUGIN_CONTINUE
#else
    
if(!is_user_alive(id) || !get_pcvar_num(g_jumps) || (!(get_user_flags(id) & MJACCES))) return PLUGIN_CONTINUE
#endif
    
if(dojump[id] == true)
    {
        new 
Float:velocity[3]    
        
entity_get_vector(id,EV_VEC_velocity,velocity)
        
velocity[2] = random_float(265.0,285.0)
        
entity_set_vector(id,EV_VEC_velocity,velocity)
        
dojump[id] = false
        
return PLUGIN_CONTINUE
    
}
    return 
PLUGIN_CONTINUE
}    

public 
ShowMotd(id)
    
show_motd(id"vip.txt")
#if MODE & (1<<0)
public reload_vips() {
    
    if(
database_holderArrayDestroy(database_holder)
    
database_holder ArrayCreate(database_items)
    new 
configsDir[64]
    
get_configsdir(configsDir63)
    
format(configsDir63"%s/vips.ini"configsDir)
    
    new 
File=fopen(configsDir,"r");
    
    if (
File)
    {
        static 
Text[512], Flags[32], AuthData[50], Privileges_Flags[32], Password[50]
        while (!
feof(File))
        {
            
fgets(File,Text,sizeof(Text)-1);
            
            
trim(Text);
            
            
// comment
            
if (Text[0]==';'
            {
                continue;
            }
            
            
Flags[0]=0;
            
AuthData[0]=0;
            
Privileges_Flags[0]=0;
            
Password[0]=0;
            
            
// not enough parameters
            
if (parse(Text,AuthData,sizeof(AuthData)-1,Password,sizeof(Password)-1,Privileges_Flags,sizeof(Privileges_Flags)-1,Flags,sizeof(Flags)-1) < 2)
            {
                continue;
            }

            
vips_database[auth] = AuthData
            vips_database
[password] = Password
            vips_database
[accessflags] = read_flags(Privileges_Flags)
            
vips_database[flags] = read_flags(Flags)
            
ArrayPushArray(database_holdervips_database)
        }
        
        
fclose(File);
    }
    else 
log_amx("Error: vips.ini file doesn't exist")
}
#endif
#if MODE & (1<<0) && MODE & (1<<1)
public check_date()
{
    new 
todaysmonth[32]
    new 
todaysday[32]
    new 
todaysyear[32]
    
get_time("%m",todaysmonth,31)
    
get_time("%d",todaysday,31)
    
get_time("%Y",todaysyear,31)
    new 
todaysdaynum str_to_num(todaysday)
    new 
todaysmonthnum str_to_num(todaysmonth)
    new 
todaysyearnum str_to_num(todaysyear)
    new 
alltogether[200]
    
format(alltogether,199,"m%dd%dy%d",todaysmonthnum,todaysdaynum,todaysyearnum)

    new 
configdir[200]
    
get_configsdir(configdir,199)

    new 
configfile1[200]

    
format(configfile1,199,"%s/vips.ini",configdir)
    
    new 
text[512], len
    
new pnum file_size(configfile1,1)
    for(new 
1pnumi++)
    {
        
read_file(configfile1itext511len)
        if ( 
contain(textalltogether) != -
        {
            
DeleteLine(configfile1i)
        }
    }
    return 
PLUGIN_HANDLED
}

public 
amx_tempadmin(idtype)
{    
    new 
authid[31], ip[31], name[51], client_password[21], p_flags[21]
    
get_pcvar_string(g_vip_buy_flagsp_flags20)
    
get_user_authid(idauthid30)
    
get_user_ip(idip301)
    
get_user_name(idname50)
    
get_user_info(idamx_password_field_stringclient_password20)
    new 
todaysmonth[32]
    new 
todaysday[32]
    new 
todaysyear[32]
    
get_time("%m",todaysmonth,31)
    
get_time("%d",todaysday,31)
    
get_time("%Y",todaysyear,31)
    new 
day str_to_num(todaysday)
    
months str_to_num(todaysmonth)
    
years str_to_num(todaysyear)
    
days day get_pcvar_num(g_vip_buy_time)
    
    if(
get_pcvar_num(g_vip_buy_time) == || get_pcvar_num(g_vip_buy_time)>=900)
    {
        new 
instertintovips[200]
        switch(
type) {
            case 
1formatex(instertintovips,199,"^"%s^" ^"%s^" ^"%s^" ^"b^"",name,client_password,p_flags)
            case 
2formatex(instertintovips,199,"^"%s^" ^"^" ^"%s^" ^"ce^"",authid,p_flags)
            case 
3formatex(instertintovips,199,"^"%s^" ^"^" ^"%s^" ^"de^"",ip,p_flags)
        }
        new 
configdir[200]
        
get_configsdir(configdir,199)
        new 
configfile1[200]
        
format(configfile1,199,"%s/vips.ini",configdir)
        
write_file(configfile1,instertintovips,-1)
        
server_cmd("amx_reloadvips")
        
set_task(1.0"set_flags"id)
        return 
PLUGIN_HANDLED
    
}

    switch(
months) {
        case 
1: {
            if(
days>31)
            {
                
thirtyone(idtype)
                return 
PLUGIN_HANDLED
            
}
            else
            {
                
makenewdate(idtype)
                return 
PLUGIN_HANDLED
            
}
            return 
PLUGIN_HANDLED
        
}
        case 
2: {
            if(
days>28)
            {
                
february(idtype)
                return 
PLUGIN_HANDLED
            
}
            else
            {
                
makenewdate(idtype)
                return 
PLUGIN_HANDLED
            
}
            return 
PLUGIN_HANDLED
        
}
        case 
3: {
            if(
days>31)
            {
                
thirtyone(idtype)
                return 
PLUGIN_HANDLED
            
}
            else
            {
                
makenewdate(idtype)
                return 
PLUGIN_HANDLED
            
}
            return 
PLUGIN_HANDLED
        
}
        case 
4: {
            if(
days>30)
            {
                
thirty(idtype)
                return 
PLUGIN_HANDLED
            
}
            else
            {
                
makenewdate(idtype)
                return 
PLUGIN_HANDLED
            
}
            return 
PLUGIN_HANDLED
        
}
        case 
5: {
            if(
days>31)
            {
                
thirtyone(idtype)
                return 
PLUGIN_HANDLED
            
}
            else
            {
                
makenewdate(idtype)
                return 
PLUGIN_HANDLED
            
}
            return 
PLUGIN_HANDLED
        
}
        case 
6: {
            if(
days>30)
            {
                
thirty(idtype)
                return 
PLUGIN_HANDLED
            
}
            else
            {
                
makenewdate(idtype)
                return 
PLUGIN_HANDLED
            
}
            return 
PLUGIN_HANDLED
        
}
        case 
7: {
            if(
days>31)
            {
                
thirtyone(idtype)
                return 
PLUGIN_HANDLED
            
}
            else
            {
                
makenewdate(idtype)
                return 
PLUGIN_HANDLED
            
}
            return 
PLUGIN_HANDLED
        
}
        case 
8: {
            if(
days>31)
            {
                
thirtyone(idtype)
                return 
PLUGIN_HANDLED
            
}
            else
            {
                
makenewdate(idtype)
                return 
PLUGIN_HANDLED
            
}
            return 
PLUGIN_HANDLED
        
}
        case 
9: {
            if(
days>30)
            {
                
thirty(idtype)
                return 
PLUGIN_HANDLED
            
}
            else
            {
                
makenewdate(idtype)
                return 
PLUGIN_HANDLED
            
}
            return 
PLUGIN_HANDLED
        
}
        case 
10: {
            if(
days>31)
            {
                
thirtyone(idtype)
                return 
PLUGIN_HANDLED
            
}
            else
            {
                
makenewdate(idtype)
                return 
PLUGIN_HANDLED
            
}
            return 
PLUGIN_HANDLED
        
}
        case 
11: {
            if(
days>30)
            {
                
thirty(idtype)
                return 
PLUGIN_HANDLED
            
}
            else
            {
                
makenewdate(idtype)
                return 
PLUGIN_HANDLED
            
}
            return 
PLUGIN_HANDLED
        
}
        case 
12: {
            if(
days>31)
            {
                
december(idtype)
                return 
PLUGIN_HANDLED
            
}
            else
            {
                
makenewdate(idtype)
                return 
PLUGIN_HANDLED
            
}
            return 
PLUGIN_HANDLED
        
}
    }
    return 
PLUGIN_HANDLED
}

public 
makenewdate(idtype)
{
    new 
alltogether[200], authid[31], ip[31], name[51], client_password[21], p_flags[21]
    
get_pcvar_string(g_vip_buy_flagsp_flags20)
    
get_user_authid(idauthid30)
    
get_user_ip(idip301)
    
get_user_name(idname50)
    
get_user_info(idamx_password_field_stringclient_password20)
    
format(alltogether,199,"m%dd%dy%d",months,days,years)
    new 
instertintovips[200]
    switch(
type) {
        case 
1formatex(instertintovips,199,"^"%s^" ^"%s^" ^"%s^" ^"b^"; Exp: %s",name,client_password,p_flags,alltogether)
        case 
2formatex(instertintovips,199,"^"%s^" ^"^" ^"%s^" ^"ce^"; Exp: %s",authid,p_flags,alltogether)
        case 
3formatex(instertintovips,199,"^"%s^" ^"^" ^"%s^" ^"de^"; Exp: %s",ip,p_flags,alltogether)
    }
    new 
configdir[200]
    
get_configsdir(configdir,199)
    new 
configfile1[200]
    
format(configfile1,199,"%s/vips.ini",configdir)
    
write_file(configfile1,instertintovips,-1)
    
server_cmd("amx_reloadvips")
    
set_task(1.0"set_flags"id)
    return 
PLUGIN_HANDLED
}

public 
december(idtype)
{
    if(
days>31)
    {
        
days days 31
        months 
1
        years 
years 1
        select_days
(idtype)
    }
    else
    {
        
makenewdate(idtype)
    }
    return 
PLUGIN_HANDLED
}

public 
thirtyone(idtype)
{
    if(
days>31)
    {
        
days days 31
        months 
months 1
        select_days
(idtype)
    }
    else
    {
        
makenewdate(idtype)
    }
    return 
PLUGIN_HANDLED
}

public 
thirty(idtype)
{
    if(
days>30)
    {
        
days days 30
        months 
months 1
        select_days
(idtype)
    }
    else
    {
        
makenewdate(idtype)
    }
    return 
PLUGIN_HANDLED
}

public 
february(idtype)
{
    if(
days>28)
    {
        
days days 28
        months 
3
        select_days
(idtype)
    }
    else
    {
        
makenewdate(idtype)
    }
    return 
PLUGIN_HANDLED
}

public 
newyear(idtype)
{
    if(
days>31)
    {
        
days days 31
        years 
years 1
        months 
1
        select_days
(idtype)
    }
    else
    {
        
makenewdate(idtype)
    }
    return 
PLUGIN_HANDLED
}

public 
select_days(idtype)
{
    switch(
months) {
        case 
1457810thirtyone(idtype)
        case 
2february(idtype)
        case 
36911thirty(idtype)
        case 
12newyear(idtype)
    }
    return 
PLUGIN_HANDLED
}

DeleteLine( const szFilename[ ], const iLine )
{
    new 
iFile fopenszFilename"rt" );
    if( !
iFile )
    {
        return;
    }
    static const 
szTempFilename[ ] = "delete_line.txt";
    new 
iTempFile fopenszTempFilename"wt" );
    
    new 
szData256 ], iLineCountbool:bReplaced false;
    while( !
feofiFile ) )
    {
        
fgetsiFileszData255 );
        
        if( 
iLineCount++ == iLine )
        {
            
bReplaced true;
        }
        else
        {
            
fputsiTempFileszData );
        }
    }
    
    
fcloseiFile );
    
fcloseiTempFile );
    
    if( 
bReplaced )
    {
        
delete_fileszFilename );
        
        while( !
rename_fileszTempFilenameszFilename) ) { }
    }
    else
    {
        
delete_fileszTempFilename );
    }
}
#endif
stock fm_set_user_health(idhealth)
{
    (
health 0) ? set_pev(idpev_healthfloat(health)) : dllfunc(DLLFunc_ClientKillid);
}

stock client_printcolor(const id, const input[], any:...)
{
    
    new 
iCount 1iPlayers[32]
    
    static 
szMsg[191]
    
vformat(szMsgcharsmax(szMsg), input3)
    
    
replace_all(szMsg190"/g""^4"// green txt
    
replace_all(szMsg190"/y""^1"// orange txt
    
replace_all(szMsg190"/ctr""^3"// team txt
    
replace_all(szMsg190"/w""^0"// team txt
    
    
if(idiPlayers[0] = id
    
else get_players(iPlayersiCount"ch")
        
    for (new 
0iCounti++)
    {
        if (
is_user_connected(iPlayers[i]))
        {
            
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_iPlayers[i])
            
write_byte(iPlayers[i])
            
write_string(szMsg)
            
message_end()
        }
    }
}

stock fm_find_ent_by_owner(entity, const classname[], owner)
{
    while ((
entity engfunc(EngFunc_FindEntityByStringentity"classname"classname)) && pev(entitypev_owner) != owner) {}
    
    return 
entity;
}

stock fm_set_weapon_ammo(entityamount)
{
    
set_pdata_int(entityOFFSET_CLIPAMMOamountOFFSET_LINUX_WEAPONS);
}
#if MODE & (1<<0)
public set_flags(id) {
    
    static 
authid[31], ip[31], name[51], indexclient_password[31], sizelog_flags[11]
    
get_user_authid(idauthid30)
    
get_user_ip(idip301)
    
get_user_name(idname50)
    
get_user_info(idamx_password_field_stringclient_password30)
    
    
g_user_privileges[id] = 0
    size 
ArraySize(database_holder)
    for(
index=0index size index++) {
        
ArrayGetArray(database_holderindexvips_database)
        if(
vips_database[flags] & FLAG_D) {
            if(
equal(ipvips_database[auth])) {
                if(!(
vips_database[flags] & FLAG_E)) {
                    if(
equal(client_passwordvips_database[password]))
                        
g_user_privileges[id] = vips_database[accessflags]
                    else if(
vips_database[flags] & FLAG_A) {
                        
server_cmd("kick #%d ^"%L^""get_user_userid(id), id"INV_PAS")
                        break
                    }
                }
                else 
g_user_privileges[id] = vips_database[accessflags]
                
get_flags(vips_database[accessflags], log_flags10)
                
log_amx("%L",LANG_PLAYER"AUTHORISED"nameauthidiplog_flags)
                break
            }
        }
        else if(
vips_database[flags] & FLAG_C) {
            if(
equal(authidvips_database[auth])) {
                if(!(
vips_database[flags] & FLAG_E)) {
                    if(
equal(client_passwordvips_database[password]))
                        
g_user_privileges[id] = vips_database[accessflags]
                    else if(
vips_database[flags] & FLAG_A) {
                        
server_cmd("kick #%d ^"%L^""get_user_userid(id), id"INV_PAS")
                        break
                    }
                }
                else 
g_user_privileges[id] = vips_database[accessflags]
                
get_flags(vips_database[accessflags], log_flags10)
                
log_amx("%L",LANG_PLAYER"AUTHORISED"nameauthidiplog_flags)
                break
            }
        }
        else {
            if(
vips_database[flags] & FLAG_K) {
                if((
vips_database[flags] & FLAG_B && contain(namevips_database[auth]) != -1) || equal(namevips_database[auth])) {
                    if(!(
vips_database[flags] & FLAG_E)) {
                        if(
equal(client_passwordvips_database[password]))
                            
g_user_privileges[id] = vips_database[accessflags]
                        else if(
vips_database[flags] & FLAG_A) {
                            
server_cmd("kick #%d ^"%L^""get_user_userid(id), id"INV_PAS")
                            break
                        }
                    }
                    else 
g_user_privileges[id] = vips_database[accessflags]
                    
get_flags(vips_database[accessflags], log_flags10)
                    
log_amx("%L",LANG_PLAYER"AUTHORISED"nameauthidiplog_flags)
                    break
                }
            }
            else {
                if((
vips_database[flags] & FLAG_B && containi(namevips_database[auth]) != -1) || equali(namevips_database[auth])) {
                    if(!(
vips_database[flags] & FLAG_E)) {
                        if(
equal(client_passwordvips_database[password]))
                            
g_user_privileges[id] = vips_database[accessflags]
                        else if(
vips_database[flags] & FLAG_A) {
                            
server_cmd("kick #%d ^"%L^""get_user_userid(id), id"INV_PAS")
                            break
                        }
                    }
                    else 
g_user_privileges[id] = vips_database[accessflags]
                    
get_flags(vips_database[accessflags], log_flags10)
                    
log_amx("%L",LANG_PLAYER"AUTHORISED"nameauthidiplog_flags)
                    break
                }
            }
        }
    }
}
#endif
#if MODE & (1<<0) && MODE & (1<<1)
stock generate_password(id) {
    
    new 
password_holder[31]
    
formatex(password_holder30"%d%d%d%d%d"random(9), random(9), random(9), random(9), random(9))
    
client_cmd(id"setinfo %s %s"amx_password_field_stringpassword_holder)
}
#endif
#if MODE & (1<<0)
public native_zv_get_user_flags(id)
    return 
g_user_privileges[id]
#endif
#if MODE & (1<<1)
public native_zv_register_extra_item(const item_name[], const item_discription[], item_costitem_team)
{
        
param_convert(1)
        
param_convert(2)
        
copy(extra_items[i_name], 30item_name)
        
copy(extra_items[i_description], 30item_discription)
        
extra_items[i_cost] = item_cost
        extra_items
[i_team] = item_team
        ArrayPushArray
(items_databaseextra_items)
        
g_registered_items_count++
        
        return 
g_registered_items_count
}
#endif 
Jumper is offline
Jumper
Member
Join Date: Aug 2009
Old 07-27-2010 , 10:53   Re: [ZM] little help with zp vip
Reply With Quote #2

i need special model for vip so add that line or do new line or give me the plugin give special model for vip in game zombie plague
Jumper is offline
Jumper
Member
Join Date: Aug 2009
Old 07-27-2010 , 10:54   Re: [ZM] little help with zp vip
Reply With Quote #3

human model please .!
Jumper is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:10.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode