Senior Member
Join Date: Aug 2012
Location: Russia
|
08-15-2016
, 13:16
Deathrun Mod [Core + Modes]
|
#1
|
Deathrun Mod
Version: v1.1
Author: Mistrick
Description: A set of plugins for realization of mod.
Included:
deathrun_core:
Main plugin, team balance, join control, fixed using buttons through the walls, remove extra entity(bomb plant, etc.), block radio
cvars:
PHP Code:
deathrun_block_kill 1 deathrun_block_falldmg 1
settings:
PHP Code:
#define WARMUP_TIME 15.0 #define HEALER_MAX_HEALTH 150.0
api:
Spoiler
PHP Code:
/** * Forward which called when chosen new terrorist(new round or disconnect). * * @param id Player index. */ forward dr_chosen_new_terrorist(id);
/** * Get player index current terrorist. * * @return Player index. */ native dr_get_terrorist();
/** * Set player who became terrorist in new round. * * @param id Next terrorist index. */ native dr_set_next_terrorist(id);
/** * Get player who became terrorist in new round. * * @return Player index. */ native dr_get_next_terrorist();
deathrun_modes:
Api for realization of terrorist modes. Controls using buttons, weapons(weaponbox, armoury_entity), bhop.
api:
Spoiler
PHP Code:
enum _:ModeData { m_Name[32], m_Mark[16], m_RoundDelay, m_CurDelay, m_CT_BlockWeapon, m_TT_BlockWeapon, m_CT_BlockButtons, m_TT_BlockButtons, m_Bhop, m_Usp, m_Hide };
/** * Mode registration. * * @param Name Mode name, use ML key. * @param Mark Mode mark, use this to get mode index in other plugins. * @param RoundDelay Mode blocking in rounds. * @param CT_BlockWeapons Allow CT pick up weapons. * @param TT_BlockWeapons Allow TT pick up weapons. * @param CT_BlockButtons Allow CT use buttons. * @param TT_BlockButtons Allow TT use buttons. * @param Bhop Enable autobhop. * @param Usp Enable start with USP for CT. * @param Hide Allow hide mode in menu. * * @return Mode index. */ native dr_register_mode(Name[32], Mark[16], RoundDelay, CT_BlockWeapons, TT_BlockWeapons, CT_BlockButtons, TT_BlockButtons, Bhop, Usp, Hide = 0);
/** * Get current mode. * * @param name Mode name, here will be copied the current mode ML key. * @param size Name size. * * @return Mode index. */ native dr_get_mode(name[] = "", size = 0);
/** * Set new mode. * * @param mode Mode index. * @param fwd Call forward(dr_selected_mode). * @param id Player index in forward. */ native dr_set_mode(mode, fwd = 0, id = 0);
/** * Get mode by mark. * * @param mark Mode mark. * * @return Mode index. */ native dr_get_mode_by_mark(mark[]);
/** * Get full mode info. * * @param mode Mode index. * @param modeinfo Info array. */ native dr_get_mode_info(mode, modeinfo[ModeData]);
/** * Set mode autobhop. * * @param bhop 0 - OFF, 1 - ON. */ native dr_set_mode_bhop(bhop);
/** * Get mode autobhop. * * @return 0 - OFF, 1 - ON. */ native dr_get_mode_bhop();
/** * Set player autobhop. * * @note The value for a mode bhop more important than for the player. * * @param id Player index. * @param bhop false - OFF, true - ON. */ native dr_set_user_bhop(id, bool:bhop);
/** * Get player autobhop. * * @param id Player index. */ native bool:dr_get_user_bhop(id);
/** * Forward which called when the selection mode. * * @param id Terrorist index. * @param mode Mode index. */ forward dr_selected_mode(id, mode);
deathrun_mode_free, deathrun_mode_invis, deathrun_mode_snow, deathrun_mode_rambo, deathrun_mode_duel:
Examples of use Modes API
api:
Spoiler
deathrun_duel.inc
PHP Code:
enum CancelType { CType_TimeOver, CType_PlayerDisconneced, CType_PlayerDied, CType_ModeChanged }
/** * Forward which called before duel start, warm up time * * @param duelist_ct Player index. * @param duelist_t Player index. */ forward dr_duel_prestart(duelist_ct, duelist_t);
/** * Forward which called when duel started * * @param duelist_ct Player index. * @param duelist_t Player index. */ forward dr_duel_start(duelist_ct, duelist_t);
/** * Forward which called when duel overed * * @param winner Player index. * @param looser Player index. */ forward dr_duel_finish(winner, looser);
/** * Forward which called when duel canceled * * @param type Cancel type */ forward dr_duel_canceled(CancelType:type);
deathrun_shop:
API for shop.
api:
Spoiler
PHP Code:
const ITEM_TEAM_T = (1 << 1); const ITEM_TEAM_CT = (1 << 2);
/** * Item registration in shop * * @param name Item name in menu * @param cost Item cost * @param team Team access, bitsum, use ITEM_TEAM_T, ITEM_TEAM_CT * @param access Admin access, admin flags * @param on_buy OnBuy function(id) * @param can_buy CanBuy function(id), should return ITEM_ENABLED or ITEM_DISABLED * * @return Item index, use with changing cost */ native dr_shop_add_item(name[], cost, team = (ITEM_TEAM_T|ITEM_TEAM_CT), access = 0, on_buy[], can_buy[] = "");
/** * Use this in CanBuy function * * @param addition Additional string in menu */ native dr_shop_item_addition(addition[]);
/** * @param item Item index * @param cost New item cost */ native dr_shop_set_item_cost(item, cost);
example:
Spoiler
PHP Code:
#include <amxmodx> #include <fun> #include <deathrun_shop> #include <deathrun_modes>
#define PLUGIN "Deathrun Shop: Items" #define VERSION "0.1" #define AUTHOR "Mistrick"
#pragma semicolon 1
#define MAX_USE 3
new g_iGrenadeUsed[33]; new g_iModeDuel; new g_bDuel;
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0"); dr_shop_add_item("Health", 100, ITEM_TEAM_T|ITEM_TEAM_CT, 0, "ShopItem_Health", "ShopItem_CanBuy_Health"); dr_shop_add_item("Gravity", 100, ITEM_TEAM_T|ITEM_TEAM_CT, 0, "ShopItem_Gravity"); dr_shop_add_item("Grenade HE", 100, ITEM_TEAM_CT, 0, "ShopItem_GrenadeHE", "ShopItem_CanBuy_GrenadeHE"); } public plugin_cfg() { g_iModeDuel = dr_get_mode_by_mark("duel"); } public client_putinserver(id) { g_iGrenadeUsed[id] = MAX_USE; } public Event_NewRound() { arrayset(g_iGrenadeUsed, MAX_USE, sizeof(g_iGrenadeUsed)); } public dr_selected_mode(id, mode) { g_bDuel = (g_iModeDuel == mode) ? true : false; } public ShopItem_Health(id) { set_user_health(id, get_user_health(id) + 150); client_print(id, print_chat, "You bougth 150HP."); } public ShopItem_Gravity(id) { set_user_gravity(id, 0.5); } public ShopItem_GrenadeHE(id) { g_iGrenadeUsed[id]--; give_item(id, "weapon_hegrenade"); } public ShopItem_CanBuy_Health(id) { return g_bDuel ? ITEM_DISABLED : ITEM_ENABLED; } public ShopItem_CanBuy_GrenadeHE(id) { if(g_iGrenadeUsed[id] <= 0) { dr_shop_item_addition("\r[ALL USED]"); return ITEM_DISABLED; } new szAddition[32]; formatex(szAddition, charsmax(szAddition), "\y[Have %d]", g_iGrenadeUsed[id]); dr_shop_item_addition(szAddition); return ITEM_ENABLED; }
deathrun_informer:
Shows info for player(mode info, speclist, speed).
settings:
PHP Code:
#define UPDATE_INTERVAL 1.0 #define DONT_SHOW_FOR_ALIVE
deathrun_lifes:
Lite life system.
deathrun_buttons_control:
Lite plugin for control buttons.
deathrun_teleport_spot:
Plugin for slapping players who tries catch enemy near the teleport.
Changelog and lastest update:
GitHub
Recommended Plugins:
Semiclip by s1lent with patch 1
Last edited by Mistrick; 11-04-2016 at 07:24.
|
|