I create nemesis plugin but not work [Help]

Coding Help/Re-API Supported
User avatar
lizoumapper
Senior Member
Senior Member
Morocco
Posts: 150
Joined: 10 Months Ago
Location: Morocco
Has thanked: 3 times
Been thanked: 7 times
Age: 17
Contact:

Re: I create nemesis plugin but not work [Help]

#11

Post by lizoumapper » 2 Months Ago

Mohamed Alaa wrote:
2 Months Ago
What is exactly not working?
Provide your logs.
Not Thing in Logs
!?
I Love Learn Languages Programmations

User avatar
Muhammet20
Veteran Member
Veteran Member
Syria
Posts: 401
Joined: 1 Year Ago
Location: Turkey
Has thanked: 36 times
Been thanked: 5 times
Age: 13
Contact:

#12

Post by Muhammet20 » 2 Months Ago

wtf xd, man have you tested it really or no? i saying for lizou
try to test it with real persons, not bots
.::Kaya Gaming || Never Give Up || Zombie Escape::. [Server is Under The Work]
https://kaya-gaming.ga/

I just believe in two things, First thing is who i see in the mirror, second thing is who i don't see in the sky.

User avatar
lizoumapper
Senior Member
Senior Member
Morocco
Posts: 150
Joined: 10 Months Ago
Location: Morocco
Has thanked: 3 times
Been thanked: 7 times
Age: 17
Contact:

#13

Post by lizoumapper » 2 Months Ago

Muhammet20 wrote:
2 Months Ago
wtf xd, man have you tested it really or no? i saying for lizou
try to test it with real persons, not bots
i test true player (human) not bot -_-
I Love Learn Languages Programmations

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 622
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#14

Post by Mohamed Alaa » 2 Months Ago

I have updated my code.
viewtopic.php?p=10593#p10593
Want your own mod edition? PM me.
Accepting web projects.
CS 1.6 hosting: powergamingtech.com

User avatar
lizoumapper
Senior Member
Senior Member
Morocco
Posts: 150
Joined: 10 Months Ago
Location: Morocco
Has thanked: 3 times
Been thanked: 7 times
Age: 17
Contact:

#15

Post by lizoumapper » 2 Months Ago

Mohamed Alaa wrote:
2 Months Ago
I have updated my code.
viewtopic.php?p=10593#p10593
ok thanks
i can test it bescause my server is expired !!!
I Love Learn Languages Programmations

User avatar
lizoumapper
Senior Member
Senior Member
Morocco
Posts: 150
Joined: 10 Months Ago
Location: Morocco
Has thanked: 3 times
Been thanked: 7 times
Age: 17
Contact:

#16

Post by lizoumapper » 2 Months Ago

Mohamed Alaa wrote:
2 Months Ago
I have updated my code.
viewtopic.php?p=10593#p10593
ok thanks
i can test it bescause my server is expired !!!
I Love Learn Languages Programmations

karan
Mod Tester
Mod Tester
India
Posts: 60
Joined: 2 Years Ago
Location: India
Has thanked: 1 time
Been thanked: 3 times
Age: 22
Contact:

#17

Post by karan » 2 Months Ago

Mohamed Alaa wrote:
2 Months Ago
I have updated my code.
viewtopic.php?p=10593#p10593
now its working but if i uncomment models ;this error accuring while compiling the plugin
//AMXXPC compile.exe
// by the AMX Mod X Dev Team


//// ze_nemesis_round.sma
//
// C:\Users\karan\Desktop\ze 1.5\scripting\ze_nemesis_round.sma(62) : error 017: undefined symbol "PLAYERMODEL_MAX_LENGTH"
// C:\Users\karan\Desktop\ze 1.5\scripting\ze_nemesis_round.sma(63) : error 017: undefined symbol "MODEL_MAX_LENGTH"
// C:\Users\karan\Desktop\ze 1.5\scripting\ze_nemesis_round.sma(91) : error 017: undefined symbol "PLAYERMODEL_MAX_LENGTH"
// C:\Users\karan\Desktop\ze 1.5\scripting\ze_nemesis_round.sma(91) : error 029: invalid expression, assumed zero
// C:\Users\karan\Desktop\ze 1.5\scripting\ze_nemesis_round.sma(91) : error 017: undefined symbol "model"
// C:\Users\karan\Desktop\ze 1.5\scripting\ze_nemesis_round.sma(91) : fatal error 107: too many error messages on one line
//
// Compilation aborted.
// 6 Errors.
NeVeR DiE | Zombie Escape
IP : 139.59.90.127:40000
Image

karan
Mod Tester
Mod Tester
India
Posts: 60
Joined: 2 Years Ago
Location: India
Has thanked: 1 time
Been thanked: 3 times
Age: 22
Contact:

#18

Post by karan » 2 Months Ago

and also can we increase nemesis ratio like when we have 10 players 2 players are gonna be neme ; also when we had 20 players 4 players gonna be neme like that?
NeVeR DiE | Zombie Escape
IP : 139.59.90.127:40000
Image

User avatar
Mohamed Alaa
Mod Developer
Mod Developer
Egypt
Posts: 622
Joined: 2 Years Ago
Location: Egypt
Has thanked: 34 times
Been thanked: 48 times
Age: 19
Contact:

#19

Post by Mohamed Alaa » 2 Months Ago

Try this:

Code: Select all

#include <zombie_escape>
 
// Uncomment to use custom model for nemesis
// Note: This includes player model & claws
//#define USE_NEMESIS_MODEL
 
// Uncomment to use leap for nemesis
// Leap code: https://escapers-zone.net/viewtopic.php?p=10582#p10582
//#define USE_NEMESIS_LEAP
 
#define TASK_MAKE_HEROINE 4949849
 
// Access to start nemesis round
#define STARTNEMESIS_ACCESS ADMIN_LEVEL_H
 
#if defined USE_NEMESIS_MODEL
// Settings file
new const ZE_SETTING_FILE[] = "zombie_escape.ini"
 
// Default models
new const g_szModels_Nemesis_Player[][] = { "ze_nemesis_host" }
new const g_szModels_Nemesis_Claws[][] = { "models/zombie_escape/v_knife_nemesis.mdl" }
 
new Array:g_aModels_Nemesis_Player,
    Array:g_aModels_Nemesis_Claws
#endif
 
#if defined USE_NEMESIS_LEAP
native ze_get_longjump(id)
native ze_remove_longjump(id)
#endif
 
enum _:Colors
{
    Red = 0,
    Green,
    Blue
}
 
new bool:g_bIsNemesis[33],
    bool:g_bIsNextRoundNemesis = false,
    g_iNemesisNum = 0
 
new g_pCvarNemesisHP,
    g_pCvarNemesisGravity,
    g_pCvarNemesisSpeed,
    g_pCvarNemesisGlow,
    g_pCvarNemesisGlowColor[Colors],
    g_pCvarNemesisKB,
    g_pCvarNemesisFreeze,
    g_pCvarNemesisFire,
    g_pCvarFreezetime
 
public plugin_natives()
{
    register_native("ze_is_user_nemesis", "native_ze_is_user_nemesis", 1)
    register_native("ze_set_user_nemesis", "native_ze_set_user_nemesis", 1)
    register_native("ze_get_nemesis_number", "native_ze_get_nemesis_number", 1)
}
 
#if defined USE_NEMESIS_MODEL
public plugin_precache()
{
    // Initialize arrays
    g_aModels_Nemesis_Player = ArrayCreate(32, 1)
    g_aModels_Nemesis_Claws = ArrayCreate(64, 1)
   
    // Load from external file
    amx_load_setting_string_arr(ZE_SETTING_FILE, "Player Models", "NEMESIS MODEL", g_aModels_Nemesis_Player)
    amx_load_setting_string_arr(ZE_SETTING_FILE, "Weapon Models", "V_KNIFE NEMESIS", g_aModels_Nemesis_Claws)
   
    // If we couldn't load from file, use and save default ones
    new index
 
    if (ArraySize(g_aModels_Nemesis_Player) == 0)
    {
        for (index = 0; index < sizeof g_szModels_Nemesis_Player; index++)
            ArrayPushString(g_aModels_Nemesis_Player, g_szModels_Nemesis_Player[index])
       
        // Save to external file
        amx_save_setting_string_arr(ZE_SETTING_FILE, "Player Models", "NEMESIS", g_aModels_Nemesis_Player)
    }
 
    if (ArraySize(g_aModels_Nemesis_Claws) == 0)
    {
        for (index = 0; index < sizeof g_szModels_Nemesis_Claws; index++)
            ArrayPushString(g_aModels_Nemesis_Claws, g_szModels_Nemesis_Claws[index])
       
        // Save to external file
        amx_save_setting_string_arr(ZE_SETTING_FILE, "Weapon Models", "V_KNIFE NEMESIS", g_aModels_Nemesis_Claws)
    }
   
    // Precache models
    new player_model[32], model[64], model_path[128]
 
    for (index = 0; index < ArraySize(g_aModels_Nemesis_Player); index++)
    {
        ArrayGetString(g_aModels_Nemesis_Player, index, player_model, charsmax(player_model))
        formatex(model_path, charsmax(model_path), "models/player/%s/%s.mdl", player_model, player_model)
        precache_model(model_path)
        // Support modelT.mdl files
        formatex(model_path, charsmax(model_path), "models/player/%s/%sT.mdl", player_model, player_model)
        if (file_exists(model_path)) precache_model(model_path)
    }
 
    for (index = 0; index < ArraySize(g_aModels_Nemesis_Claws); index++)
    {
        ArrayGetString(g_aModels_Nemesis_Claws, index, model, charsmax(model))
        precache_model(model)
    }
}
#endif
 
public plugin_init()
{
    register_plugin("[ZE] Addons: Nemesis", "1.0", "Jack")
 
    register_clcmd("ze_start_nemesis_next", "cmd_nemesis", STARTNEMESIS_ACCESS)
 
    g_pCvarNemesisHP = register_cvar("ze_nemesis_hp", "20000")  // Nemesis health - Set 0 to use zombie HP
    g_pCvarNemesisGravity = register_cvar("ze_nemesis_gravity", "600")  // Nemesis gravity - Set 0 to use zombie gravity
    g_pCvarNemesisSpeed = register_cvar("ze_nemesis_speed", "300")  // Nemesis speed - Set 0 to use zombie speed
    g_pCvarNemesisGlow = register_cvar("ze_nemesis_glow", "1")  // Nemesis glow - 1 = enable | 0 = disable
    g_pCvarNemesisGlowColor[Red] = register_cvar("ze_nemesis_glow_r", "255")    // Nemesis glow color RED
    g_pCvarNemesisGlowColor[Green] = register_cvar("ze_nemesis_glow_g", "255")  // Nemesis glow color GREEN
    g_pCvarNemesisGlowColor[Blue] = register_cvar("ze_nemesis_glow_b", "255")   // Nemesis glow color BLUE
    g_pCvarNemesisKB = register_cvar("ze_nemesis_kb", "200.0")  // Nemesis knockback - Set 0 to use zombie knockback
    g_pCvarNemesisFreeze = register_cvar("ze_nemesis_freeze", "0")  // Nemesis get frozen? - 1 = doesn't get frozen | 0 = gets frozen
    g_pCvarNemesisFire = register_cvar("ze_nemesis_fire", "1")  // Nemesis set on fire? - 1 = doesn't set on fire | 0 = set on fire
}
 
public plugin_cfg()
{
    g_pCvarFreezetime = get_cvar_pointer("ze_freeze_time")
}
 
public client_disconnected(id)
{
    UnSet_Nemesis(id)
}
 
public client_putinserver(id)
{
    UnSet_Nemesis(id)
}
 
public ze_user_infected_pre(iVictim, iAttacker)
{
    if (g_bIsNemesis[iAttacker] && !ze_is_user_zombie(iVictim))
    {
        ExecuteHamB(Ham_Killed, iVictim, iAttacker, 0)
        return 1
    }
 
    return 0
}
 
public ze_fire_pre(id)
{
    if (g_bIsNemesis[id] && get_pcvar_num(g_pCvarNemesisFire))
        return PLUGIN_HANDLED
    return PLUGIN_CONTINUE
}
 
public ze_frost_pre(id)
{
    if (g_bIsNemesis[id] && get_pcvar_num(g_pCvarNemesisFreeze))
        return PLUGIN_HANDLED
    return PLUGIN_CONTINUE
}
 
public ze_user_humanized(id)
{
    UnSet_Nemesis(id)
}
 
public ze_roundend()
{
    for (new id = 0; id <= get_member_game(m_nMaxPlayers); id++)
    {
        if (is_user_alive(id) && g_bIsNemesis[id])
            UnSet_Nemesis(id)
    }
    g_iNemesisNum = 0
}
 
public ze_game_started_pre()
{
    while (g_bIsNextRoundNemesis)
    {
        g_bIsNextRoundNemesis = false
        ze_colored_print(0, "!tThis is nemesis round.")
        set_task(get_pcvar_float(g_pCvarFreezetime), "ChooseNemesis", TASK_MAKE_HEROINE)
        return PLUGIN_HANDLED
    }
 
    return PLUGIN_CONTINUE
}
 
public ChooseNemesis(taskid)
{
    new iNemesis, id
    
    while (iNemesis < RequiredNemesis())
    {
        id = GetRandomAlive(random_num(1, GetAllAlivePlayersNum()))
        
        if (!is_user_alive(id) || g_bIsNemesis[id])
            continue

        Set_Nemesis(id)
        iNemesis++
    }

    g_iNemesisNum = iNemesis
    remove_task(taskid)
    return
}
 
public cmd_nemesis(id, level, cid)
{
    if (!cmd_access(id, STARTNEMESIS_ACCESS, cid, 0))
    {
        client_print(id, print_console, "You have not access.")
        return PLUGIN_HANDLED
    }
   
    g_bIsNextRoundNemesis = true
    client_print(id, print_console, "Nemesis round will start next round.")
 
    new szName[32]
    get_user_name(id, szName, charsmax(szName))
    ze_colored_print(0, "!g%s !thas activated a nemesis round. Next round is nemesis.", szName)
    return PLUGIN_HANDLED
}
 
public Set_Nemesis(id)
{
    if (g_bIsNemesis[id] || !is_user_alive(id))
        return
 
    g_bIsNemesis[id] = true
 
    if (!ze_is_user_zombie(id))
        ze_set_user_zombie(id)
 
    #if defined USE_NEMESIS_LEAP
        ze_get_longjump(id)
    #endif
 
    #if defined USE_NEMESIS_MODEL
        new szPlayerModel[32], szModel[64]
        ArrayGetString(g_aModels_Nemesis_Player, random_num(0, ArraySize(g_aModels_Nemesis_Player) - 1), szPlayerModel, charsmax(szPlayerModel))
        cs_set_user_model(id, szPlayerModel)
 
        ArrayGetString(g_aModels_Nemesis_Claws, random_num(0, ArraySize(g_aModels_Nemesis_Claws) - 1), szModel, charsmax(szModel))
        cs_set_player_view_model(id, CSW_KNIFE, szModel)
    #endif
   
    if (get_pcvar_float(g_pCvarNemesisHP))
    {
        set_entvar(id, var_health, get_pcvar_float(g_pCvarNemesisHP))
    }
 
    if (get_pcvar_num(g_pCvarNemesisSpeed))
    {
        ze_set_zombie_speed(id, get_pcvar_num(g_pCvarNemesisSpeed))
    }
 
    if (get_pcvar_num(g_pCvarNemesisGravity))
    {
        ze_set_user_gravity(id, get_pcvar_num(g_pCvarNemesisGravity))
    }
 
    if (get_pcvar_num(g_pCvarNemesisKB))
    {
        ze_set_user_knockback(id, get_pcvar_float(g_pCvarNemesisKB))
    }
 
    if (get_pcvar_num(g_pCvarNemesisGlow))
    {
        Set_Rendering(id, kRenderFxNone, 255, 0, 0, kRenderNormal, 15)
    }
 
    new szName[32]
    get_user_name(id, szName, charsmax(szName))
    set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 0.0, 5.0, 0.1, 1.5)
    show_hudmessage(id, "%s became Nemesis", szName)
    ze_colored_print(0, "!g%s !tbecame !gNemesis!n.", szName)
    ze_colored_print(id, "!gYou !tbecame !gNemesis!n.")
}
 
public UnSet_Nemesis(id)
{
    if (!g_bIsNemesis[id] || !is_user_alive(id))
        return
 
    g_bIsNemesis[id] = false
 
    #if defined USE_NEMESIS_LEAP
        ze_remove_longjump(id)
    #endif
 
    if (get_pcvar_num(g_pCvarNemesisSpeed))
    {
        ze_reset_zombie_speed(id)
    }
 
    if (get_pcvar_num(g_pCvarNemesisGravity))
    {
        ze_reset_user_gravity(id)
    }
 
    if (get_pcvar_num(g_pCvarNemesisKB))
    {
        ze_reset_user_knockback(id)
    }
 
    if (get_pcvar_num(g_pCvarNemesisGlow))
    {
        Set_Rendering(id)
    }
}
 
public GetRandomNemesis()
{
    new iPlayers[32], iSelected[33], iCount = 0, iTotalPlayers, iRandomIndex
    get_players(iPlayers, iTotalPlayers)
 
    if (iTotalPlayers > 0)
    {
        for (new i = 0; i < iTotalPlayers; i++)
        {
            iRandomIndex = iPlayers[i]
 
            if (is_user_alive(iRandomIndex))
            {
                iSelected[iCount++] = iRandomIndex
            }
        }
 
        return iSelected[random(--iCount)]
    }
 
    return 0
}
 
public native_ze_is_user_nemesis(id)
{
    if (!is_user_connected(id))
    {
        log_error(AMX_ERR_NATIVE, "[ZE] Invalid Player id (%d)", id)
        return -1
    }
 
    return g_bIsNemesis[id]
}
 
public native_ze_set_user_nemesis(id, bool:set)
{
    if (!is_user_connected(id))
    {
        log_error(AMX_ERR_NATIVE, "[ZE] Invalid Player id (%d)", id)
        return false
    }
 
    if (set)
    {
        if (!g_bIsNemesis[id])
            Set_Nemesis(id)
    }
    else
    {
        if (g_bIsNemesis[id])
            UnSet_Nemesis(id)
    }
 
    return true
}

stock RequiredNemesis()
{
    switch(GetAllAlivePlayersNum())
    {
        case 2..5: return 1
        case 6..15: return 2
        case 16..25: return 3
        case 26..32: return 4
    }
    return 0
}

public native_ze_get_nemesis_number()
{
    return g_iNemesisNum
}
Want your own mod edition? PM me.
Accepting web projects.
CS 1.6 hosting: powergamingtech.com

pirate228
Member
Member
India
Posts: 16
Joined: 1 Year Ago
Has thanked: 2 times
Been thanked: 0
Age: 19
Contact:

#20

Post by pirate228 » 1 Month Ago

can you make a nemesis menu by which we can select players? and different skin ,external skins get bugged with human skins

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest