Junior Member
Join Date: Jul 2016
Location: Kazakhstan, Aktau
|
10-21-2016
, 16:43
Defense of the Ancients II, Knife.
|
#1
|
Blog design fashion Defense of the Ancients II - Knife.
I decided to undertake the development Knife fashion with chips from DotA 2 as your own idea?
I want to make rent at loggerheads, with the possibility of buying various things (on the similarity of WAR3FT). At the same time, the ability to use a variety of character abilities of DotA.
Is it worth it to spread in open access?
While gradually slipped outline to start:
Code:
/*
* Defense of the Ancients II, Knife.
* Author: OverGame
* Update date: 22.10.2016, hour 01:40.
* Start work.
*/
#include amxmodx
#include fakemeta
#define is_user_admin(%0) (get_user_flags(%0) > 0 && ~get_user_flags(%0) & ADMIN_USER)
#define is_msg_valid(%0) (%0 && %0[0] != ';' && %0[0] != '/' && %0[0] != '#')
enum _:DATA_HEROES
{
HERO_NAME [68], //String
HERO_MODEL [99], //String
HERO_ACCESS [10], //String
HERO_DAMAGE [10], //Float
HERO_SPEED [10], //Number
HERO_GRAVITY [10], //Float
HERO_ARMOR [10] //Float
};
new Array:g_iArrayHeroes, g_iHeroes[DATA_HEROES];
public plugin_precache()
{
new iFile = fopen("/addons/amxmodx/configs/d2k_core/heroes.ini", "rt");
if(!iFile) return set_fail_state("File ^"addons/amxmodx/configs/d2k_core/heroes.ini^" not found!");
new szBuffer[1024];
g_iArrayHeroes = ArrayCreate(DATA_HEROES);
while(!feof(iFile))
{
fgets(iFile, szBuffer, 1023);
if(is_msg_valid(szBuffer) && parse(szBuffer, g_iHeroes[HERO_NAME], 67,
g_iHeroes[HERO_MODEL], 99,
g_iHeroes[HERO_ACCESS], 10,
g_iHeroes[HERO_DAMAGE], 10,
g_iHeroes[HERO_SPEED], 10,
g_iHeroes[HERO_GRAVITY], 10,
g_iHeroes[HERO_ARMOR], 10))
{
if(is_msg_valid(g_iHeroes[HERO_MODEL]))
engfunc(EngFunc_PrecacheModel, d2kreplace("models/player/%s/%s.mdl", g_iHeroes[HERO_MODEL], g_iHeroes[HERO_MODEL]));
ArrayPushArray(g_iArrayHeroes, g_iHeroes);
}
}
return fclose(iFile);
}
public plugin_init()
{
register_plugin("Defense of the Ancients", "A1", "OverGame");
register_dictionary("dota2knife.txt");
register_clcmd("menu", "ClCmd_SayMenu");
register_clcmd("say /menu", "ClCmd_SayMenu");
register_clcmd("say_team /menu", "ClCmd_SayMenu");
register_menucmd(register_menuid("Show_MainMenu"),(1<<0|1<<1|1<<9), "Handle_MainMenu");
}
public ClCmd_SayMenu(id) return Show_MainMenu(id);
Show_MainMenu(id)
{
new szMenu[512], iKeys = (1<<0|1<<9), iLen = format(szMenu, 511, "%L", id, "D2K_MENU_MAIN_TITLE");
iLen += format(szMenu[iLen], 511 - iLen, "%L \w%L", id, "D2K_MENU_PAGE", 1, id, "D2K_MENU_MAIN_TEAM");
if(is_user_admin(id))
{
iLen += format(szMenu[iLen], 511 - iLen, "%L \r%L", id, "D2K_MENU_PAGE", 2, id, "D2K_MENU_MAIN_PRIVILAGES");
iKeys |= (1<<1);
}
else iLen += format(szMenu[iLen], 511 - iLen, "%L \d%L", id, "D2K_MENU_PAGE", 2, id, "D2K_MENU_MAIN_BUY");
format(szMenu[iLen], 511 - iLen, "%L \w%L", id, "D2K_MENU_PAGE", 0, id, "D2K_MENU_EXIT");
return show_menu(id, iKeys, szMenu, -1, "Show_MainMenu");
}
public Handle_MainMenu(id, iKey)
{
/*switch(iKey) {
case 0: return Show_ChooseTeam(id);
case 1: if(is_user_admin(id)) { return Show_PrivilagesMenu(id); } else show_motd(id, "adminka.txt", "Buy admin");
}*/
return PLUGIN_HANDLED;
}
stock d2kreplace(szMessage[], any:...)
{
static szReplaceMsg[512];
vformat(szReplaceMsg, 511, szMessage, 3);
return szReplaceMsg;
}
|
|