Ultimate VIP Features

Unpaid Requests, Public Plugins
User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 620
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

Re: Ultimate VIP Features

#11

Post by Spir0x » 3 Weeks Ago

Guys, so who can tell me what's the problem on those codes ? give us a solution please.
I trynna make money, not friends.

User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 576
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 47 times
Age: 19
Contact:

#12

Post by Jack GamePlay » 3 Weeks Ago

Add

Code: Select all

#include <zombie_escape>
Before

Code: Select all

#include <ze_vip>
Not interested in CS/Pawn anymore.
Accepting web projects.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 620
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#13

Post by Spir0x » 3 Weeks Ago

OK, I removed norecoil, antidote, leap, trail, now vip menu contains only 4 things.

1. Knife Menu
2. Guns Menu
3. Glow Menu
4. Daily Golds

Knife menu, and glow menu already compiled fine. still (daily golds and lycanthrope won't compile)

Daily Golds:

Code: Select all

#include <zombie_escape>
#include <ze_vip>
 
#define NV_NAME "GET_GOLDS"
#define VIP_ACCESS ADMIN_LEVEL_H
 
enum player_struct {
    mtime,bool:ftime,key[64]
}
new g_player[33][player_struct];
 
new cvar_save_type,cvar_time,cvar_coins;
 
public plugin_natives()
{
    register_plugin("ze_get_free_golds", "native_ze_get_free_golds", 1)
}
 
public native_ze_get_free_golds(id)
{
    if (!is_user_connected(id))
        return -1
 
    cmd_coins(id)
    return true
}
 
public plugin_init() {
 
    register_plugin("Get Escape Golds", "1.0", "ZE DEV TEAM");
   
    cvar_save_type = register_cvar("get_golds_save_type","1"); // how to save data 1 by authid, 2 by ip or 3 by name
    cvar_time = register_cvar("get_golds_minutes","720"); // time in minutes, 720minutes=12hours it will be auto calculated
    cvar_coins = register_cvar("get_golds_coins","200"); // how many coins to give
}
       
public cmd_coins(id) {
 
    new nv = nvault_open(NV_NAME);
   
    if(nv == INVALID_HANDLE) {
        ze_colored_print(id, "!tFor the moment getting golds system is inactive..");
        return;
    }
   
    new txt_min[32],txt_coins[10];
    new coins = get_pcvar_num(cvar_coins),pminutes = get_pcvar_num(cvar_time);
    copy(txt_coins,charsmax(txt_coins),(coins==1)?"coin":"coins");
    build_time(pminutes,txt_min,charsmax(txt_min));
   
    if(g_player[id][ftime]) {
        ze_colored_print(id, "!tYou have received !g%d !tGolds!y, !tget another in !g%s!y!",coins,txt_min);
        ze_set_escape_coins(id, ze_get_escape_coins(id) + coins);
        g_player[id][ftime]=false;
        nvault_touch(nv,g_player[id][key],g_player[id][mtime]=get_systime());
        return;
    }
   
    new user_time=get_systime()-g_player[id][mtime];
    new diff_min=(user_time<(pminutes*60))?pminutes-(user_time/60):pminutes;
    build_time(diff_min,txt_min,charsmax(txt_min));
   
    if(user_time>=(pminutes*60)) {
        ze_colored_print(id, "!tYou have just received !g%d !tGolds!y, !tsince !g%s !tpassed!y!",coins,txt_min);
        ze_set_escape_coins(id, ze_get_escape_coins(id) + coins);  
        nvault_touch(nv,g_player[id][key],g_player[id][mtime]=get_systime());
    }
    else
        ze_colored_print(id, "!tRetry again in !g%s !tfor getting !g%d !tmore Golds!y.",txt_min,coins);
       
    nvault_close(nv);
}
 
public client_putinserver(id) {
       
    new nv,data[32];
    get_auth(id,g_player[id][key],charsmax(g_player[][key]));
    g_player[id][mtime]=get_systime();
    g_player[id][ftime]=false;
    formatex(data,charsmax(data),"%d",g_player[id][mtime]);
   
    if((nv=nvault_open(NV_NAME))==INVALID_HANDLE)
        return;
   
    if(!nvault_lookup(nv,g_player[id][key],data,charsmax(data),g_player[id][mtime])) {
        nvault_set(nv,g_player[id][key],data);
        g_player[id][ftime]=true;
    }
   
    nvault_close(nv);
}    
 
public client_disconnected(id) {
   
    g_player[id][mtime]=0;
    g_player[id][ftime]=false;
}
 
stock get_auth(id,data[],len)
    switch(get_pcvar_num(cvar_save_type)) {
        case 1: get_user_authid(id,data,len);
        case 2: get_user_ip(id,data,len,1);
        case 3: get_user_name(id,data,len);
    }
 
stock build_time(pminutes,data[],len)
    if(pminutes==1)
        copy(data,len,"1 minute");
    else if(pminutes!=1&&pminutes<60)
        formatex(data,len,"%d minutes",pminutes);
    else if(pminutes==60)
        copy(data,len,"1 hour");
    else {
        new ptime=pminutes/60;
        if(ptime*60==pminutes)
            formatex(data,len,"%d %s",ptime,(ptime==1)?"hour":"hours");
        else {
            new diff=pminutes-ptime*60;
            formatex(data,len,"%d %s and %d %s",ptime,(ptime==1)?"hour":"hours",diff,(diff==1)?"minute":"minutes");
        }
    }
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/
Lycanthrope:

Code: Select all

#include <zombie_escape>
#include <ze_vip>
#include <fakemeta_util>
#include <cstrike>
 
 
#define CSW_WEAPON_BASE CSW_P90
#define CSW_NEW_WEAPON  "weapon_lycanthrope"
#define CSW_OLD_WEAPON  "weapon_p90"
#define WEAPON_KEY  9299292
#define OLD_WEAPON  "models/w_p90.mdl"
#define is_user_valid(%1) (is_user_alive(%1) && !is_user_bot(%1) && !is_user_hltv(%1) && is_user_connected(%1))
#define VIP_ACCESS ADMIN_LEVEL_H
 
new const Weapon_Models[][] = { "models/Premuim_ZE/v_lycanthrope.mdl", "models/Premuim_ZE/p_lycanthrope.mdl", "models/Premuim_ZE/w_lycanthrope.mdl" }
new const Weapon_Sounds[][] = { "weapons/sg552-shot1.wav", "weapons/sg552-shot2.wav", "weapons/buffsg552_draw.wav", "weapons/buffsg552_idle.wav", "weapons/buffsg552_reload.wav", "weapons/buffsg552_reload_AF.wav" }
new const Weapon_Sprites[][] = { "sprites/weapon_lycanthrope.txt", "sprites/640hud148.spr" }
new const GUNSHOT_DECALS[] = { 41, 42, 43, 44, 45 }
 
new bool:g_Hasscope[33], g_hasZoom[33]
new Cvar_scope_Recoil, Cvar_scope_DMG, Cvar_scope_Clip, Cvar_scope_Ammo, Cvar_scope_Speed
new Float:cl_pushangle[33][3], g_Eventscope, g_scope_TmpClip[33], g_IsInPrimaryAttack, g_Shock
 
public plugin_natives()
{
    register_native("ze_give_lycanthrope", "native_ze_give_lycanthrope", 1)
}
 
public native_ze_give_lycanthrope(id)
{
    if (!is_user_connected(id))
        return -1
 
    Givescope(id)
    return true
}
 
public plugin_precache()
{
    for(new g = 0; g < sizeof(Weapon_Models); g++)
        precache_model(Weapon_Models[g])
    for(new h = 0; h < sizeof(Weapon_Sounds); h++)
        precache_sound(Weapon_Sounds[h])
    for(new t = 0; t < sizeof(Weapon_Sprites); t++)
        precache_generic(Weapon_Sprites[t])
       
    g_Shock = precache_model("sprites/lycanthrope_hit.spr")
       
    register_clcmd(CSW_NEW_WEAPON, "hook")
    register_forward(FM_PrecacheEvent, "Fw_Precache_Event", 1)
}
 
public hook(id)
{
    engclient_cmd(id, CSW_OLD_WEAPON)
    return PLUGIN_HANDLED
}
 
public plugin_init()
{
    register_plugin("[ZE] Extra Item: Lycanthrope", "1.0", "Jack GamePlay")
   
    // Events & Messages
    register_message(get_user_msgid("DeathMsg"), "DeathMsg")
    register_event("CurWeapon", "CurrentWeapon", "be", "1=1")
    register_event("HLTV", "New_Round", "a", "1=0", "2=0")
   
    // Forwards
    register_forward(FM_SetModel, "Fw_Set_Model", 1)
    register_forward(FM_PlaybackEvent, "Fw_Playback_Event")
    register_forward(FM_UpdateClientData, "Fw_Update_Clientdata", 1)
    register_forward(FM_CmdStart, "Fw_CmdStart")
   
    // Hook Chains
    RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_Take_DMG")
    // Hams
    RegisterHam(Ham_Weapon_PrimaryAttack, CSW_OLD_WEAPON, "Fw_PrimaryAttack")
    RegisterHam(Ham_Weapon_PrimaryAttack, CSW_OLD_WEAPON, "Fw_PrimaryAttack_Post", 1)
    RegisterHam(Ham_Item_AddToPlayer, CSW_OLD_WEAPON, "Fw_AddToPlayer")
    RegisterHam(Ham_Weapon_Reload, CSW_OLD_WEAPON, "Fw_Reload")
    RegisterHam(Ham_Weapon_Reload, CSW_OLD_WEAPON, "Fw_Reload_Post", 1)
    RegisterHam(Ham_Spawn, "player", "Fw_Spawn", 1)
    RegisterHam(Ham_TraceAttack, "worldspawn", "Fw_TraceAttack", 1)
    RegisterHam(Ham_TraceAttack, "func_breakable", "Fw_TraceAttack", 1)
    RegisterHam(Ham_TraceAttack, "func_wall", "Fw_TraceAttack", 1)
    RegisterHam(Ham_TraceAttack, "func_door", "Fw_TraceAttack", 1)
    RegisterHam(Ham_TraceAttack, "func_door_rotating", "Fw_TraceAttack", 1)
    RegisterHam(Ham_TraceAttack, "func_plat", "Fw_TraceAttack", 1)
    RegisterHam(Ham_TraceAttack, "func_rotating", "Fw_TraceAttack", 1)
    RegisterHam(Ham_Use, "func_tank", "Fw_UseStationary_Post", 1)
    RegisterHam(Ham_Use, "func_tankmortar", "Fw_UseStationary_Post", 1)
    RegisterHam(Ham_Use, "func_tankrocket", "Fw_UseStationary_Post", 1)
    RegisterHam(Ham_Use, "func_tanklaser", "Fw_UseStationary_Post", 1)
    RegisterHam(Ham_Item_Deploy, CSW_OLD_WEAPON, "Fw_Item_Deploy_Post", 1)
   
    // Cvars
    Cvar_scope_Recoil = register_cvar("ze_scope_recoil", "1.0")
    Cvar_scope_DMG = register_cvar("ze_scope_damage", "6")
    Cvar_scope_Clip = register_cvar("ze_scope_clip", "30")
    Cvar_scope_Ammo = register_cvar("ze_scope_ammo", "150")
    Cvar_scope_Speed = register_cvar("ze_scope_speed", "4.5")
}
 
public Fw_Item_Deploy_Post(weapon_ent)
{
    new id = get_pdata_cbase(weapon_ent, 41, 4)
    g_hasZoom[id] = false
    cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
    CurrentWeapon(id)
}
 
public Fw_UseStationary_Post(entity, caller, activator, use_type)
{
    if (use_type == 0 && is_user_valid(caller))
    {
        CurrentWeapon(caller)
    }
}
 
public Fw_TraceAttack(iEnt, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType)
{
    if(!is_user_valid(iAttacker))
        return
   
    static Float:flEnd[3]
    get_tr2(ptr, TR_vecEndPos, flEnd)
   
    if(get_user_weapon(iAttacker) == CSW_WEAPON_BASE && g_Hasscope[iAttacker])
    {
        if(iEnt)
        {
            message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
            write_byte(TE_DECAL)
            engfunc(EngFunc_WriteCoord, flEnd[0])
            engfunc(EngFunc_WriteCoord, flEnd[1])
            engfunc(EngFunc_WriteCoord, flEnd[2])
            write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
            write_short(iEnt)
            message_end()
        }
        else
        {
            message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
            write_byte(TE_WORLDDECAL)
            engfunc(EngFunc_WriteCoord, flEnd[0])
            engfunc(EngFunc_WriteCoord, flEnd[1])
            engfunc(EngFunc_WriteCoord, flEnd[2])
            write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
            message_end()
        }
        message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
        write_byte(TE_GUNSHOTDECAL)
        engfunc(EngFunc_WriteCoord, flEnd[0])
        engfunc(EngFunc_WriteCoord, flEnd[1])
        engfunc(EngFunc_WriteCoord, flEnd[2])
        write_short(iAttacker)
        write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
        message_end()
       
        engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flEnd, 0)
        write_byte(TE_SPRITE)
        engfunc(EngFunc_WriteCoord, flEnd[0])
        engfunc(EngFunc_WriteCoord, flEnd[1])
        engfunc(EngFunc_WriteCoord, flEnd[2])
        write_short(g_Shock)
        write_byte(5)
        write_byte(150)
        message_end()
    }
}
 
public Fw_Spawn(id)
{
    if(!is_user_valid(id))
        return
       
    Remove_scope(id)
}
 
public New_Round()
{
    for(new i = 0; i < get_member_game(m_nMaxPlayers); i++)
    {
        if(!is_user_valid(i) || !g_Hasscope[i])
            continue
           
        Remove_scope(i)
    }
}
 
public Fw_Reload_Post(weapon_entity)
{
    new id = pev(weapon_entity, pev_owner)
    if (!is_user_valid(id) || ze_is_user_zombie(id) || g_scope_TmpClip[id] == -1)
        return HAM_IGNORED
       
    if(g_Hasscope[id])
    {
        g_hasZoom[id] = false
        cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
        set_pdata_int(weapon_entity, 51, g_scope_TmpClip[id], 4)
        set_pdata_float(weapon_entity, 48, 3.0, 4)
        set_pdata_float(id, 83, 3.0, 5)
        set_pdata_int(weapon_entity, 54, 1, 4)
        UTIL_weapon_anim(id, weapon_entity, 1)
    }
    return HAM_IGNORED
}
 
public Fw_Reload(weapon_entity)
{
    new id = pev(weapon_entity, pev_owner)
    if (!is_user_valid(id) || ze_is_user_zombie(id))
        return HAM_IGNORED
 
    static iClipExtra
    if(g_Hasscope[id])
    {
        iClipExtra = get_pcvar_num(Cvar_scope_Clip)
    }
 
    g_scope_TmpClip[id] = -1
   
    new iBpAmmo = cs_get_user_bpammo(id, CSW_WEAPON_BASE)
    new iClip = get_pdata_int(weapon_entity, 51, 4)
 
    if (iBpAmmo <= 0 || iClip >= iClipExtra)
        return HAM_SUPERCEDE
       
    g_scope_TmpClip[id] = iClip
 
    return HAM_IGNORED
}
 
public Fw_AddToPlayer(ent, id)
{
    if(!is_valid_ent(ent) || !is_user_valid(id) || ze_is_user_zombie(id))
        return HAM_IGNORED
   
    if(entity_get_int(ent, EV_INT_impulse) == WEAPON_KEY)
    {
        g_Hasscope[id] = true
        g_hasZoom[id] = false
        cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
        entity_set_int(ent, EV_INT_impulse, 0)
       
        message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
        write_string(CSW_NEW_WEAPON)
        write_byte(7)
        write_byte(100)
        write_byte(-1)
        write_byte(-1)
        write_byte(0)
        write_byte(8)
        write_byte(CSW_WEAPON_BASE)
        write_byte(0)
        message_end()
        return HAM_HANDLED
    }
    else
    {
        message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
        write_string(CSW_OLD_WEAPON)
        write_byte(7)
        write_byte(100)
        write_byte(-1)
        write_byte(-1)
        write_byte(0)
        write_byte(8)
        write_byte(CSW_WEAPON_BASE)
        write_byte(0)
        message_end()
    }
    return HAM_IGNORED
}
 
public Fw_Precache_Event(type, const name[])
{
    if(equal("events/p90.sc", name))
    {
        g_Eventscope = get_orig_retval()
    }
}
 
public Fw_Update_Clientdata(id, sendweapons, cd_handle)
{
    if(!is_user_valid(id))
        return
 
    if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id])
    {
        set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.001)
    }
}
 
public Fw_Playback_Event(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
{
    if(!is_user_valid(invoker) || !g_IsInPrimaryAttack)
        return
   
    if(eventid == g_Eventscope && get_user_weapon(invoker) == CSW_WEAPON_BASE && g_Hasscope[invoker])
    {
        engfunc(EngFunc_PlaybackEvent, flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2)
        UTIL_weapon_anim(invoker, eventid, random_num(3, 5))
        emit_sound(invoker, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
    }
}
 
public ze_user_humanized(id)
{
    if(!is_user_valid(id))
        return
       
    Remove_scope(id)
}
 
public ze_user_infected(id, infector)
{
    if(!is_user_valid(id))
        return
       
    Remove_scope(id)
}
 
public Fw_PrimaryAttack(Weapon)
{
    g_IsInPrimaryAttack = 0
   
    new szClip, szAmmo, id
    id = get_pdata_cbase(Weapon, 41, 4)
    get_user_weapon(id, szClip, szAmmo)
    if(!is_user_valid(id) || ze_is_user_zombie(id))
        return
 
    g_IsInPrimaryAttack = 1
    if(g_Hasscope[id])
    {
        if (!cs_get_weapon_ammo(Weapon))
            return
 
        new Float:push[3]
        pev(id, pev_punchangle, push)
        xs_vec_sub(push, cl_pushangle[id], push)
        xs_vec_mul_scalar(push, get_pcvar_float(Cvar_scope_Recoil), push)
        xs_vec_add(push, cl_pushangle[id], push)
        set_pev(id, pev_punchangle, push)
        UTIL_weapon_anim(id, Weapon, random_num(3, 5))
        emit_sound(id, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
    }
}
 
public Fw_CmdStart(id, handle)
{
    if(!is_user_valid(id) || ze_is_user_zombie(id))
        return
       
    if((get_uc(handle, UC_Buttons) & IN_ATTACK2) && !(pev(id, pev_oldbuttons) & IN_ATTACK2))
    {
        if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id] && !g_hasZoom[id])
        {
            g_hasZoom[id] = true
            cs_set_user_zoom(id, CS_SET_FIRST_ZOOM, 0)
        }
        else if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id] && g_hasZoom[id])
        {
            g_hasZoom[id] = false
            cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
        }
    }
}
 
public Fw_Take_DMG(Victim, Inflictor, Attacker, Float:Damage, DamageType)
{
    if(!is_user_valid(Victim) || !is_user_valid(Attacker) ||ze_is_user_zombie(Attacker))
        return
   
    if(get_user_weapon(Attacker) == CSW_WEAPON_BASE && g_Hasscope[Attacker])
    {
        SetHamParamFloat(4, Damage * get_pcvar_float(Cvar_scope_DMG))
    }
}
 
public Fw_PrimaryAttack_Post(Weapon)
{
    g_IsInPrimaryAttack = 0
    new szClip, szAmmo, id
    id = get_pdata_cbase(Weapon, 41, 4)
    get_user_weapon(id, szClip, szAmmo)
   
    if(!is_user_valid(id) || ze_is_user_zombie(id))
        return
 
    if(g_Hasscope[id])
    {
        if (!cs_get_weapon_ammo(Weapon))
            return
 
        new Float:push[3]
        pev(id, pev_punchangle, push)
        xs_vec_sub(push, cl_pushangle[id], push)
        xs_vec_mul_scalar(push, get_pcvar_float(Cvar_scope_Recoil), push)
        xs_vec_add(push, cl_pushangle[id], push)
        set_pev(id, pev_punchangle, push)
        UTIL_weapon_anim(id, Weapon, random_num(3, 5))
        emit_sound(id, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
    }
}
 
public Fw_Set_Model(entity, model[])
{
    if(!pev_valid(entity) || !equal(model, OLD_WEAPON))
        return FMRES_IGNORED
   
    static szClassName[33], id
    id = pev(entity, pev_owner)
    pev(entity, pev_classname, szClassName, charsmax(szClassName))
    if(!equal(szClassName, "weaponbox"))
        return FMRES_IGNORED
   
    if(g_Hasscope[id] && pev_valid(fm_find_ent_by_owner(-1, CSW_OLD_WEAPON, entity)))
    {
        g_Hasscope[id] = false
        g_hasZoom[id] = false
        cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
        set_pev(fm_find_ent_by_owner(-1, CSW_OLD_WEAPON, entity), pev_impulse, WEAPON_KEY)
        engfunc(EngFunc_SetModel, entity, Weapon_Models[2])
        return FMRES_SUPERCEDE
    }
    return FMRES_IGNORED
}
 
public CurrentWeapon(id)
{
    if(!is_user_valid(id))
        return
       
    if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id])
    {
        if(g_hasZoom[id])
        {
            cs_set_player_view_model(id, CSW_WEAPON_BASE, "")
        }
        else if(!g_hasZoom[id])
        {
            cs_set_player_view_model(id, CSW_WEAPON_BASE, Weapon_Models[0])
        }
        cs_set_player_weap_model(id, CSW_WEAPON_BASE, Weapon_Models[1])
       
        message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
        write_string(CSW_NEW_WEAPON)
        write_byte(7)
        write_byte(100)
        write_byte(-1)
        write_byte(-1)
        write_byte(0)
        write_byte(8)
        write_byte(CSW_WEAPON_BASE)
        write_byte(0)
        message_end()
       
        static Float:iSpeed; iSpeed = get_pcvar_float(Cvar_scope_Speed)
        static Ent; Ent = find_ent_by_owner(-1, CSW_OLD_WEAPON, id)
        if(Ent)
        {
            static Float:Delay; Delay = get_pdata_float( Ent, 46, 4) * iSpeed
            if (Delay > 0.0)
            {
                set_pdata_float(Ent, 46, Delay, 4)
            }
        }
    }
}
 
public DeathMsg(msg_id, msg_dest, id)
{
    static szTruncatedWeapon[33], iAttacker, iVictim
    get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))
   
    iAttacker = get_msg_arg_int(1)
    iVictim = get_msg_arg_int(2)
   
    if(!is_user_valid(iAttacker) || iAttacker == iVictim)   return
   
    if(equal(szTruncatedWeapon, "p90") && get_user_weapon(iAttacker) == CSW_WEAPON_BASE && g_Hasscope[iAttacker])
    {
        set_msg_arg_string(4, "lycanthrope")
    }
}
 
public Givescope(id)
{
    drop_weapons(id, 1)
    new wep = rg_give_item(id, CSW_OLD_WEAPON)
    if (wep > 0)
    {
        cs_set_weapon_ammo(wep, get_pcvar_num(Cvar_scope_Clip))
        cs_set_user_bpammo(id, CSW_WEAPON_BASE, get_pcvar_num(Cvar_scope_Ammo))
       
        message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
        write_string(CSW_NEW_WEAPON)
        write_byte(7)
        write_byte(100)
        write_byte(-1)
        write_byte(-1)
        write_byte(0)
        write_byte(8)
        write_byte(CSW_WEAPON_BASE)
        write_byte(0)
        message_end()
    }
    g_Hasscope[id] = true
    g_hasZoom[id] = false
    cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
    UTIL_weapon_anim(id, CSW_WEAPON_BASE, 2)
    ze_colored_print(id, "!tYou bought Lycanthrope!y.")
}
 
public Remove_scope(id)
{
    if(!is_user_valid(id))
        return
       
    g_Hasscope[id] = false
    g_hasZoom[id] = false
    cs_set_user_zoom(id, CS_SET_NO_ZOOM, 0)
    message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
    write_string(CSW_OLD_WEAPON)
    write_byte(7)
    write_byte(100)
    write_byte(-1)
    write_byte(-1)
    write_byte(0)
    write_byte(8)
    write_byte(CSW_WEAPON_BASE)
    write_byte(0)
    message_end()
    cs_reset_player_view_model(id, CSW_WEAPON_BASE)
    cs_reset_player_weap_model(id, CSW_WEAPON_BASE)
}
 
UTIL_weapon_anim(index, entity, sequence = 0)
{
    set_pev(index, pev_weaponanim, sequence)
 
    message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, index)
    write_byte(sequence)
    write_byte(pev(entity, pev_body))
    message_end()
}
 
stock drop_weapons(id, dropwhat)
{
    static weapons[32], num, i, weaponid
    num = 0
    get_user_weapons(id, weapons, num)
   
    const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_MAC10)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_MAC10)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
   
    for (i = 0; i < num; i++)
    {
        weaponid = weapons[i]
       
        if (dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
        {
            static wname[32]
            get_weaponname(weaponid, wname, charsmax(wname))
            engclient_cmd(id, "drop", wname)
        }
    }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1036{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
VIP Menu (Final):

Code: Select all

#include <zombie_escape>
#include <ze_vip>
 
native ze_open_glow_menu(id)
native ze_give_lycanthrope(id)
native ze_give_infinity(id)
native ze_give_free_golds(id)
 
const OFFSET_CSMENUCODE = 205
const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
 
public plugin_natives()
{
    register_native("ze_open_vip_menu", "native_ze_open_vip_menu", 1)
}
 
public native_ze_open_vip_menu(id)
{
    if (!is_user_connected(id))
        return -1
 
    if (!(get_user_flags(id) & ADMIN_LEVEL_H))
        return false
 
    Show_Menu(id)
    return true
}
 
public plugin_init()
{
    register_plugin("[ZE] VIP Menu", "1.0", "Spi")
    register_menu("VIP Menu", KEYSMENU, "Main_Menu")
}
 
public Show_Menu(id)
{
    static szMenu[250]
    new iLen
   
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\rVIP Menu^n")
   
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\y1\d. \wKnife Menu")
   
    if (is_user_alive(id))
    {
        iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\y2\d. \wGuns Menu")
    }
    else
    {
        iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\d2. Guns Menu")
    }
 
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\y3\d. \wGlow Menu")
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\y4\d. \wDaily Golds")
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\y0\d. \r%L", id, "EXIT")
   
    set_pdata_int(id, OFFSET_CSMENUCODE, 0)
    show_menu(id, KEYSMENU, szMenu, -1, "Main Menu")
}
 
public Main_Menu(id, key)
{
    if (!is_user_connected(id))
        return PLUGIN_HANDLED
   
    switch (key)
    {
        case 0: ze_open_knife_menu(id)
        case 1:
        {
            if (is_user_alive(id))
            {
                    Open_HGunMenu(id)
            }
            else
            {
                ze_colored_print(id, "%L", id, "DEAD_CANT_BUY_WEAPON")
            }
        }
        case 2: ze_open_glow_menu(id)
        case 3: ze_give_free_golds(id)
    }
    return PLUGIN_HANDLED
}
 
public Open_ZGunMenu(id)
{
    new iMenu = menu_create("\rDaily Golds:^n^n", "ZVIPMenu_Handler")
 
    menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)
    menu_display(id, iMenu, 0)
}
 
public ZVIPMenu_Handler(id, iMenu, iItem)
{
    if (!is_user_connected(id))
        return PLUGIN_CONTINUE
 
    switch (iItem)
    {
        case 0: ze_give_free_golds(id)
    }
   
    menu_destroy(iMenu)
    return PLUGIN_HANDLED
}
  
public Open_HGunMenu(id)
{
    new iMenu = menu_create("\rGuns Menu:^n^n", "HVIPMenu_Handler")
    menu_additem(iMenu, "Lycanthrope")
    menu_additem(iMenu, "Dual Infinity")
 
    menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)
    menu_display(id, iMenu, 0)
}
 
public HVIPMenu_Handler(id, iMenu, iItem)
{
    if (!is_user_connected(id))
        return PLUGIN_CONTINUE
 
    switch (iItem)
    {
        case 0: ze_give_lycanthrope(id)
        case 1: ze_give_infinity(id)
    }
   
    menu_destroy(iMenu)
    return PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1036{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
NOTE: Please add chat message to players who press VIP Menu and they don't have access for it.
!tYou are not !gVIP!y!
I trynna make money, not friends.

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 187
Joined: 2 Years Ago
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#14

Post by sPe3doN » 3 Weeks Ago

Lycanthrope:

Code: Select all

#include <zombie_escape>
#include <ze_vip>
#include <fakemeta_util>
#include <cstrike>
#include <engine>

 
 
#define CSW_WEAPON_BASE CSW_P90
#define CSW_NEW_WEAPON  "weapon_lycanthrope"
#define CSW_OLD_WEAPON  "weapon_p90"
#define WEAPON_KEY  9299292
#define OLD_WEAPON  "models/w_p90.mdl"
#define is_user_valid(%1) (is_user_alive(%1) && !is_user_bot(%1) && !is_user_hltv(%1) && is_user_connected(%1))
#define VIP_ACCESS ADMIN_LEVEL_H
 
new const Weapon_Models[][] = { "models/Premuim_ZE/v_lycanthrope.mdl", "models/Premuim_ZE/p_lycanthrope.mdl", "models/Premuim_ZE/w_lycanthrope.mdl" }
new const Weapon_Sounds[][] = { "weapons/sg552-shot1.wav", "weapons/sg552-shot2.wav", "weapons/buffsg552_draw.wav", "weapons/buffsg552_idle.wav", "weapons/buffsg552_reload.wav", "weapons/buffsg552_reload_AF.wav" }
new const Weapon_Sprites[][] = { "sprites/weapon_lycanthrope.txt", "sprites/640hud148.spr" }
new const GUNSHOT_DECALS[] = { 41, 42, 43, 44, 45 }
 
new bool:g_Hasscope[33], g_hasZoom[33]
new Cvar_scope_Recoil, Cvar_scope_DMG, Cvar_scope_Clip, Cvar_scope_Ammo, Cvar_scope_Speed
new Float:cl_pushangle[33][3], g_Eventscope, g_scope_TmpClip[33], g_IsInPrimaryAttack, g_Shock
 
public plugin_natives()
{
    register_native("ze_give_lycanthrope", "native_ze_give_lycanthrope", 1)
}
 
public native_ze_give_lycanthrope(id)
{
    if (!is_user_connected(id))
        return -1
 
    Givescope(id)
    return true
}
 
public plugin_precache()
{
    for(new g = 0; g < sizeof(Weapon_Models); g++)
        precache_model(Weapon_Models[g])
    for(new h = 0; h < sizeof(Weapon_Sounds); h++)
        precache_sound(Weapon_Sounds[h])
    for(new t = 0; t < sizeof(Weapon_Sprites); t++)
        precache_generic(Weapon_Sprites[t])
       
    g_Shock = precache_model("sprites/lycanthrope_hit.spr")
       
    register_clcmd(CSW_NEW_WEAPON, "hook")
    register_forward(FM_PrecacheEvent, "Fw_Precache_Event", 1)
}
 
public hook(id)
{
    engclient_cmd(id, CSW_OLD_WEAPON)
    return PLUGIN_HANDLED
}
 
public plugin_init()
{
    register_plugin("[ZE] Extra Item: Lycanthrope", "1.0", "Jack GamePlay")
   
    // Events & Messages
    register_message(get_user_msgid("DeathMsg"), "DeathMsg")
    register_event("CurWeapon", "CurrentWeapon", "be", "1=1")
    register_event("HLTV", "New_Round", "a", "1=0", "2=0")
   
    // Forwards
    register_forward(FM_SetModel, "Fw_Set_Model", 1)
    register_forward(FM_PlaybackEvent, "Fw_Playback_Event")
    register_forward(FM_UpdateClientData, "Fw_Update_Clientdata", 1)
    register_forward(FM_CmdStart, "Fw_CmdStart")
   
    // Hook Chains
    RegisterHookChain(RG_CBasePlayer_TakeDamage, "Fw_Take_DMG")
    // Hams
    RegisterHam(Ham_Weapon_PrimaryAttack, CSW_OLD_WEAPON, "Fw_PrimaryAttack")
    RegisterHam(Ham_Weapon_PrimaryAttack, CSW_OLD_WEAPON, "Fw_PrimaryAttack_Post", 1)
    RegisterHam(Ham_Item_AddToPlayer, CSW_OLD_WEAPON, "Fw_AddToPlayer")
    RegisterHam(Ham_Weapon_Reload, CSW_OLD_WEAPON, "Fw_Reload")
    RegisterHam(Ham_Weapon_Reload, CSW_OLD_WEAPON, "Fw_Reload_Post", 1)
    RegisterHam(Ham_Spawn, "player", "Fw_Spawn", 1)
    RegisterHam(Ham_TraceAttack, "worldspawn", "Fw_TraceAttack", 1)
    RegisterHam(Ham_TraceAttack, "func_breakable", "Fw_TraceAttack", 1)
    RegisterHam(Ham_TraceAttack, "func_wall", "Fw_TraceAttack", 1)
    RegisterHam(Ham_TraceAttack, "func_door", "Fw_TraceAttack", 1)
    RegisterHam(Ham_TraceAttack, "func_door_rotating", "Fw_TraceAttack", 1)
    RegisterHam(Ham_TraceAttack, "func_plat", "Fw_TraceAttack", 1)
    RegisterHam(Ham_TraceAttack, "func_rotating", "Fw_TraceAttack", 1)
    RegisterHam(Ham_Use, "func_tank", "Fw_UseStationary_Post", 1)
    RegisterHam(Ham_Use, "func_tankmortar", "Fw_UseStationary_Post", 1)
    RegisterHam(Ham_Use, "func_tankrocket", "Fw_UseStationary_Post", 1)
    RegisterHam(Ham_Use, "func_tanklaser", "Fw_UseStationary_Post", 1)
    RegisterHam(Ham_Item_Deploy, CSW_OLD_WEAPON, "Fw_Item_Deploy_Post", 1)
   
    // Cvars
    Cvar_scope_Recoil = register_cvar("ze_scope_recoil", "1.0")
    Cvar_scope_DMG = register_cvar("ze_scope_damage", "6")
    Cvar_scope_Clip = register_cvar("ze_scope_clip", "30")
    Cvar_scope_Ammo = register_cvar("ze_scope_ammo", "150")
    Cvar_scope_Speed = register_cvar("ze_scope_speed", "4.5")
}
 
public Fw_Item_Deploy_Post(weapon_ent)
{
    new id = get_pdata_cbase(weapon_ent, 41, 4)
    g_hasZoom[id] = false
    cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
    CurrentWeapon(id)
}
 
public Fw_UseStationary_Post(entity, caller, activator, use_type)
{
    if (use_type == 0 && is_user_valid(caller))
    {
        CurrentWeapon(caller)
    }
}
 
public Fw_TraceAttack(iEnt, iAttacker, Float:flDamage, Float:fDir[3], ptr, iDamageType)
{
    if(!is_user_valid(iAttacker))
        return
   
    static Float:flEnd[3]
    get_tr2(ptr, TR_vecEndPos, flEnd)
   
    if(get_user_weapon(iAttacker) == CSW_WEAPON_BASE && g_Hasscope[iAttacker])
    {
        if(iEnt)
        {
            message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
            write_byte(TE_DECAL)
            engfunc(EngFunc_WriteCoord, flEnd[0])
            engfunc(EngFunc_WriteCoord, flEnd[1])
            engfunc(EngFunc_WriteCoord, flEnd[2])
            write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
            write_short(iEnt)
            message_end()
        }
        else
        {
            message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
            write_byte(TE_WORLDDECAL)
            engfunc(EngFunc_WriteCoord, flEnd[0])
            engfunc(EngFunc_WriteCoord, flEnd[1])
            engfunc(EngFunc_WriteCoord, flEnd[2])
            write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
            message_end()
        }
        message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
        write_byte(TE_GUNSHOTDECAL)
        engfunc(EngFunc_WriteCoord, flEnd[0])
        engfunc(EngFunc_WriteCoord, flEnd[1])
        engfunc(EngFunc_WriteCoord, flEnd[2])
        write_short(iAttacker)
        write_byte(GUNSHOT_DECALS[random_num (0, sizeof GUNSHOT_DECALS -1)])
        message_end()
       
        engfunc(EngFunc_MessageBegin, MSG_PVS, SVC_TEMPENTITY, flEnd, 0)
        write_byte(TE_SPRITE)
        engfunc(EngFunc_WriteCoord, flEnd[0])
        engfunc(EngFunc_WriteCoord, flEnd[1])
        engfunc(EngFunc_WriteCoord, flEnd[2])
        write_short(g_Shock)
        write_byte(5)
        write_byte(150)
        message_end()
    }
}
 
public Fw_Spawn(id)
{
    if(!is_user_valid(id))
        return
       
    Remove_scope(id)
}
 
public New_Round()
{
    for(new i = 0; i < get_member_game(m_nMaxPlayers); i++)
    {
        if(!is_user_valid(i) || !g_Hasscope[i])
            continue
           
        Remove_scope(i)
    }
}
 
public Fw_Reload_Post(weapon_entity)
{
    new id = pev(weapon_entity, pev_owner)
    if (!is_user_valid(id) || ze_is_user_zombie(id) || g_scope_TmpClip[id] == -1)
        return HAM_IGNORED
       
    if(g_Hasscope[id])
    {
        g_hasZoom[id] = false
        cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
        set_pdata_int(weapon_entity, 51, g_scope_TmpClip[id], 4)
        set_pdata_float(weapon_entity, 48, 3.0, 4)
        set_pdata_float(id, 83, 3.0, 5)
        set_pdata_int(weapon_entity, 54, 1, 4)
        UTIL_weapon_anim(id, weapon_entity, 1)
    }
    return HAM_IGNORED
}
 
public Fw_Reload(weapon_entity)
{
    new id = pev(weapon_entity, pev_owner)
    if (!is_user_valid(id) || ze_is_user_zombie(id))
        return HAM_IGNORED
 
    static iClipExtra
    if(g_Hasscope[id])
    {
        iClipExtra = get_pcvar_num(Cvar_scope_Clip)
    }
 
    g_scope_TmpClip[id] = -1
   
    new iBpAmmo = cs_get_user_bpammo(id, CSW_WEAPON_BASE)
    new iClip = get_pdata_int(weapon_entity, 51, 4)
 
    if (iBpAmmo <= 0 || iClip >= iClipExtra)
        return HAM_SUPERCEDE
       
    g_scope_TmpClip[id] = iClip
 
    return HAM_IGNORED
}
 
public Fw_AddToPlayer(ent, id)
{
    if(!is_valid_ent(ent) || !is_user_valid(id) || ze_is_user_zombie(id))
        return HAM_IGNORED
   
    if(entity_get_int(ent, EV_INT_impulse) == WEAPON_KEY)
    {
        g_Hasscope[id] = true
        g_hasZoom[id] = false
        cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
        entity_set_int(ent, EV_INT_impulse, 0)
       
        message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
        write_string(CSW_NEW_WEAPON)
        write_byte(7)
        write_byte(100)
        write_byte(-1)
        write_byte(-1)
        write_byte(0)
        write_byte(8)
        write_byte(CSW_WEAPON_BASE)
        write_byte(0)
        message_end()
        return HAM_HANDLED
    }
    else
    {
        message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
        write_string(CSW_OLD_WEAPON)
        write_byte(7)
        write_byte(100)
        write_byte(-1)
        write_byte(-1)
        write_byte(0)
        write_byte(8)
        write_byte(CSW_WEAPON_BASE)
        write_byte(0)
        message_end()
    }
    return HAM_IGNORED
}
 
public Fw_Precache_Event(type, const name[])
{
    if(equal("events/p90.sc", name))
    {
        g_Eventscope = get_orig_retval()
    }
}
 
public Fw_Update_Clientdata(id, sendweapons, cd_handle)
{
    if(!is_user_valid(id))
        return
 
    if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id])
    {
        set_cd(cd_handle, CD_flNextAttack, halflife_time() + 0.001)
    }
}
 
public Fw_Playback_Event(flags, invoker, eventid, Float:delay, Float:origin[3], Float:angles[3], Float:fparam1, Float:fparam2, iParam1, iParam2, bParam1, bParam2)
{
    if(!is_user_valid(invoker) || !g_IsInPrimaryAttack)
        return
   
    if(eventid == g_Eventscope && get_user_weapon(invoker) == CSW_WEAPON_BASE && g_Hasscope[invoker])
    {
        engfunc(EngFunc_PlaybackEvent, flags | FEV_HOSTONLY, invoker, eventid, delay, origin, angles, fparam1, fparam2, iParam1, iParam2, bParam1, bParam2)
        UTIL_weapon_anim(invoker, eventid, random_num(3, 5))
        emit_sound(invoker, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
    }
}
 
public ze_user_humanized(id)
{
    if(!is_user_valid(id))
        return
       
    Remove_scope(id)
}
 
public ze_user_infected(id, infector)
{
    if(!is_user_valid(id))
        return
       
    Remove_scope(id)
}
 
public Fw_PrimaryAttack(Weapon)
{
    g_IsInPrimaryAttack = 0
   
    new szClip, szAmmo, id
    id = get_pdata_cbase(Weapon, 41, 4)
    get_user_weapon(id, szClip, szAmmo)
    if(!is_user_valid(id) || ze_is_user_zombie(id))
        return
 
    g_IsInPrimaryAttack = 1
    if(g_Hasscope[id])
    {
        if (!cs_get_weapon_ammo(Weapon))
            return
 
        new Float:push[3]
        pev(id, pev_punchangle, push)
        xs_vec_sub(push, cl_pushangle[id], push)
        xs_vec_mul_scalar(push, get_pcvar_float(Cvar_scope_Recoil), push)
        xs_vec_add(push, cl_pushangle[id], push)
        set_pev(id, pev_punchangle, push)
        UTIL_weapon_anim(id, Weapon, random_num(3, 5))
        emit_sound(id, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
    }
}
 
public Fw_CmdStart(id, handle)
{
    if(!is_user_valid(id) || ze_is_user_zombie(id))
        return
       
    if((get_uc(handle, UC_Buttons) & IN_ATTACK2) && !(pev(id, pev_oldbuttons) & IN_ATTACK2))
    {
        if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id] && !g_hasZoom[id])
        {
            g_hasZoom[id] = true
            cs_set_user_zoom(id, CS_SET_FIRST_ZOOM, 0)
        }
        else if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id] && g_hasZoom[id])
        {
            g_hasZoom[id] = false
            cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
        }
    }
}
 
public Fw_Take_DMG(Victim, Inflictor, Attacker, Float:Damage, DamageType)
{
    if(!is_user_valid(Victim) || !is_user_valid(Attacker) ||ze_is_user_zombie(Attacker))
        return
   
    if(get_user_weapon(Attacker) == CSW_WEAPON_BASE && g_Hasscope[Attacker])
    {
        SetHamParamFloat(4, Damage * get_pcvar_float(Cvar_scope_DMG))
    }
}
 
public Fw_PrimaryAttack_Post(Weapon)
{
    g_IsInPrimaryAttack = 0
    new szClip, szAmmo, id
    id = get_pdata_cbase(Weapon, 41, 4)
    get_user_weapon(id, szClip, szAmmo)
   
    if(!is_user_valid(id) || ze_is_user_zombie(id))
        return
 
    if(g_Hasscope[id])
    {
        if (!cs_get_weapon_ammo(Weapon))
            return
 
        new Float:push[3]
        pev(id, pev_punchangle, push)
        xs_vec_sub(push, cl_pushangle[id], push)
        xs_vec_mul_scalar(push, get_pcvar_float(Cvar_scope_Recoil), push)
        xs_vec_add(push, cl_pushangle[id], push)
        set_pev(id, pev_punchangle, push)
        UTIL_weapon_anim(id, Weapon, random_num(3, 5))
        emit_sound(id, CHAN_WEAPON, Weapon_Sounds[random_num(0, 1)], VOL_NORM, ATTN_NORM, 0, PITCH_NORM)
    }
}
 
public Fw_Set_Model(entity, model[])
{
    if(!pev_valid(entity) || !equal(model, OLD_WEAPON))
        return FMRES_IGNORED
   
    static szClassName[33], id
    id = pev(entity, pev_owner)
    pev(entity, pev_classname, szClassName, charsmax(szClassName))
    if(!equal(szClassName, "weaponbox"))
        return FMRES_IGNORED
   
    if(g_Hasscope[id] && pev_valid(fm_find_ent_by_owner(-1, CSW_OLD_WEAPON, entity)))
    {
        g_Hasscope[id] = false
        g_hasZoom[id] = false
        cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
        set_pev(fm_find_ent_by_owner(-1, CSW_OLD_WEAPON, entity), pev_impulse, WEAPON_KEY)
        engfunc(EngFunc_SetModel, entity, Weapon_Models[2])
        return FMRES_SUPERCEDE
    }
    return FMRES_IGNORED
}
 
public CurrentWeapon(id)
{
    if(!is_user_valid(id))
        return
       
    if(get_user_weapon(id) == CSW_WEAPON_BASE && g_Hasscope[id])
    {
        if(g_hasZoom[id])
        {
            cs_set_player_view_model(id, CSW_WEAPON_BASE, "")
        }
        else if(!g_hasZoom[id])
        {
            cs_set_player_view_model(id, CSW_WEAPON_BASE, Weapon_Models[0])
        }
        cs_set_player_weap_model(id, CSW_WEAPON_BASE, Weapon_Models[1])
       
        message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
        write_string(CSW_NEW_WEAPON)
        write_byte(7)
        write_byte(100)
        write_byte(-1)
        write_byte(-1)
        write_byte(0)
        write_byte(8)
        write_byte(CSW_WEAPON_BASE)
        write_byte(0)
        message_end()
       
        static Float:iSpeed; iSpeed = get_pcvar_float(Cvar_scope_Speed)
        static Ent; Ent = find_ent_by_owner(-1, CSW_OLD_WEAPON, id)
        if(Ent)
        {
            static Float:Delay; Delay = get_pdata_float( Ent, 46, 4) * iSpeed
            if (Delay > 0.0)
            {
                set_pdata_float(Ent, 46, Delay, 4)
            }
        }
    }
}
 
public DeathMsg(msg_id, msg_dest, id)
{
    static szTruncatedWeapon[33], iAttacker, iVictim
    get_msg_arg_string(4, szTruncatedWeapon, charsmax(szTruncatedWeapon))
   
    iAttacker = get_msg_arg_int(1)
    iVictim = get_msg_arg_int(2)
   
    if(!is_user_valid(iAttacker) || iAttacker == iVictim)   return
   
    if(equal(szTruncatedWeapon, "p90") && get_user_weapon(iAttacker) == CSW_WEAPON_BASE && g_Hasscope[iAttacker])
    {
        set_msg_arg_string(4, "lycanthrope")
    }
}
 
public Givescope(id)
{
    drop_weapons(id, 1)
    new wep = rg_give_item(id, CSW_OLD_WEAPON)
    if (wep > 0)
    {
        cs_set_weapon_ammo(wep, get_pcvar_num(Cvar_scope_Clip))
        cs_set_user_bpammo(id, CSW_WEAPON_BASE, get_pcvar_num(Cvar_scope_Ammo))
       
        message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
        write_string(CSW_NEW_WEAPON)
        write_byte(7)
        write_byte(100)
        write_byte(-1)
        write_byte(-1)
        write_byte(0)
        write_byte(8)
        write_byte(CSW_WEAPON_BASE)
        write_byte(0)
        message_end()
    }
    g_Hasscope[id] = true
    g_hasZoom[id] = false
    cs_set_user_zoom(id, CS_RESET_ZOOM, 0)
    UTIL_weapon_anim(id, CSW_WEAPON_BASE, 2)
    ze_colored_print(id, "!tYou bought Lycanthrope!y.")
}
 
public Remove_scope(id)
{
    if(!is_user_valid(id))
        return
       
    g_Hasscope[id] = false
    g_hasZoom[id] = false
    cs_set_user_zoom(id, CS_SET_NO_ZOOM, 0)
    message_begin(MSG_ONE, get_user_msgid("WeaponList"), {0, 0, 0}, id)
    write_string(CSW_OLD_WEAPON)
    write_byte(7)
    write_byte(100)
    write_byte(-1)
    write_byte(-1)
    write_byte(0)
    write_byte(8)
    write_byte(CSW_WEAPON_BASE)
    write_byte(0)
    message_end()
    cs_reset_player_view_model(id, CSW_WEAPON_BASE)
    cs_reset_player_weap_model(id, CSW_WEAPON_BASE)
}
 
UTIL_weapon_anim(index, entity, sequence = 0)
{
    set_pev(index, pev_weaponanim, sequence)
 
    message_begin(MSG_ONE_UNRELIABLE, SVC_WEAPONANIM, {0, 0, 0}, index)
    write_byte(sequence)
    write_byte(pev(entity, pev_body))
    message_end()
}
 
stock drop_weapons(id, dropwhat)
{
    static weapons[32], num, i, weaponid
    num = 0
    get_user_weapons(id, weapons, num)
   
    const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_MAC10)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_MAC10)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)
   
    for (i = 0; i < num; i++)
    {
        weaponid = weapons[i]
       
        if (dropwhat == 1 && ((1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM))
        {
            static wname[32]
            get_weaponname(weaponid, wname, charsmax(wname))
            engclient_cmd(id, "drop", wname)
        }
    }
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1036{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/
vip menu:

Code: Select all

#include <zombie_escape>
#include <ze_vip>
 
native ze_open_glow_menu(id)
native ze_give_lycanthrope(id)
native ze_give_infinity(id)
native ze_give_free_golds(id)
native ze_open_knife_menu(id)

const OFFSET_CSMENUCODE = 205
const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0
 
public plugin_natives()
{
    register_native("ze_open_vip_menu", "native_ze_open_vip_menu", 1)
}
 
public native_ze_open_vip_menu(id)
{
    if (!is_user_connected(id))
        return -1
 
    if (!(get_user_flags(id) & ADMIN_LEVEL_H))
        return false
 
    Show_Menu(id)
    return true
}
 
public plugin_init()
{
    register_plugin("[ZE] VIP Menu", "1.0", "Spi")
    register_menu("VIP Menu", KEYSMENU, "Main_Menu")
}
 
public Show_Menu(id)
{
    static szMenu[250]
    new iLen
   
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\rVIP Menu^n")
   
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\y1\d. \wKnife Menu")
   
    if (is_user_alive(id))
    {
        iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\y2\d. \wGuns Menu")
    }
    else
    {
        iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\d2. Guns Menu")
    }
 
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\y3\d. \wGlow Menu")
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n\y4\d. \wDaily Golds")
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\y0\d. \r%L", id, "EXIT")
   
    set_pdata_int(id, OFFSET_CSMENUCODE, 0)
    show_menu(id, KEYSMENU, szMenu, -1, "Main Menu")
}
 
public Main_Menu(id, key)
{
    if (!(get_user_flags(id) & ADMIN_LEVEL_H))
    {
        ze_colored_print(id, "!tyou are not ^4VIP Member")
        return PLUGIN_HANDLED
    }
    else if (!is_user_connected(id))
        return PLUGIN_HANDLED
   
    switch (key)
    {
        case 0: ze_open_knife_menu(id)
        case 1:
        {
            if (is_user_alive(id))
            {
                    Open_HGunMenu(id)
            }
            else
            {
                ze_colored_print(id, "%L", id, "DEAD_CANT_BUY_WEAPON")
            }
        }
        case 2: ze_open_glow_menu(id)
        case 3: ze_give_free_golds(id)
    }
    return PLUGIN_HANDLED
}
 
public Open_ZGunMenu(id)
{
    new iMenu = menu_create("\rDaily Golds:^n^n", "ZVIPMenu_Handler")
 
    menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)
    menu_display(id, iMenu, 0)
}
 
public ZVIPMenu_Handler(id, iMenu, iItem)
{
    if (!is_user_connected(id))
        return PLUGIN_CONTINUE
 
    switch (iItem)
    {
        case 0: ze_give_free_golds(id)
    }
   
    menu_destroy(iMenu)
    return PLUGIN_HANDLED
}
  
public Open_HGunMenu(id)
{
    new iMenu = menu_create("\rGuns Menu:^n^n", "HVIPMenu_Handler")
    menu_additem(iMenu, "Lycanthrope")
    menu_additem(iMenu, "Dual Infinity")
 
    menu_setprop(iMenu, MPROP_EXIT, MEXIT_ALL)
    menu_display(id, iMenu, 0)
}
 
public HVIPMenu_Handler(id, iMenu, iItem)
{
    if (!is_user_connected(id))
        return PLUGIN_CONTINUE
 
    switch (iItem)
    {
        case 0: ze_give_lycanthrope(id)
        case 1: ze_give_infinity(id)
    }
   
    menu_destroy(iMenu)
    return PLUGIN_HANDLED
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1036{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par }
*/

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 620
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#15

Post by Spir0x » 3 Weeks Ago

Ok bro thanks, but daily golds is missing. there's just 1 error in the code.

and please fix this main menu with the daily golds:

Code: Select all

#include <zombie_escape>
#include <ze_zombie_classes>
#include <ze_vip>



// Keys
const OFFSET_CSMENUCODE = 205
const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0

public plugin_init()
{
	register_plugin("[ZE] Main Menu", ZE_VERSION, AUTHORS)
	
	// Commands
	register_clcmd("chooseteam", "Cmd_ChooseTeam")
	register_clcmd("say /zemenu", "Cmd_ChooseTeam")
	register_clcmd("say_team /zemenu", "Cmd_ChooseTeam")
	
	// Register Menus
	register_menu("Main Menu", KEYSMENU, "Main_Menu")
}

public Cmd_ChooseTeam(id)
{
	if (!is_user_connected(id))
		return PLUGIN_CONTINUE;
	
	if (get_member(id, m_iTeam) == TEAM_TERRORIST || get_member(id, m_iTeam) == TEAM_CT)
	{
		Show_Menu_Main(id)
		return PLUGIN_HANDLED // Kill the Choose Team Command
	}
	
	// Player in Spec? Allow him to open choose team menu so he can join
	return PLUGIN_CONTINUE
}

// Main Menu
public Show_Menu_Main(id)
{
	static szMenu[250]
	new iLen
    
	// Title
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w%L^n^n", id, "MAIN_MENU_TITLE")
	
	// 1. Buy Weapons
	if (!ze_is_auto_buy_enabled(id)) // AutoBuy not enabled - normal case
	{
		if (is_user_alive(id))
		{
			iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y1.\r %L^n", id, "MENU_WEAPONBUY")
		}
		else
		{
			iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d1. %L^n", id, "MENU_WEAPONBUY")
		}
	}
	else
	{
	// Auto-Buy enabled - Re-enable case
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y1.\r %L^n", id, "MENU_WEAPONBUY_RE_ENABLE")
	}
	
	// 2. Extra Items
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y2. \r%L^n", id, "MENU_EXTRABUY")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d2. %L^n", id, "MENU_EXTRABUY")
	}
    
	// 3. Unstuck
	if (is_user_alive(id))
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y3. \r%L^n^n", id, "MENU_UNSTUCK")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d3. %L^n^n", id, "MENU_UNSTUCK")
	}
	
	// 4. Sounds Menu
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y4. \rSounds Menu^n")
	
	// 5. Donate Menu
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y5. \rDonate Menu^n")
	
	// 6. Zombie Classes
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y6. \rZombie Classes^n^n")
	
	// 7. VIP Menu
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y7. \w[ \rVIP Menu \w]^n")
	}
	else
	{
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d7. [ \rVIP Menu \d]^n")
	}
	
	// 8. Admin Menu
	if (get_user_flags(id) & ADMIN_KICK)
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y8. \w[ \rAdmin Menu \w]^n")
	}
	else
	{
		iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d8. [ \rAdmin Menu \d]^n")
	}
	
	// 0. Exit
	iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\y0.\r %L", id, "EXIT")
    
    	// Fix for AMXX custom menus
	set_pdata_int(id, OFFSET_CSMENUCODE, 0)
	show_menu(id, KEYSMENU, szMenu, -1, "Main Menu")
}

// Main Menu
public Main_Menu(id, key)
{
	// Player disconnected?
	if (!is_user_connected(id))
		return PLUGIN_HANDLED
    
	switch (key)
	{
		case 0: // Buy Guns
		{
			if (!ze_is_auto_buy_enabled(id))
			{
				ze_show_weapon_menu(id)
			}
			else
			{
				ze_disable_auto_buy(id)
				Show_Menu_Main(id)
			}
		}
		case 1: // Extra Items
		{
			if (is_user_alive(id))
			{
				ze_show_items_menu(id)
			}
			else
			{
				ze_colored_print(id, "%L", id, "DEAD_CANT_BUY_WEAPON")
			}
		}
		case 2: // Unstuck
		{
			if (is_user_alive(id))
			{
				client_cmd(id, "say /unstuck")
			}
			else
			{
				ze_colored_print(id, "%L", id, "DEAD_CANT_UNSTUCK")
			}
		}
		case 3: // Sounds Menu
		{
			client_cmd(id, "say /sounds")
		}
		case 4: // Donate Menu
		{
			client_cmd(id, "say /donate")
		
		}
		case 5: // Zombie Classes
		{
			ze_open_zombie_classes_menu(id)
		}
		case 6: // VIP Menu 
		{
			ze_open_vip_menu(id)
		}
		case 7: // Admin Menu
		{
			if (get_user_flags(id) & ADMIN_KICK)
			{
				client_cmd(id, "amxmodmenu")
			}
			else
			{
				ze_colored_print(id, "!tYou are not !gAdmin!y.")
			}
		}
	}
	return PLUGIN_HANDLED
}
I trynna make money, not friends.

User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 576
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 47 times
Age: 19
Contact:

#16

Post by Jack GamePlay » 3 Weeks Ago

What is the error you face when you try to compile? Next time post all errors you face!

[ Post made via Android ]
Not interested in CS/Pawn anymore.
Accepting web projects.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 620
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#17

Post by Spir0x » 3 Weeks Ago

ok man just help me to compile these two codes.

Image

Image
I trynna make money, not friends.

User avatar
Jack GamePlay
Mod Developer
Mod Developer
Egypt
Posts: 576
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 47 times
Age: 19
Contact:

#18

Post by Jack GamePlay » 2 Weeks Ago

Daily:

Code: Select all

#include <zombie_escape>
#include <ze_vip>
 
#define NV_NAME "GET_GOLDS"
#define VIP_ACCESS ADMIN_LEVEL_H
 
enum player_struct {
    mtime,bool:ftime,key[64]
}
new g_player[33][player_struct];
 
new cvar_save_type,cvar_time,cvar_coins;
 
public plugin_natives()
{
    register_native("ze_get_free_golds", "native_ze_get_free_golds", 1)
}
 
public native_ze_get_free_golds(id)
{
    if (!is_user_connected(id))
        return -1
 
    cmd_coins(id)
    return true
}
 
public plugin_init() {
 
    register_plugin("Get Escape Golds", "1.0", "ZE DEV TEAM");
   
    cvar_save_type = register_cvar("get_golds_save_type","1"); // how to save data 1 by authid, 2 by ip or 3 by name
    cvar_time = register_cvar("get_golds_minutes","720"); // time in minutes, 720minutes=12hours it will be auto calculated
    cvar_coins = register_cvar("get_golds_coins","200"); // how many coins to give
}
       
public cmd_coins(id) {
 
    new nv = nvault_open(NV_NAME);
   
    if(nv == INVALID_HANDLE) {
        ze_colored_print(id, "!tFor the moment getting golds system is inactive..");
        return;
    }
   
    new txt_min[32],txt_coins[10];
    new coins = get_pcvar_num(cvar_coins),pminutes = get_pcvar_num(cvar_time);
    copy(txt_coins,charsmax(txt_coins),(coins==1)?"coin":"coins");
    build_time(pminutes,txt_min,charsmax(txt_min));
   
    if(g_player[id][ftime]) {
        ze_colored_print(id, "!tYou have received !g%d !tGolds!y, !tget another in !g%s!y!",coins,txt_min);
        ze_set_escape_coins(id, ze_get_escape_coins(id) + coins);
        g_player[id][ftime]=false;
        nvault_touch(nv,g_player[id][key],g_player[id][mtime]=get_systime());
        return;
    }
   
    new user_time=get_systime()-g_player[id][mtime];
    new diff_min=(user_time<(pminutes*60))?pminutes-(user_time/60):pminutes;
    build_time(diff_min,txt_min,charsmax(txt_min));
   
    if(user_time>=(pminutes*60)) {
        ze_colored_print(id, "!tYou have just received !g%d !tGolds!y, !tsince !g%s !tpassed!y!",coins,txt_min);
        ze_set_escape_coins(id, ze_get_escape_coins(id) + coins);  
        nvault_touch(nv,g_player[id][key],g_player[id][mtime]=get_systime());
    }
    else
        ze_colored_print(id, "!tRetry again in !g%s !tfor getting !g%d !tmore Golds!y.",txt_min,coins);
       
    nvault_close(nv);
}
 
public client_putinserver(id) {
       
    new nv,data[32];
    get_auth(id,g_player[id][key],charsmax(g_player[][key]));
    g_player[id][mtime]=get_systime();
    g_player[id][ftime]=false;
    formatex(data,charsmax(data),"%d",g_player[id][mtime]);
   
    if((nv=nvault_open(NV_NAME))==INVALID_HANDLE)
        return;
   
    if(!nvault_lookup(nv,g_player[id][key],data,charsmax(data),g_player[id][mtime])) {
        nvault_set(nv,g_player[id][key],data);
        g_player[id][ftime]=true;
    }
   
    nvault_close(nv);
}    
 
public client_disconnected(id) {
   
    g_player[id][mtime]=0;
    g_player[id][ftime]=false;
}
 
stock get_auth(id,data[],len)
    switch(get_pcvar_num(cvar_save_type)) {
        case 1: get_user_authid(id,data,len);
        case 2: get_user_ip(id,data,len,1);
        case 3: get_user_name(id,data,len);
    }
 
stock build_time(pminutes,data[],len)
    if(pminutes==1)
        copy(data,len,"1 minute");
    else if(pminutes!=1&&pminutes<60)
        formatex(data,len,"%d minutes",pminutes);
    else if(pminutes==60)
        copy(data,len,"1 hour");
    else {
        new ptime=pminutes/60;
        if(ptime*60==pminutes)
            formatex(data,len,"%d %s",ptime,(ptime==1)?"hour":"hours");
        else {
            new diff=pminutes-ptime*60;
            formatex(data,len,"%d %s and %d %s",ptime,(ptime==1)?"hour":"hours",diff,(diff==1)?"minute":"minutes");
        }
    }
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/

Menu:

Code: Select all

#include <zombie_escape>
#include <ze_zombie_classes>
#include <ze_vip>



// Keys
const OFFSET_CSMENUCODE = 205
const KEYSMENU = MENU_KEY_1|MENU_KEY_2|MENU_KEY_3|MENU_KEY_4|MENU_KEY_5|MENU_KEY_6|MENU_KEY_7|MENU_KEY_8|MENU_KEY_9|MENU_KEY_0

public plugin_init()
{
    register_plugin("[ZE] Main Menu", ZE_VERSION, AUTHORS)
    
    // Commands
    register_clcmd("chooseteam", "Cmd_ChooseTeam")
    register_clcmd("say /zemenu", "Cmd_ChooseTeam")
    register_clcmd("say_team /zemenu", "Cmd_ChooseTeam")
    
    // Register Menus
    register_menu("Main Menu", KEYSMENU, "Main_Menu")
}

public Cmd_ChooseTeam(id)
{
    if (!is_user_connected(id))
        return PLUGIN_CONTINUE;
    
    if (get_member(id, m_iTeam) == TEAM_TERRORIST || get_member(id, m_iTeam) == TEAM_CT)
    {
        Show_Menu_Main(id)
        return PLUGIN_HANDLED // Kill the Choose Team Command
    }
    
    // Player in Spec? Allow him to open choose team menu so he can join
    return PLUGIN_CONTINUE
}

// Main Menu
public Show_Menu_Main(id)
{
    static szMenu[250]
    new iLen
    
    // Title
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w%L^n^n", id, "MAIN_MENU_TITLE")
    
    // 1. Buy Weapons
    if (!ze_is_auto_buy_enabled(id)) // AutoBuy not enabled - normal case
    {
        if (is_user_alive(id))
        {
            iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y1.\r %L^n", id, "MENU_WEAPONBUY")
        }
        else
        {
            iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d1. %L^n", id, "MENU_WEAPONBUY")
        }
    }
    else
    {
    // Auto-Buy enabled - Re-enable case
        iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y1.\r %L^n", id, "MENU_WEAPONBUY_RE_ENABLE")
    }
    
    // 2. Extra Items
    if (is_user_alive(id))
    {
        iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y2. \r%L^n", id, "MENU_EXTRABUY")
    }
    else
    {
        iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d2. %L^n", id, "MENU_EXTRABUY")
    }
    
    // 3. Unstuck
    if (is_user_alive(id))
    {
        iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y3. \r%L^n^n", id, "MENU_UNSTUCK")
    }
    else
    {
        iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d3. %L^n^n", id, "MENU_UNSTUCK")
    }
    
    // 4. Sounds Menu
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y4. \rSounds Menu^n")
    
    // 5. Donate Menu
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y5. \rDonate Menu^n")
    
    // 6. Zombie Classes
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y6. \rZombie Classes^n^n")
    
    // 7. VIP Menu
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y7. \w[ \rVIP Menu \w]^n")
    
    // 8. Admin Menu
    if (get_user_flags(id) & ADMIN_KICK)
    {
        iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\y8. \w[ \rAdmin Menu \w]^n")
    }
    else
    {
        iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d8. [ \rAdmin Menu \d]^n")
    }
    
    // 0. Exit
    iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\y0.\r %L", id, "EXIT")
    
        // Fix for AMXX custom menus
    set_pdata_int(id, OFFSET_CSMENUCODE, 0)
    show_menu(id, KEYSMENU, szMenu, -1, "Main Menu")
}

// Main Menu
public Main_Menu(id, key)
{
    // Player disconnected?
    if (!is_user_connected(id))
        return PLUGIN_HANDLED
    
    switch (key)
    {
        case 0: // Buy Guns
        {
            if (!ze_is_auto_buy_enabled(id))
            {
                ze_show_weapon_menu(id)
            }
            else
            {
                ze_disable_auto_buy(id)
                Show_Menu_Main(id)
            }
        }
        case 1: // Extra Items
        {
            if (is_user_alive(id))
            {
                ze_show_items_menu(id)
            }
            else
            {
                ze_colored_print(id, "%L", id, "DEAD_CANT_BUY_WEAPON")
            }
        }
        case 2: // Unstuck
        {
            if (is_user_alive(id))
            {
                client_cmd(id, "say /unstuck")
            }
            else
            {
                ze_colored_print(id, "%L", id, "DEAD_CANT_UNSTUCK")
            }
        }
        case 3: // Sounds Menu
        {
            client_cmd(id, "say /sounds")
        }
        case 4: // Donate Menu
        {
            client_cmd(id, "say /donate")
        
        }
        case 5: // Zombie Classes
        {
            ze_open_zombie_classes_menu(id)
        }
        case 6: // VIP Menu 
        {
            ze_open_vip_menu(id)
        }
        case 7: // Admin Menu
        {
            if (get_user_flags(id) & ADMIN_KICK)
            {
                client_cmd(id, "amxmodmenu")
            }
            else
            {
                ze_colored_print(id, "!tYou are not !gAdmin!y.")
            }
        }
    }
    return PLUGIN_HANDLED
}
Not interested in CS/Pawn anymore.
Accepting web projects.

User avatar
Spir0x
Veteran Member
Veteran Member
Tunisia
Posts: 620
Joined: 2 Years Ago
Location: Tunisia
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#19

Post by Spir0x » 2 Weeks Ago

compiled but see here, the two plugins won't even work on the server when i type "M" choosing team menu appears.

Image
I trynna make money, not friends.

User avatar
sPe3doN
Senior Member
Senior Member
Algeria
Posts: 187
Joined: 2 Years Ago
Has thanked: 14 times
Been thanked: 7 times
Age: 19
Contact:

#20

Post by sPe3doN » 2 Weeks Ago

Spir0x wrote:
2 Weeks Ago
compiled but see here, the two plugins won't even work on the server when i type "M" choosing team menu appears.

Image
vip menu daiyl golds native was

Code: Select all

ze_give_free_golds
and native on daiyl golds plugin was

Code: Select all

ze_get_free_golds
try now
Daily golds:

Code: Select all

#include <zombie_escape>
#include <ze_vip>
 
#define NV_NAME "GET_GOLDS"
#define VIP_ACCESS ADMIN_LEVEL_H
 
enum player_struct {
    mtime,bool:ftime,key[64]
}
new g_player[33][player_struct];
 
new cvar_save_type,cvar_time,cvar_coins;
 
public plugin_natives()
{
    register_native("ze_give_free_golds", "native_ze_give_free_golds", 1)
}
 
public native_ze_give_free_golds(id)
{
    if (!is_user_connected(id))
        return -1
 
    cmd_coins(id)
    return true
}
 
public plugin_init() {
 
    register_plugin("Get Escape Golds", "1.0", "ZE DEV TEAM");
   
    cvar_save_type = register_cvar("get_golds_save_type","1"); // how to save data 1 by authid, 2 by ip or 3 by name
    cvar_time = register_cvar("get_golds_minutes","720"); // time in minutes, 720minutes=12hours it will be auto calculated
    cvar_coins = register_cvar("get_golds_coins","200"); // how many coins to give
}
       
public cmd_coins(id) {
 
    new nv = nvault_open(NV_NAME);
   
    if(nv == INVALID_HANDLE) {
        ze_colored_print(id, "!tFor the moment getting golds system is inactive..");
        return;
    }
   
    new txt_min[32],txt_coins[10];
    new coins = get_pcvar_num(cvar_coins),pminutes = get_pcvar_num(cvar_time);
    copy(txt_coins,charsmax(txt_coins),(coins==1)?"coin":"coins");
    build_time(pminutes,txt_min,charsmax(txt_min));
   
    if(g_player[id][ftime]) {
        ze_colored_print(id, "!tYou have received !g%d !tGolds!y, !tget another in !g%s!y!",coins,txt_min);
        ze_set_escape_coins(id, ze_get_escape_coins(id) + coins);
        g_player[id][ftime]=false;
        nvault_touch(nv,g_player[id][key],g_player[id][mtime]=get_systime());
        return;
    }
   
    new user_time=get_systime()-g_player[id][mtime];
    new diff_min=(user_time<(pminutes*60))?pminutes-(user_time/60):pminutes;
    build_time(diff_min,txt_min,charsmax(txt_min));
   
    if(user_time>=(pminutes*60)) {
        ze_colored_print(id, "!tYou have just received !g%d !tGolds!y, !tsince !g%s !tpassed!y!",coins,txt_min);
        ze_set_escape_coins(id, ze_get_escape_coins(id) + coins);  
        nvault_touch(nv,g_player[id][key],g_player[id][mtime]=get_systime());
    }
    else
        ze_colored_print(id, "!tRetry again in !g%s !tfor getting !g%d !tmore Golds!y.",txt_min,coins);
       
    nvault_close(nv);
}
 
public client_putinserver(id) {
       
    new nv,data[32];
    get_auth(id,g_player[id][key],charsmax(g_player[][key]));
    g_player[id][mtime]=get_systime();
    g_player[id][ftime]=false;
    formatex(data,charsmax(data),"%d",g_player[id][mtime]);
   
    if((nv=nvault_open(NV_NAME))==INVALID_HANDLE)
        return;
   
    if(!nvault_lookup(nv,g_player[id][key],data,charsmax(data),g_player[id][mtime])) {
        nvault_set(nv,g_player[id][key],data);
        g_player[id][ftime]=true;
    }
   
    nvault_close(nv);
}    
 
public client_disconnected(id) {
   
    g_player[id][mtime]=0;
    g_player[id][ftime]=false;
}
 
stock get_auth(id,data[],len)
    switch(get_pcvar_num(cvar_save_type)) {
        case 1: get_user_authid(id,data,len);
        case 2: get_user_ip(id,data,len,1);
        case 3: get_user_name(id,data,len);
    }
 
stock build_time(pminutes,data[],len)
    if(pminutes==1)
        copy(data,len,"1 minute");
    else if(pminutes!=1&&pminutes<60)
        formatex(data,len,"%d minutes",pminutes);
    else if(pminutes==60)
        copy(data,len,"1 hour");
    else {
        new ptime=pminutes/60;
        if(ptime*60==pminutes)
            formatex(data,len,"%d %s",ptime,(ptime==1)?"hour":"hours");
        else {
            new diff=pminutes-ptime*60;
            formatex(data,len,"%d %s and %d %s",ptime,(ptime==1)?"hour":"hours",diff,(diff==1)?"minute":"minutes");
        }
    }
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1036\\ f0\\ fs16 \n\\ par }
*/

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest