Raised This Month: $51 Target: $400
 12% 

Zp sma file help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ShooTeR XKy
Member
Join Date: Jul 2014
Location: Palestine
Old 06-01-2016 , 18:48   Zp sma file help
Reply With Quote #1

Please i want learn how to add command
in my mod SMA File like the PIC
i Use -> Zombie Plague 4.3
Example i want know how to add VIP Menu


Last edited by ShooTeR XKy; 06-01-2016 at 18:53. Reason: Edit
ShooTeR XKy is offline
Kakarot47
Senior Member
Join Date: May 2015
Location: Pakistan
Old 06-02-2016 , 07:53   Re: Zp sma file help
Reply With Quote #2

For menu you have to add 2 lines at diffrent places
1st line
PHP Code:
// 7. VIP meniu items
      
len += formatex(menu[len], charsmax(menu) - len"\r7.\w VIP Menu Items^n^n"
and 2nd
PHP Code:
case 6client_cmd(id"say /vm"// Vip menu call 
First change below
PHP Code:
/*================================================================================
 [Menus]
=================================================================================*/

// Game Menu
show_menu_game(id)
{
    static 
menu[250], lenuserflags
    len 
0
    userflags 
get_user_flags(id)
    
    
// Title
    
len += formatex(menu[len], charsmax(menu) - len"\y%s^n^n"g_modname)
    
    
// 1. Buy weapons
    
if (get_pcvar_num(cvar_buycustom))
        
len += formatex(menu[len], charsmax(menu) - len"\r1.\w %L^n"id"MENU_BUY")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d1. %L^n"id"MENU_BUY")
    
    
// 2. Extra items
    
if (get_pcvar_num(cvar_extraitems) && g_isalive[id])
        
len += formatex(menu[len], charsmax(menu) - len"\r2.\w %L^n"id"MENU_EXTRABUY")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d2. %L^n"id"MENU_EXTRABUY")
    
    
// 3. Zombie class
    
if (get_pcvar_num(cvar_zclasses))
        
len += formatex(menu[len], charsmax(menu) - len"\r3.\w %L^n"id,"MENU_ZCLASS")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d3. %L^n"id,"MENU_ZCLASS")
    
    
// 4. Unstuck
    
if (g_isalive[id])
        
len += formatex(menu[len], charsmax(menu) - len"\r4.\w %L^n"id"MENU_UNSTUCK")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d4. %L^n"id"MENU_UNSTUCK")
    
    
// 5. Help
    
len += formatex(menu[len], charsmax(menu) - len"\r5.\w %L^n^n"id"MENU_INFO")
    
    
// 6. Join spec
    
if (!g_isalive[id] || !get_pcvar_num(cvar_blocksuicide) || (userflags g_access_flag[ACCESS_ADMIN_MENU]))
        
len += formatex(menu[len], charsmax(menu) - len"\r6.\w %L^n^n"id"MENU_SPECTATOR")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d6. %L^n^n"id"MENU_SPECTATOR")
    
    
// 7. Admin menu
    
if (userflags g_access_flag[ACCESS_ADMIN_MENU3])
        
len += formatex(menu[len], charsmax(menu) - len"\r7.\w %L"id"MENU3_ADMIN")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d7. %L"id"MENU3_ADMIN")
    
    
// 0. Exit
    
len += formatex(menu[len], charsmax(menu) - len"^n^n\r0.\w %L"id"MENU_EXIT")
    
    
show_menu(idKEYSMENUmenu, -1"Game Menu"
-->
PHP Code:
/*================================================================================
 [Menus]
=================================================================================*/

// Game Menu
show_menu_game(id)
{
    static 
menu[250], lenuserflags
    len 
0
    userflags 
get_user_flags(id)
    
    
// Title
    
len += formatex(menu[len], charsmax(menu) - len"\y%s^n^n"g_modname)
    
    
// 1. Buy weapons
    
if (get_pcvar_num(cvar_buycustom))
        
len += formatex(menu[len], charsmax(menu) - len"\r1.\w %L^n"id"MENU_BUY")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d1. %L^n"id"MENU_BUY")
    
    
// 2. Extra items
    
if (get_pcvar_num(cvar_extraitems) && g_isalive[id])
        
len += formatex(menu[len], charsmax(menu) - len"\r2.\w %L^n"id"MENU_EXTRABUY")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d2. %L^n"id"MENU_EXTRABUY")
    
    
// 3. Zombie class
    
if (get_pcvar_num(cvar_zclasses))
        
len += formatex(menu[len], charsmax(menu) - len"\r3.\w %L^n"id,"MENU_ZCLASS")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d3. %L^n"id,"MENU_ZCLASS")
    
    
// 4. Unstuck
    
if (g_isalive[id])
        
len += formatex(menu[len], charsmax(menu) - len"\r4.\w %L^n"id"MENU_UNSTUCK")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d4. %L^n"id"MENU_UNSTUCK")
    
    
// 5. Help
    
len += formatex(menu[len], charsmax(menu) - len"\r5.\w %L^n^n"id"MENU_INFO")
    
    
// 6. Join spec
    
if (!g_isalive[id] || !get_pcvar_num(cvar_blocksuicide) || (userflags g_access_flag[ACCESS_ADMIN_MENU]))
        
len += formatex(menu[len], charsmax(menu) - len"\r6.\w %L^n^n"id"MENU_SPECTATOR")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d6. %L^n^n"id"MENU_SPECTATOR")

    
// 7. VIP meniu items
      
len += formatex(menu[len], charsmax(menu) - len"\r7.\w VIP Menu Items^n^n"
    
    
// 9. Admin menu
    
if (userflags g_access_flag[ACCESS_ADMIN_MENU3])
        
len += formatex(menu[len], charsmax(menu) - len"\r9.\w %L"id"MENU3_ADMIN")
    else
        
len += formatex(menu[len], charsmax(menu) - len"\d9. %L"id"MENU3_ADMIN")
    
    
// 0. Exit
    
len += formatex(menu[len], charsmax(menu) - len"^n^n\r0.\w %L"id"MENU_EXIT")
    
    
show_menu(idKEYSMENUmenu, -1"Game Menu")


Next edit below
PHP Code:
/*================================================================================
 [Menu Handlers]
=================================================================================*/

// Game Menu
public menu_game(idkey)
{
    switch (
key)
    {
        case 
0// Buy Weapons
        
{
            
// Custom buy menus enabled?
            
if (get_pcvar_num(cvar_buycustom))
            {
                
// Disable the remember selection setting
                
WPN_AUTO_ON 0
                zp_colored_print
(id"^x04[ZP]^x01 %L"id"BUY_ENABLED")
                
                
// Show menu if player hasn't yet bought anything
                
if (g_canbuy[id]) show_menu_buy1(id)
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
        }
        case 
1// Extra Items
        
{
            
// Extra items enabled?
            
if (get_pcvar_num(cvar_extraitems))
            {
                
// Check whether the player is able to buy anything
                
if (g_isalive[id])
                    
show_menu_extras(id)
                else
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_EXTRAS")
        }
        case 
2// Zombie Classes
        
{
            
// Zombie classes enabled?
            
if (get_pcvar_num(cvar_zclasses))
                
show_menu_zclass(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_ZCLASSES")
        }
        case 
3// Unstuck
        
{
            
// Check if player is stuck
            
if (g_isalive[id])
            {
                if (
is_player_stuck(id))
                {
                    
// Move to an initial spawn
                    
if (get_pcvar_num(cvar_randspawn))
                        
do_random_spawn(id// random spawn (including CSDM)
                    
else
                        
do_random_spawn(id1// regular spawn
                
}
                else
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_STUCK")
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
        }
        case 
4// Help Menu
        
{
            
show_menu_info(id)
        }
        case 
5// Join Spectator
        
{
            
// Player alive?
            
if (g_isalive[id])
            {
                
// Prevent abuse by non-admins if block suicide setting is enabled
                
if (get_pcvar_num(cvar_blocksuicide) && !(get_user_flags(id) & g_access_flag[ACCESS_ADMIN_MENU]))
                {
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
                    return 
PLUGIN_HANDLED;
                }
                
                
// Check that we still have both humans and zombies to keep the round going
                
check_round(id)
                
                
// Kill him before he switches team
                
dllfunc(DLLFunc_ClientKillid)
            }
            
            
// Temporarily save player stats?
            
if (get_pcvar_num(cvar_statssave)) save_stats(id)
            
            
// Remove previous tasks
            
remove_task(id+TASK_TEAM)
            
remove_task(id+TASK_MODEL)
            
remove_task(id+TASK_FLASH)
            
remove_task(id+TASK_CHARGE)
            
remove_task(id+TASK_SPAWN)
            
remove_task(id+TASK_BLOOD)
            
remove_task(id+TASK_AURA)
            
remove_task(id+TASK_BURN)
            
            
// Then move him to the spectator team
            
fm_cs_set_user_team(idFM_CS_TEAM_SPECTATOR)
            
fm_user_team_update(id)
        }

        case 
6:
        {
            
// Check if player has the required access
            
if (get_user_flags(id) & g_access_flag[ACCESS_ADMIN_MENU3])
                
show_menu3_admin(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_ACCESS")
        }
    }
    
    return 
PLUGIN_HANDLED;

-->
PHP Code:
/*================================================================================
 [Menu Handlers]
=================================================================================*/

// Game Menu
public menu_game(idkey)
{
    switch (
key)
    {
        case 
0// Buy Weapons
        
{
            
// Custom buy menus enabled?
            
if (get_pcvar_num(cvar_buycustom))
            {
                
// Disable the remember selection setting
                
WPN_AUTO_ON 0
                zp_colored_print
(id"^x04[ZP]^x01 %L"id"BUY_ENABLED")
                
                
// Show menu if player hasn't yet bought anything
                
if (g_canbuy[id]) show_menu_buy1(id)
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
        }
        case 
1// Extra Items
        
{
            
// Extra items enabled?
            
if (get_pcvar_num(cvar_extraitems))
            {
                
// Check whether the player is able to buy anything
                
if (g_isalive[id])
                    
show_menu_extras(id)
                else
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_EXTRAS")
        }
        case 
2// Zombie Classes
        
{
            
// Zombie classes enabled?
            
if (get_pcvar_num(cvar_zclasses))
                
show_menu_zclass(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_ZCLASSES")
        }
        case 
3// Unstuck
        
{
            
// Check if player is stuck
            
if (g_isalive[id])
            {
                if (
is_player_stuck(id))
                {
                    
// Move to an initial spawn
                    
if (get_pcvar_num(cvar_randspawn))
                        
do_random_spawn(id// random spawn (including CSDM)
                    
else
                        
do_random_spawn(id1// regular spawn
                
}
                else
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_STUCK")
            }
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
        }
        case 
4// Help Menu
        
{
            
show_menu_info(id)
        }
        case 
5// Join Spectator
        
{
            
// Player alive?
            
if (g_isalive[id])
            {
                
// Prevent abuse by non-admins if block suicide setting is enabled
                
if (get_pcvar_num(cvar_blocksuicide) && !(get_user_flags(id) & g_access_flag[ACCESS_ADMIN_MENU]))
                {
                    
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT")
                    return 
PLUGIN_HANDLED;
                }
                
                
// Check that we still have both humans and zombies to keep the round going
                
check_round(id)
                
                
// Kill him before he switches team
                
dllfunc(DLLFunc_ClientKillid)
            }
            
            
// Temporarily save player stats?
            
if (get_pcvar_num(cvar_statssave)) save_stats(id)
            
            
// Remove previous tasks
            
remove_task(id+TASK_TEAM)
            
remove_task(id+TASK_MODEL)
            
remove_task(id+TASK_FLASH)
            
remove_task(id+TASK_CHARGE)
            
remove_task(id+TASK_SPAWN)
            
remove_task(id+TASK_BLOOD)
            
remove_task(id+TASK_AURA)
            
remove_task(id+TASK_BURN)
            
            
// Then move him to the spectator team
            
fm_cs_set_user_team(idFM_CS_TEAM_SPECTATOR)
            
fm_user_team_update(id)
        }

        case 
6client_cmd(id"say /vm"// Vip menu call 

        
case 8// Admin Menu
        
{
            
// Check if player has the required access
            
if (get_user_flags(id) & g_access_flag[ACCESS_ADMIN_MENU3])
                
show_menu3_admin(id)
            else
                
zp_colored_print(id"^x04[ZP]^x01 %L"id"CMD_NOT_ACCESS")
        }
    }
    
    return 
PLUGIN_HANDLED;

Done.
__________________



AssasinSniperNightmare ModArmageddon ModApolacyps Mod
Kakarot47 is offline
Send a message via Skype™ to Kakarot47
ShooTeR XKy
Member
Join Date: Jul 2014
Location: Palestine
Old 06-02-2016 , 17:49   Re: Zp sma file help
Reply With Quote #3

Thank You Very Very Much

ShooTeR XKy is offline
Amine Belokda
Senior Member
Join Date: Oct 2015
Location: ML_NOT_FOUND
Old 06-29-2016 , 02:36   Re: Zp sma file help
Reply With Quote #4

You Want Add Menu In Mod ( No Cmd )
Exmple:
PHP Code:
case 6vip_menu(id)
// .... //
// .... //
// .... //
// .... //
// .... //
// .... //
// .... //
// .... //
// .... //
// .... //
public vip_menu(id){
       if( 
get_user_flags(id) && ADMIN_LEVEL_H // acces: t 
       
{
 ................... 
addmenuitem here //
... 
__________________

Last edited by Amine Belokda; 06-29-2016 at 02:37. Reason: hhh sorry i fix erro ( if_get_user_flags(id) hhhhh sorry
Amine Belokda is offline
Send a message via MSN to Amine Belokda
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 06-29-2016 , 12:33   Re: Zp sma file help
Reply With Quote #5

Kakarot can you make this .sma VIP to have be in the main menu just like in the pic , it already has /vm so no need for it.
PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>
#include <engine>
#include <fun>
#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.7.1"

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

const DMG_HEGRENADE = (1<<24)

#define set_flood(%1,%2)    (%1 |= (1<<(%2&31)))
#define clear_flood(%1,%2)    (%1 &= ~(1<<(%2&31)))
#define get_flood(%1,%2)    (%1 & (1<<(%2&31)))

#if MODE & (1<<0) || MODE & (1<<1)
new amx_password_field_string[30]
#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
new g_hour_flags
new g_hour
#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
new g_team[33]
#endif
#if MODE == 3
new g_vip_buy_time
new g_vip_cost_ammo
new g_vip_buy_flags
#endif
new const MAXCLIP[] = { -113, -11017, -130301302025303525122010301008303020273030, -150 }
static const 
CONTACT[] = ""
new g_jumpsg_allow_jumpg_armorg_killammog_infectammog_infecthealthg_nemhealthg_show_vips,
g_unlimited_clipg_fall_damageg_damage_rewardg_damage_increaseg_happy_hourg_happy_hour_fragg_happy_hour_ammo
new happy_hour_on
new g_bit
new chache_g_jumps
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_Post"1)
    
RegisterHam(Ham_TakeDamage"player""fw_TakeDamage")
    
register_event("ResetHUD""HUDReset""be")
    
register_event("HLTV""chache_cvars""a""1=0""2=0")
    
    
maxplayers get_maxplayers()
    
g_msgSayText get_user_msgid("SayText")
    
    
register_message(get_user_msgid("CurWeapon"), "message_cur_weapon")
    
    
g_jumps register_cvar("zp_vip_jumps""1")
    
g_allow_jump register_cvar("zp_vip_allow_jump""ab")
    
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_fall_damage register_cvar("zp_vip_no_fall_damage""1")
    
g_damage_reward register_cvar("zp_vip_damage_reward""500")
    
g_damage_increase register_cvar("zp_vip_damage_increase""1.5")
    
g_happy_hour register_cvar("zp_vip_happy_hour""off")
    
g_happy_hour_frag register_cvar("zp_vip_happy_hour_frag""1")
    
g_happy_hour_ammo register_cvar("zp_vip_happy_hour_ammo""1")
    
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_stringcharsmax(amx_password_field_string))
    
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)
    
g_hour register_cvar("zp_vip_hour""off")
    
g_hour_flags register_cvar("zp_vip_hour_flags""abe")
    
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")
    
    new 
temp[31]
    
formatex(temp30"%L"LANG_SERVER"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)
}

public 
chache_cvars() {
    
    static 
string[5]
    
get_pcvar_string(g_allow_jumpstringcharsmax(string))
    
g_bit read_flags(string)
    
chache_g_jumps get_pcvar_num(g_jumps)
    
    static 
hours[6], hour1s[3], hour2s[3], hour1hour2hms
    get_pcvar_string
(g_happy_hourhourscharsmax(hours))
        
    if(
equal(hours"off")) {happy_hour_on false; return; }
        
    
strtok(hourshour1scharsmax(hour1s), hour2scharsmax(hour2s), '-')
    
hour1 str_to_num(hour1s)
    
hour2 str_to_num(hour2s)
        
    
time(hms)
    if(
hour1 <= <= hour2happy_hour_on true
    
else happy_hour_on false
}
#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(!
is_user_alive(id)) return HAM_IGNORED;
#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_Post(victimattacker) {
#if MODE & (1<<0)
    
if(<= attacker <= maxplayers && g_user_privileges[attacker] & FLAG_A) {
#else
    
if(<= attacker <= maxplayers && get_user_flags(attacker) & VIPACCES) {
#endif    
        
if(is_user_alive(attacker) && zp_get_user_zombie(attacker) && !(zp_get_user_nemesis(attacker) && get_pcvar_num(g_nemhealth))) set_user_health(attacker, (get_user_health(attacker) + get_pcvar_num(g_infecthealth)))
        
zp_set_user_ammo_packs(attackerzp_get_user_ammo_packs(attacker) + get_pcvar_num(g_killammo))
        
        if(
happy_hour_on) {
            
            static 
fragammo
            frag 
get_pcvar_num(g_happy_hour_frag)
            
ammo get_pcvar_num(g_happy_hour_ammo)
            
            if(
fragset_user_frags(attackerget_user_frags(attacker)+frag)
            if(
ammozp_set_user_ammo_packs(attackerzp_get_user_ammo_packs(attacker)+ammo)
        }
            
    }
}

public 
fw_TakeDamage(victiminflictorattackerFloat:damagedamage_type) {
    
    if(
victim == attacker)
        return 
HAM_IGNORED
        
    
if(damage_type DMG_HEGRENADE)
        return 
HAM_IGNORED
    
#if MODE & (1<<0)
    
if(g_user_privileges[victim] & FLAG_A) {
#else
    
if(get_user_flags(victim) & VIPACCES) {
#endif
        
if(damage_type DMG_FALL && get_pcvar_num(g_fall_damage))
            return 
HAM_SUPERCEDE;
    }
    
    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
        
damage *= get_pcvar_float(g_damage_increase)
        
SetHamParamFloat(4damage)
    }
    
#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] > get_pcvar_float(g_damage_reward)) {
                
zp_set_user_ammo_packs(attackerzp_get_user_ammo_packs(attacker)+1)
                
g_damage[attacker] -= get_pcvar_float(g_damage_reward)
            }
        }    
    }

    return 
HAM_IGNORED
}

public 
zp_user_infected_post(idinfectornemesis) {
    
    
setVip()
    if(!(
1<=infector<=maxplayers)) return;
    
#if MODE & (1<<0)
    
if(g_user_privileges[infector] & FLAG_A) {
#else
    
if(get_user_flags(infector) & VIPACCES) {
#endif
        
if(is_user_alive(infector)) set_user_health(infector, (get_user_health(infector) + get_pcvar_num(g_infecthealth)))
        
zp_set_user_ammo_packs(infectorzp_get_user_ammo_packs(infector) + get_pcvar_num(g_infectammo))
        
        if(
happy_hour_on) {
            
            static 
fragammo
            frag 
get_pcvar_num(g_happy_hour_frag)
            
ammo get_pcvar_num(g_happy_hour_ammo)
            
            if(
fragset_user_frags(infectorget_user_frags(infector)+frag)
            if(
ammozp_set_user_ammo_packs(infectorzp_get_user_ammo_packs(infector)+ammo)
        }
    }    
}

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<<0)
    
else {
        static 
hours[6], hour1s[3], hour2s[3], hour1hour2hms
        get_pcvar_string
(g_hourhourscharsmax(hours))
        
        if(
equal(hours"off")) return;
        
        
strtok(hourshour1scharsmax(hour1s), hour2scharsmax(hour2s), '-')
        
hour1 str_to_num(hour1s)
        
hour2 str_to_num(hour2s)
        
        
time(hms)
        if(
hour1 <= <= hour2) {
            
            new 
fflags[10]
            
get_pcvar_string(g_hour_flagsfflagscharsmax(fflags))
            
g_user_privileges[id] = read_flags(fflags)
        }
    }
#endif
}
#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(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;
    }
    new 
holder[150], menu
    formatex
(holdercharsmax(holder), "\r%L"id"MENU_TOP")
    
menu menu_create(holder"vip_menu_handler")
    new 
iteam_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
    g_team
[id] = team_check
    
for(i=0g_registered_items_counti++) {
        
ArrayGetArray(items_databaseiextra_items)
        if(
extra_items[i_team] == || g_team[id] & extra_items[i_team]) {
            
formatex(holdercharsmax(holder), "%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(menuholdernum0)
            
check++
        }
    }
    if(
check == 0) {
        
client_printcolor(id"/g%s /y%L"CHAT_PREFIXid"NO_ITEMS")
        return;
    }
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
formatex(holdercharsmax(holder), "%L"id"NEXT")
    
menu_setprop(menuMPROP_NEXTNAMEholder)
    
formatex(holdercharsmax(holder), "%L"id"BACK")
    
menu_setprop(menuMPROP_BACKNAMEholder)
    
formatex(holdercharsmax(holder), "%L"id"EXIT")
    
menu_setprop(menuMPROP_EXITNAMEholder)
    
menu_display(idmenu0)
}
 
public 
vip_menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    
    if(
g_team[id] & FLAG_A && (!zp_get_user_zombie(id) || zp_get_user_nemesis(id))) return PLUGIN_HANDLED
    
else if(g_team[id] & FLAG_B && zp_get_user_zombie(id)) return PLUGIN_HANDLED
    
else if(g_team[id] & FLAG_C && !zp_get_user_nemesis(id)) return PLUGIN_HANDLED
    
else if(g_team[id] & FLAG_D && !zp_get_user_survivor(id)) return PLUGIN_HANDLED
    
    
new data[6], iName[64], item_idammo_packs
    
new aaccesscallback
    menu_item_getinfo
(menuitemaaccessdata,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_closevip_menu(id)
    
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
}
#endif
#if MODE & (1<<0) && MODE & (1<<1)
public buy_meniu(id)
{
    new 
holder[150], menu
    formatex
(holdercharsmax(holder), "\r%L"id"BUY_MENU_TOP"get_pcvar_num(g_vip_cost_ammo), get_pcvar_num(g_vip_buy_time))
    
menu menu_create(holder"buy_menu_handler")
    new 
callback menu_makecallback("_menu_callback")
    
formatex(holdercharsmax(holder), "%L"id"BUY_MENU_TYPE1")
    
menu_additem(menuholder)
    
formatex(holdercharsmax(holder), "%L"id"BUY_MENU_TYPE2")
    
menu_additem(menuholder__callback)
    
formatex(holdercharsmax(holder), "%L"id"BUY_MENU_TYPE3")
    
menu_additem(menuholder)
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL)
    
formatex(holdercharsmax(holder), "%L"id"EXIT")
    
menu_setprop(menuMPROP_EXITNAMEholder)
    
menu_display(idmenu0)
}
 
public 
buy_menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT )
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}

    new 
ammo_packs zp_get_user_ammo_packs(id)
    if(
item 0) {
        if(
ammo_packs >= get_pcvar_num(g_vip_cost_ammo)) {
            
amx_tempadmin(iditem)
            
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[20]
    
get_user_info(idamx_password_field_stringclient_passwordcharsmax(client_password))
    
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)
    
formatex(menu_item80"%L"id"NICK_BUY_MENU_TYPE2")
    
menu_additem(menumenu_item)
    
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)
    
    
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
    
}

    switch(
item) {
        case 
0: {
            
generate_password(id)
            
set_task(0.2"menu_delay"id)
        }
        case 
1nick_buy_meniu_sec(id)
        case 
2: {
            
            new 
ammo_packs zp_get_user_ammo_packs(id)
            if(
ammo_packs >= get_pcvar_num(g_vip_cost_ammo)) {
                
amx_tempadmin(id0)
                
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)
            
            
menu_destroy(menu)
            return 
PLUGIN_HANDLED
        
}
    }
    
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED
}
public 
nick_buy_meniu_sec(id)
{
    new 
holder[150], menu
    formatex
(holdercharsmax(holder), "\r%L"id"NICK_BUY_MENU_SEC_TOP")
    
menu menu_create(holder"nick_buy_menu_sec_handler")
    
    
formatex(holdercharsmax(holder), "%L"id"BACK")
    
menu_additem(menuholder)
    
    
menu_setprop(menuMPROP_EXITMEXIT_NEVER)
    
menu_display(idmenu0)
}
 
public 
nick_buy_menu_sec_handler(idmenuitem)
{
    
nick_buy_meniu(id)
    
menu_destroy(menu)
    return 
PLUGIN_HANDLED;
}

public 
_menu_callback(idmenuitem) {
    
    if(
item == 1) {
        new 
authid[30]
        
get_user_authid(idauthidcharsmax(authid))
        if(
equal(authid"STEAM_0"7)) return ITEM_ENABLED
        
else return ITEM_DISABLED
    
}
    
    return 
ITEM_ENABLED
}

public 
menu_delay(idnick_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 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
    
static nbutobutfflags
    nbut
get_user_button(id)
    
obut get_user_oldbutton(id)
    
fflags get_entity_flags(id)
    
    if((
nbut IN_JUMP) && !(fflags FL_ONGROUND) && !(obut IN_JUMP))
    {
        if(
jumpnum[id] < chache_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) && (fflags 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)
    {
        static 
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 
holder[20]
    new 
y,d
    date
(ymd)
    
format(holdercharsmax(holder), "m%dd%dy%d"mdy)

    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(textholder) != -
        {
            
DeleteLine(configfile1i)
        }
    }
    return 
PLUGIN_HANDLED
}

public 
amx_tempadmin(idtype)
{    
    new 
authid[31], ip[31], name[51], client_password[20], p_flags[21], sdate[20]
    
get_pcvar_string(g_vip_buy_flagsp_flagscharsmax(p_flags))
    
get_user_authid(idauthidcharsmax(authid))
    
get_user_ip(idipcharsmax(ip), 1)
    
get_user_name(idnamecharsmax(name))
    
get_user_info(idamx_password_field_stringclient_passwordcharsmax(client_password))
    
    
get_date(get_pcvar_num(g_vip_buy_time), sdatecharsmax(sdate))
    
    new 
holder[200]
    switch(
type) {
        case 
0formatex(holdercharsmax(holder), "^"%s^" ^"%s^" ^"%s^" ^"b^"; Exp: %s"nameclient_passwordp_flagssdate)
        case 
1formatex(holdercharsmax(holder), "^"%s^" ^"^" ^"%s^" ^"ce^"; Exp: %s"authidp_flagssdate)
        case 
2formatex(holdercharsmax(holder), "^"%s^" ^"^" ^"%s^" ^"de^"; Exp: %s"ipp_flagssdate)
    }
    
    new 
configdir[200]
    
get_configsdir(configdir199)
    new 
configfile1[200]
    
format(configfile1,199,"%s/vips.ini",configdir)
    
write_file(configfile1holder, -1)
    
server_cmd("amx_reloadvips")
    
set_task(1.0"set_flags"id)
    
}

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 );
    }
}

stock get_date(daysstring[], chars) {
    
    new 
ymd
    date
(y,d)
    
    
d+=days
    
    
new go true
    
while(go) {
        switch(
m) {
            case 
1,357810: {
                if(
d>31) { d=d-31m++; }
                else 
go false
            
}
            case 
2: {
                if(
d>28) { d=d-28m++; }
                else 
go false
            
}
            case 
46911: {
                if(
d>30) { d=d-30m++; }
                else 
go false
            
}
            case 
12: {
                if(
d>31) { d=d-31y++; m=1; }
                else 
go false
            
}
        }
    }
    
formatex(stringchars"m%dd%dy%d"m,y)
}
#endif

stock client_printcolor(id, const message[], any:...)
{
    static 
buffer[512], argscount
    argscount 
numargs()
    
    if (!
id) {
        
        static 
players[32], numplayerii2
        get_players
(playersnum "ch")
            
        for (
0numi++) {
            
            
player players[i]
            
            static 
changed[5], changedcount
            changedcount 
0
            
            
for (i2 2i2 argscounti2++)
            {
                if (
getarg(i2) == LANG_PLAYER)
                {
                    
setarg(i20player)
                    
changed[changedcount] = i2
                    changedcount
++
                }
            }
            
            
vformat(buffercharsmax(buffer), message3)
            
            
replace_all(buffercharsmax(buffer), "/g""^4")
            
replace_all(buffercharsmax(buffer), "/y""^1")
        
            
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_player)
            
write_byte(player)
            
write_string(buffer)
            
message_end()
            
            for (
i2 0i2 changedcounti2++)
                
setarg(changed[i2], 0LANG_PLAYER)
        }
    }
    else {
        
        
vformat(buffercharsmax(buffer), message3)
        
        
replace_all(buffercharsmax(buffer), "/g""^4")
        
replace_all(buffercharsmax(buffer), "/y""^1")
        
        
message_begin(MSG_ONE_UNRELIABLEg_msgSayText_id)
        
write_byte(id)
        
write_string(buffer)
        
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[30], sizelog_flags[11]
    
get_user_authid(idauthid30)
    
get_user_ip(idip301)
    
get_user_name(idname50)
    
get_user_info(idamx_password_field_stringclient_passwordcharsmax(client_password))
    
    
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[30]
    
formatex(password_holdercharsmax(password_holder), "%d%d%d%d%d"random(10), random(10), random(10), random(10), random(10))
    
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)
{
        if(!
items_databaseitems_database ArrayCreate(items)
        
        
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
}

public 
plugin_end() if(items_databaseArrayDestroy(items_database)
#endif 
edon1337 is offline
mhamed123
Member
Join Date: Aug 2016
Old 09-04-2016 , 19:11   Re: Zp sma file help
Reply With Quote #6

i dont unterstand this guys help pls
mhamed123 is offline
Reply



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 13:28.


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