Page 1 of 3
Re: Zombie classes
Posted: 28 Jul 2018, 10:04
by Night Fury
Rain1153 wrote: ↑5 years ago
but it didn't come :/
Add this hunter will (will be shared later) & test it.
PS: use the same sound in speed boost plugin.
| Code:
#include <zombie_escape>
#include <ze_zombie_class>
// Trail effect configs
#define TRAIL_LIFE 2 // Life
#define TRAIL_WIDTH 10 // Width
#define TRAIL_RED 90 // Red color
#define TRAIL_GREEN 200 // Green color
#define TRAIL_BLUE 90 // Blue color
#define TRAIL_ALPHA 220 // Alpha
new g_pCvarSpeedAmount, g_pCvarBoostTime, g_pCvarSpeedBoostDelay
new bool:g_bCanUseSB[33], g_iCoolDown_Time[33]
new g_iSpeedTrail
new g_iClassID
/*-------------------START CONFIGS ----------------*/
new const HUNTER_NAME[] = "Hunter"
new const HUNTER_INFO[] = "Speed boost"
const HUNTER_HEALTH = 1800
const HUNTER_SPEED = 0.75
const HUNTER_GRAVITY = 1.0
/*------------------- END CONFIGS -----------------*/
new const g_iSpeedSound[] = "zombie_escape/sprint.wav"
public plugin_precache()
{
g_iClassID = ze_register_zombie_class(HUNTER_NAME, HUNTER_INFO, HUNTER_HEALTH, HUNTER_SPEED, HUNTER_GRAVITY)
precache_sound(g_iSpeedSound)
g_iSpeedTrail = precache_model("sprites/smoke.spr")
}
public plugin_init()
{
register_plugin("[ZE] Addons: Speed Boost", "1.0", "Jack GamePlay")
client_clcmd("drop", "SpeedBoost")
g_pCvarBoostTime = register_cvar("ze_boost_time", "3.0")
g_pCvarSpeedAmount = register_cvar("ze_speed_amount", "450")
g_pCvarSpeedBoostDelay = register_cvar("ze_speedboost_delay", "10.0")
}
public client_putinserver(id)
{
g_bCanUseSB[id] = false
}
public client_disconnected(id)
{
g_bCanUseSB[id] = false
}
public ze_user_infected(id)
{
if (!is_user_alive(id) || (ze_get_current_zombie_class(id) != g_iClassID))
return
g_bCanUseSB[id] = true
ze_colored_print(id, "!tPress !y[!gG!y] !tto get a speed boost!y.")
}
public ze_user_humanized(id)
{
if (!is_user_alive(id))
return
g_bCanUseSB[id] = false
}
public SpeedBoost(id)
{
if (!is_user_alive(id))
return PLUGIN_CONTINUE
if (!ze_is_user_zombie(id))
{
ze_colored_print(id, "!tThis option is for !gzombies !tonly!y.")
return PLUGIN_HANDLED
}
if (g_bCanUseSB[id])
{
g_bCanUseSB[id] = false
ze_set_zombie_speed(id, get_pcvar_num(g_pCvarSpeedAmount))
ze_colored_print(id, "!tYou got !y[!g%i!y] !tspeed for !y[!g%i!y] !tsec!y.", get_pcvar_num(g_pCvarSpeedAmount), floatround(get_pcvar_float(g_pCvarBoostTime)))
message_begin(MSG_BROADCAST, SVC_TEMPENTITY)
write_byte(TE_BEAMFOLLOW)
write_short(id)
write_short(g_iSpeedTrail)
write_byte(TRAIL_LIFE)
write_byte(TRAIL_WIDTH)
write_byte(TRAIL_RED)
write_byte(TRAIL_GREEN)
write_byte(TRAIL_BLUE)
write_byte(TRAIL_ALPHA)
message_end()
emit_sound(id, CHAN_STREAM, g_iSpeedSound, 1.0, ATTN_NORM, 0, PITCH_NORM)
set_task(get_pcvar_float(g_pCvarBoostTime), "Remove_Boost", id)
}
return PLUGIN_CONTINUE
}
public Remove_Boost(id)
{
if (!is_user_alive(id) || !ze_is_user_zombie(id))
return
g_bCanUseSB[id] = false
g_iCoolDown_Time[id] = floatround(get_pcvar_float(g_pCvarSpeedBoostDelay))
ze_reset_zombie_speed(id)
ze_colored_print(id, "!gSpeed boost has ended!y.")
set_task(1.0, "ShowHUD", id, _, _, "a", g_iCoolDown_Time[id])
set_task(get_pcvar_float(g_pCvarSpeedBoostDelay), "Allow_Again", id)
}
public ShowHUD(id)
{
if (!is_user_alive(id))
return
if (!g_bCanUseSB[id])
{
g_iCoolDown_Time[id] = g_iCoolDown_Time[id] - 1
set_hudmessage(200, 200, 200, 0.75, 0.92, 0, 1.0, 1.1, 0.0, 0.0, -1)
show_hudmessage(id, "Sprint cooldown: %i", g_iCoolDown_Time[id])
}
}
public Allow_Again(id)
{
if (!is_user_alive(id) || !ze_is_user_zombie(id))
return
g_bCanUseSB[id] = true
ze_colored_print(id, "!gSpeed boost can be used!y.")
}
Re: Zombie classes
Posted: 28 Jul 2018, 10:13
by Rain1153
You are mistaked bro...wait can you add 3 new default classes in ze class.sma? So that i can edit it from the source through defines?
Like in zp there r default 4 classes
And pls see why the ini file is not auto generated
Re: Zombie classes
Posted: 28 Jul 2018, 10:27
by Night Fury
Rain1153 wrote: ↑5 years ago
You are mistaked bro...wait can you add 3 new default classes in ze class.sma? So that i can edit it from the source through defines?
Like in zp there r default 4 classes
And pls see why the ini file is not auto generated
The INI file is auto generated if it doesn't exist & if any plugin ran & has this native in it:
We put a default zombie class in the source so it's used when there are not any added zombie classes but if there is any zombie classes, default ZClasses will be useless. Just use the hunter class i have provided you & you will understand.
Re: Zombie classes
Posted: 28 Jul 2018, 11:17
by Rain1153
so i will try to convert other zp classes too
Re: Zombie classes
Posted: 28 Jul 2018, 13:17
by johnnysins2000
we can convert zp classes into ze ?
Re: Zombie classes
Posted: 28 Jul 2018, 13:22
by Night Fury
Re: Zombie classes
Posted: 28 Jul 2018, 13:39
by johnnysins2000
a tutorial would be good in tutorials section ?
any chances of making it ? or atleast tell me which natives i can use to convert zp classes to ze?
Re: Zombie classes
Posted: 28 Jul 2018, 13:54
by Night Fury
johnnysins2000 wrote: ↑5 years ago
a tutorial would be good in tutorials section ?
any chances of making it ? or at least tell me which natives i can use to convert zp classes to ze?
Check the include file & you will find all natives & forwards.
I will make a tutorial.
I'm sharing examples.
Re: Zombie classes
Posted: 04 Nov 2018, 14:14
by DarkZombie
ze_zombie_class.sma can not be converted to amxx, this is the error: (image)
Re: Zombie classes
Posted: 04 Nov 2018, 21:37
by Night Fury
Re: Zombie classes
Posted: 05 Nov 2018, 15:14
by DarkZombie
Thanks its works now.
In the main menu to appear, what to do?
And in Zombie Class menu the exit button (0) write ML NOTFOUND ZEXIT.
Re: Zombie classes
Posted: 05 Nov 2018, 21:03
by DarkZombie
image
Re: Zombie classes
Posted: 06 Nov 2018, 12:10
by Night Fury
DarkZombie wrote: ↑5 years ago
Thanks its works now.
In the main menu to appear, what to do?
And in Zombie Class menu the exit button (0) write ML NOTFOUND ZEXIT.
Updated the ze_zombie_class.sma's code, recompile it.
Re: Zombie classes
Posted: 06 Nov 2018, 19:06
by DarkZombie
Done, its works, thank you.
The other question: In the main menu to appear, what to do? Like when i press "m" and i will see the Zombie Classes menu.
Re: Zombie classes
Posted: 06 Nov 2018, 23:15
by Night Fury
DarkZombie wrote: ↑5 years ago
Done, its works, thank you.
The other question: In the main menu to appear, what to do? Like when i press "m" and i will see the Zombie Classes menu.
I don't understand.
Re: Zombie classes
Posted: 07 Nov 2018, 15:09
by DarkZombie
The [ZE] Main Menu list, included. Such as knife menu, weapons, etc. 4.th is Zombie Classes
Re: Zombie classes
Posted: 07 Nov 2018, 21:48
by DarkZombie
so?
Re: Zombie classes
Posted: 08 Nov 2018, 20:48
by DarkZombie
Something about it, Jack?
Re: Zombie classes
Posted: 09 Nov 2018, 11:34
by Night Fury
DarkZombie wrote: ↑5 years ago
Something about it, Jack?
Give your main menu code.
Re: Zombie classes
Posted: 09 Nov 2018, 18:12
by DarkZombie
Here it is:
Code: Select all
#include <zombie_escape>
native ze_open_knife_menu(id)
// 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 /ze", "Cmd_ChooseTeam")
register_clcmd("say_team /ze", "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, "\w1.\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, "\w1.\r %L^n", id, "MENU_WEAPONBUY_RE_ENABLE")
}
// 2. Extra Items
if (is_user_alive(id))
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w2.\r %L^n", id, "MENU_EXTRABUY")
}
else
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d2. %L^n", id, "MENU_EXTRABUY")
}
// 3. Knife menu
if (is_user_alive(id))
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\w3.\r Knife menu^n")
}
else
{
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "\d3. Knife menu^n")
}
// 0. Exit
iLen += formatex(szMenu[iLen], charsmax(szMenu) - iLen, "^n^n\w0.\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 Weapons
{
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: // Knife menu
{
if (is_user_alive(id))
{
ze_open_knife_menu(id)
}
else
{
ze_colored_print(id, "%L", id, "DEAD_CANT_BUY_WEAPON")
}
}
}
return PLUGIN_HANDLED
}