Offline |
|
|
Csatlakozott: 2012.08.05. 20:43 Hozzászólások: 465
Megköszönt másnak: 55 alkalommal Megköszönték neki: 14 alkalommal
|
socrazy írta: Pele írta: Silent írta: Töltsd le az oldalon( http://www.amxx.try.hu) található átalakító programot. Azzal be tudod tallózni az inc fájlt is. nem "inc" kell hanem valami INL tölsd fel a forráskódját, kíváncsi vagyok mi lehet az. INL: // All public defines,consts /*================================================================================ [Global defines / Don't change!!!.] =================================================================================*/ #define MAX_LEVELS 100 #define MAX_HEROES 7 #define MAX_MAPITEMS 500 #define MAX_ITEMS 100 #define MAX_POTIONS 9 #define WORN_TYPES 2 #define MAX_SKILLS 20 #define MAX_PLUGIN_SKILLS 40 // overall plugins of skill #define MAX_SKILL_NAME_SIZE 64 #define MAX_SKILL_DESC_SIZE 128 #define MAX_MODEL_LENGTH 32 #define ITEM_NOT_WORN 0 #define ITEM_WORN 1 #define CHAR_ACTIVE 1 #define CHAR_DELETED 0 #define UNLOGGED 0 #define LOGGED 1 #define PTS_HP_MINOR 0 #define PTS_HP_GREATER 1 #define PTS_HP_SUPER 2 #define PTS_MP_MINOR 3 #define PTS_MP_GREATER 4 #define PTS_MP_SUPER 5 #define PTS_RP_MINOR 6 #define PTS_RP_GREATER 7 #define PTS_RP_SUPER 8 #define TASKID_MANAREGEN 6666 #define TASKID_HUDINFO 7666 #define TASKID_FIRSTCONNECT 12444 #define TASKID_POISON 16000 #define TASKID_CROSSBOW 22000 // Arbalet's shoot time #define SHOOT_TIME 1 // Chars data #define MAX_CHAR_DATA 16 #define CHAR_ARMOR 0 #define CHAR_DAMAGE 1 #define CHAR_COST 2 #define CHAR_DURABILITY 3 #define CHAR_STR 4 #define CHAR_DEX 5 #define CHAR_BLOCK 6 #define CHAR_LEVEL 7 #define CHAR_GIVEVIT 8 #define CHAR_GIVEENE 9 #define CHAR_TYPE 10 #define CHAR_HASP 11 #define CHAR_PDAMAGE 12 #define CHAR_PDURATION 13 #define CHAR_CROSSBOWDAMAGE 15 // Chars data CHAR_TYPE type values #define TYPE_GLOVES 0 #define TYPE_BOOTS 1 #define TYPE_BELT 2 #define TYPE_ARMOR 3 #define TYPE_HELM 4 #define TYPE_SHIELD 5 #define TYPE_WEAPON 6 #define TYPE_RING 7 #define TYPE_AMULET 8 #define TYPE_BOLTS 9 #define PRESSED(%0) \ (((button & (%0)) == (%0)) && ((oldbuttons & (%0)) != (%0))) #define RELEASED(%0) \ (((button & (%0)) != (%0)) && ((oldbuttons & (%0)) == (%0))) new const gTableCreateQuery[] = " \ CREATE TABLE IF NOT EXISTS `d2_data` \ ( \ `player_steamid` VARCHAR(25) NOT NULL, \ `player_ip` VARCHAR(20) NOT NULL, \ `player_name` VARCHAR(35) NOT NULL, \ `player_data` VARCHAR(6096) NOT NULL, \ `player_data2` VARCHAR(6096) NOT NULL, \ `player_data3` VARCHAR(9096) NOT NULL, \ PRIMARY KEY(`player_name`,`player_ip`,`player_steamid`),\ KEY `player_data` (`player_data`), \ KEY `player_data2` (`player_data2`), \ KEY `player_data3` (`player_data3`) \ ) TYPE=MyISAM; \ "; /*================================================================================ [End of global defines.] =================================================================================*/ /*================================================================================ [Editable defines.] =================================================================================*/ #define DISTANCE_INVENTORY_PLAYER 300.0 #define DISTANCE_NEAR_MONSTER 300.0 #define DISTANCE_E_BUTTON_USE_ENT 80.0 #define MAX_PLAYER_ITEMS 8 #define MAX_INVENTORY_ITEMS 8 #define MAX_PLAYER_POTIONS 10 #define MAX_INVENTORY_POTIONS 10 #define MAX_CHARS 15 /*================================================================================ [End of editable defines.] =================================================================================*/ /*================================================================================ [Some stocks.] =================================================================================*/ #define OFFSET_TEAM 114 #define fm_cs_set_user_nobuy(%1) set_pdata_int(%1, 235, get_pdata_int(%1, 235) & ~(1<<0) ) #define fm_set_user_team(%1,%2) set_pdata_int( %1, OFFSET_TEAM, %2) #define fm_get_user_team(%1) get_pdata_int( %1, OFFSET_TEAM) #define TEAM_SELECT_VGUI_MENU_ID 2 #define HIDE_TIMER (1<<4) // hides timer #define HIDE_RADAR (1<<3) // hides radar,health,armor #define HIDE_MONEY (1<<5) // hides money #define HIDE_AMMO (1<<0) // crosshair,ammo,weapon list #define HIDE_FLASH (1<<1) // flashlight const m_pPlayer = 41; const m_flPrimaryAttack = 46; const m_flNextSecondaryAttack = 47; const m_pClientActiveItem = 374; const m_bitsDamageType = 76; const m_flWait = 42; /*================================================================================ [End of some stocks.] =================================================================================*/ /*================================================================================ [Precache/download files.] =================================================================================*/ new const LevelUp[] = "d2lod/levelup.wav"; new const g_crossbow_shoot_sound[] = "weapons/xbow_fire1.wav"; new const Custom_Models[MAX_HEROES][] = { "black_knight", "assassin", "necromancer", "barbarian", "black_knight", "black_knight", "sorceress" } new const g_w_mp[] = "models/d2lod/w_mp.mdl"; new const g_w_hp[] = "models/d2lod/w_hp.mdl"; new const g_w_coins[] = "models/d2lod/w_coins.mdl"; new const g_w_item[] = "models/skeleton.mdl"; new const g_w_inventory[] = "models/d2lod/w_inventory.mdl"; new const g_w_charsi[] = "models/d2lod/charsi2.mdl"; new const g_w_akara[] = "models/d2lod/akara.mdl"; new const g_brassknuckles[] = "models/d2lod/v_knuckles.mdl"; // Other custom weapons new const g_w_crossbow[] = "models/d2lod/crossbow_bolt.mdl"; new const g_v_crossbow[] = "models/d2lod/v_crossbow.mdl"; new const g_p_crossbow[] = "models/d2lod/p_crossbow.mdl"; /*================================================================================ [End of download files.] =================================================================================*/ /*================================================================================ [Heroe's and their attributes.] =================================================================================*/ new const Diablo2_Fake_Player_Name[] = "Diablo II Fake Player CT"; new const HEROES[MAX_HEROES][] = { "Amazon", "Assassin", "Necromancer", "Barbarian", "Paladin", "Druid", "Sorceress" } /*================================================================================ [End of heroe's attributes.] =================================================================================*/ /*================================================================================ [Potions and their settings.] =================================================================================*/ new const Potion_Names[MAX_POTIONS][] = { "Minor Health", "Greater Health", "Super Health", "Minor Mana", "Greater Mana", "Super Mana", "Minor rejuvanation", "Greater rejuvanation", "Super rejuvanation" } new const Potion_Cost[MAX_POTIONS] = { 35, 65, 125, 30, 50, 120, 55, 80, 150 } new const Potion_Multi[MAX_POTIONS] = { 30, 80, 150, 30, 80, 160, 2, 1, 2 } /*================================================================================ [End of potion settings.] =================================================================================*/ /*================================================================================ [Editable players stuff.] =================================================================================*/ new const Float:HEROES_REGAIN_MANA[MAX_HEROES] = { 5.0, 5.0, 4.0, 5.0, 4.0, 4.0, 4.0 }; // Heroes Regenerate mana time new const HEROES_DEFENCE_DEXTERITY[MAX_HEROES] = { 2, 2, 2, 3, 3, 3, 2 }; //Give x amount of armor of current class, each added dexterity stat point. new const Float: HEROES_STRENGTH_PERSTAT[MAX_HEROES] = { 0.6, 0.8, 0.5, 0.9, 0.7, 0.6, 0.5 }; //Give x percents of damage of current class, each added stat point. new const Float: HEROES_DEXTERITY_PERSTAT[MAX_HEROES] = { 1.5, 1.5, 1.5, 1.5, 2.0, 1.5, 1.0 }; // X extra amount of percents to avoid enemy attacks new const HEROES_VITALITY_PERSTAT[MAX_HEROES] = { 2, 2, 1, 3, 2, 3, 1 }; //Give x amount of health of current class, each added stat point. new const HEROES_ENERGY_PERSTAT[MAX_HEROES] = { 2, 2, 4, 1, 2, 3, 4 }; //Give x amount of mana of current class, each added stat point. new const LEVELS[MAX_LEVELS] = { 100, 200, 300, 400, 700, 900, 1100, 1400, 1700, 2000, 2400, 2900, 3000, 3500, 4200, 5000, 6000, 7500, 9000, 11000, 14000, 17000, 22000, 26000, 31000, 37000, 43000, 49000, 55000, 65000, 70000, 73000, 76000, 80000, 83000, 85000, 90000, 95000, 100000, 110000, 120000, 130000, 140000, 150000, 160000, 170000, 180000, 190000, 200000, 210000, 220000, 240000, 260000, 270000, 280000, 290000, 300000, 320000, 330000, 350000, 360000, 370000, 380000, 390000, 400000, 420000, 430000, 450000, 460000, 480000, 500000, 510000, 520000, 530000, 540000, 550000, 560000, 580000, 600000, 610000, 630000, 650000, 680000, 710000, 740000, 750000, 760000, 780000, 800000, 840000, 880000, 930000, 950000, 1000000, 1100000, 1300000, 1500000, 1700000, 2000000, 2500000 }; // XP Stuff new const MAX_PLAYER_MONEY[MAX_LEVELS] = { 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 150000, 150000, 150000, 150000, 150000, 150000, 150000, 150000, 150000, 150000, 200000, 200000, 200000, 200000, 200000, 200000, 200000, 200000, 200000, 200000, 300000, 300000, 300000, 300000, 300000, 300000, 300000, 300000, 300000, 300000, 400000, 400000, 400000, 400000, 400000, 400000, 400000, 400000, 400000, 400000, 500000, 500000, 500000, 500000, 500000, 500000, 500000, 500000, 500000, 500000, 700000, 700000, 700000, 700000, 700000, 700000, 700000, 700000, 700000, 700000, 900000, 900000, 900000, 900000, 1000000, 1000000, 1000000, 1000000, 1000000, 1000000 }; // Money Stuff new const MAX_PLAYER_MONEY_INV[MAX_LEVELS] = { 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 50000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 100000, 150000, 150000, 150000, 150000, 150000, 150000, 150000, 150000, 150000, 150000, 200000, 200000, 200000, 200000, 200000, 200000, 200000, 200000, 200000, 200000, 300000, 300000, 300000, 300000, 300000, 300000, 300000, 300000, 300000, 300000, 400000, 400000, 400000, 400000, 400000, 400000, 400000, 400000, 400000, 400000, 500000, 500000, 500000, 500000, 500000, 500000, 500000, 500000, 500000, 500000, 700000, 700000, 700000, 700000, 700000, 700000, 700000, 700000, 700000, 700000, 900000, 900000, 900000, 900000, 1000000, 1000000, 1000000, 1000000, 1000000, 1000000 }; // Inventory Money Stuff /*================================================================================ [End of edit stuff.] =================================================================================*/ /*================================================================================ [Others.] =================================================================================*/ // Non-player consts new const g_Objective_Ents[][] = { "func_bomb_target", "info_bomb_target", "hostage_entity", "monster_scientist", "func_hostage_rescue", "info_hostage_rescue", "info_vip_start", "func_vip_safetyzone", "func_escapezone", "armoury_entity" } new const Float:g_flCoordsHUD[][] = { {0.50, 0.40}, {0.56, 0.44}, {0.60, 0.50}, {0.56, 0.56}, {0.50, 0.60}, {0.44, 0.56}, {0.40, 0.50}, {0.44, 0.44} } enum { USE_OFF, USE_ON, USE_SET, USE_TOGGLE }; new const inventory_dir_name[] = "d2_origins"; new mod_name[32] = "Diablo II: LOD";
SMA: #include <amxmodx> #include <amxmisc> #include <fun> #include <cstrike> #include <hamsandwich> #include <fakemeta> #include <engine> #include <nvault> #include <sqlx> #define VERSION "2.3" // Main includes #include "diablo2LOD/const.inl" #include "diablo2LOD/vars.inl" #include "diablo2LOD/nvault.inl" #include "diablo2LOD/events.inl" #include "diablo2LOD/forwards.inl" #include "diablo2LOD/cvars.inl" #include "diablo2LOD/messages.inl" #include "diablo2LOD/menu.inl" #include "diablo2LOD/motd.inl" #include "diablo2LOD/public.inl" #include "diablo2LOD/entity.inl" #include "diablo2LOD/commands.inl" #include "diablo2LOD/items.inl" #include "diablo2LOD/classes.inl" #include "diablo2LOD/effects.inl" #include "diablo2LOD/stocks.inl" #include "diablo2LOD/mysql.inl" public plugin_init() { register_plugin("Diablo II : Lord of Destruction", VERSION, "xbatista"); register_cvar("d2lod_version", VERSION, FCVAR_SPONLY|FCVAR_SERVER) set_cvar_string("d2lod_version", VERSION) // Loads all cvars LoadCvars(); // Events register_event("HLTV", "Event_New_Round", "a", "1=0", "2=0"); register_event("CurWeapon", "Ev_CurWeapon", "be", "1=1"); register_event( "TeamInfo", "Ev_JoinTeam", "a") register_logevent("Logevent_Round_Start", 2, "1=Round_Start"); register_logevent("Event_Round_End", 2, "1=Round_End"); register_touch("Coins", "player", "Coins_Pickup") register_touch("ItemsDeath", "player", "Item_Touch") register_touch("PotionsDeath", "player", "Potion_Touch") register_think("trigger_camera", "PlayerCamera_Think") // Forwards RegisterHam(Ham_TakeDamage, "player", "fwd_PlayerDamaged"); RegisterHam(Ham_TakeDamage, "func_wall", "fwd_PlayerDamagedMonster"); RegisterHam(Ham_Spawn, "player", "fwd_PlayerSpawn", 1); RegisterHam(Ham_TraceAttack, "player", "fwd_TraceAttack"); RegisterHam(Ham_Killed, "player", "fwd_Killed"); RegisterHam(Ham_Killed, "player", "fwd_KilledPost", 1); RegisterHam(Ham_Touch, "weaponbox", "Fwd_Touch"); RegisterHam(Ham_Touch, "armoury_entity", "Fwd_Touch"); RegisterHam( Ham_Weapon_PrimaryAttack, "weapon_knife", "fwd_AttackSpeed" , 1 ); RegisterHam( Ham_Item_Deploy , "weapon_knife", "fwd_AttackSpeed", 1); new szWeaponName[ 24 ]; for ( new WeaponId = 1; WeaponId <= 30; WeaponId++ ) { if ( get_weaponname ( WeaponId, szWeaponName, charsmax ( szWeaponName ) ) ) { RegisterHam( Ham_CS_Item_GetMaxSpeed , szWeaponName, "fwd_ItemGetMaxSpeed", 1 ); } } register_forward(FM_ClientKill, "fwd_ClientKill"); register_forward(FM_CmdStart, "fwd_CmdStart"); register_forward(FM_GetGameDescription, "fwd_GameDescription"); register_forward(FM_ClientUserInfoChanged, "ClientUserInfoChanged"); register_forward(FM_Touch, "Entity_Touched"); // Get/register messages MsgSayText = get_user_msgid("SayText"); MsgHideWeapon = get_user_msgid("HideWeapon") MsgHideCrosshair = get_user_msgid("Crosshair") gmsgClCorpse = get_user_msgid("ClCorpse") register_message(get_user_msgid("StatusIcon"), "Message_StatusIcon") register_message(get_user_msgid("VGUIMenu"), "Message_VGUIMenu") g_iItemTook = CreateMultiForward("D2_Item_Gone", ET_IGNORE, FP_CELL, FP_CELL); g_DamagedbySkill = CreateMultiForward("d2_skill_takedamage", ET_IGNORE, FP_CELL, FP_CELL, FP_ARRAY); g_SkillSelected = CreateMultiForward("d2_skill_selected", ET_IGNORE, FP_CELL, FP_CELL); g_SkillFired = CreateMultiForward("d2_skill_fired", ET_IGNORE, FP_CELL); g_TakeDamage = CreateMultiForward("d2_takedamage", ET_IGNORE, FP_CELL, FP_CELL, FP_ARRAY); g_iLog = CreateMultiForward("d2_logged", ET_IGNORE, FP_CELL, FP_CELL); g_RangedDamage = CreateMultiForward("d2_ranged_takedamage", ET_IGNORE, FP_CELL, FP_CELL, FP_ARRAY); g_DaggerPoisonDamage = CreateMultiForward("d2_dagger_poisondamage", ET_IGNORE, FP_CELL, FP_CELL, FP_ARRAY); g_ActRangedShoot = CreateMultiForward("d2_ranged_actshoot", ET_IGNORE, FP_CELL, FP_CELL); // Other g_iMaxPlayers = get_maxplayers(); g_SyncHudCreate = CreateHudSyncObj(); g_SyncHudCreate_Avade = CreateHudSyncObj(); if ( get_pcvar_num(d2_advert) ) { set_task( get_pcvar_float(d2_advert_time), "Adv_Message", 0, _, _, "b"); } // Connect to MYSQL. set_task( 1.0, "MYSQLX_Init"); new Ent, Count; while( ( Ent = find_ent_by_class( Ent, "info_player_start" ) ) > 0 ) if( Count++ > 1 ) break; if( Count <= 1 ) g_iFakeplayer = -1; set_task( 2.0, "AddFakeClient" ); set_task( 1.0, "Spawn_Items"); set_task( 1.0, "Spawn_Items_Charsi") set_task( 1.0, "Spawn_Items_Akara") } public plugin_natives() { register_native("get_current_speed", "native_get_current_speed", 1); register_native("get_player_logged", "native_get_player_logged", 1); register_native("set_p_xp", "Set_Player_Xp", 1); register_native("get_p_xp", "native_get_p_xp", 1); register_native("get_p_hero", "native_get_p_hero", 1); register_native("get_p_level", "native_get_p_level", 1); register_native("set_p_mana", "Set_Player_Mana", 1); register_native("get_p_mana", "native_get_p_mana", 1); register_native("get_p_vitality", "native_get_p_vitality", 1); register_native("set_p_vitality", "native_set_p_vitality", 1); register_native("set_p_gold", "Set_Player_Coins", 1); register_native("set_p_gold_inventory", "Set_Player_CoinsInv", 1); register_native("get_p_gold_inventory", "native_get_p_gold_inventory", 1); register_native("get_p_gold", "native_get_p_gold", 1); register_native("get_p_item_wear_type", "Player_WItemType", 1); register_native("get_p_item_wear_data", "Player_WItemDataActive", 1); register_native("MAX_SKILLS_ACTIVE", "native_MAX_SKILLS_ACTIVE", 1); register_native("MAX_ITEMS_ACTIVE", "native_MAX_ITEMS_ACTIVE", 1); register_native("get_p_in_safezone", "native_get_p_in_safezone", 1); register_native("is_p_protected", "native_is_p_protected", 1); register_native("dmg_kill_player", "Native_Dmg_Kill_Player"); register_native("get_p_skill", "native_get_p_skill", 1); register_native("is_freezetime", "native_is_freezetime", 1); register_native("reset_p_model", "Set_Custom_Model", 1); register_native("get_p_item_count", "native_get_p_item_count", 1); register_native("get_p_item_is_worn", "native_get_p_item_is_worn", 1); register_native("get_p_maxhealth", "native_get_p_maxhealth", 1); register_native("set_p_maxhealth", "native_set_p_maxhealth", 1); register_native("IsPlayerNearByMonster", "native_get_p_near_monster", 1); register_native("drop_coins", "Native_Create_Coins"); register_native("set_user_model", "native_set_user_model"); } public client_connect(id) { set_user_info(id, "_vgui_menus", "1"); client_cmd(id, "cl_corpsestay %f", get_pcvar_float(d2_cl_corpsestay) ); g_Player_FirstTime_Connected[id] = true; // Resets all players Data Reset_Data(id); // Loads all player's Data if ( !is_user_bot(id) && g_iFakeplayer != id ) { if ( !get_pcvar_num(d2_save_type) ) { Load_Data(id); } else { set_task( 1.0, "MYSQLX_GetAllData", id); } } } public client_disconnect(id) { End_poison_damage(id); // Remove some task remove_task( id + TASKID_FIRSTCONNECT ); if ( get_pcvar_num(d2_3rdperson) ) { new iEnt = g_iCam[id] if( is_valid_ent(iEnt) ) { g_iCam[id] = 0 remove_entity(iEnt) } } // Reset some bools g_Player_FirstTime_Connected[id] = false; g_Player_Info[id] = false; g_iLogged[id] = false; if( g_iFakeplayer == id ) { g_iFakeplayer = 0; set_task( 1.5, "AddFakeClient" ); } // Reset model's forwards g_szModel[id][0] = 0 Set_Plugin_State(id, false) // Saves all player's Data if ( !is_user_bot(id) && g_iFakeplayer != id ) { if ( !get_pcvar_num(d2_save_type) ) { Save_Data( id ); } else { MYSQLX_Save_T( id ); } } } public plugin_precache() { LoadIniItems(); engfunc(EngFunc_PrecacheSound, LevelUp); engfunc(EngFunc_PrecacheSound, g_crossbow_shoot_sound); engfunc(EngFunc_PrecacheModel, "models/rpgrocket.mdl"); engfunc(EngFunc_PrecacheModel, g_w_mp); engfunc(EngFunc_PrecacheModel, g_w_hp); engfunc(EngFunc_PrecacheModel, g_w_coins); engfunc(EngFunc_PrecacheModel, g_w_item); engfunc(EngFunc_PrecacheModel, g_w_inventory); engfunc(EngFunc_PrecacheModel, g_w_charsi); engfunc(EngFunc_PrecacheModel, g_w_akara); engfunc(EngFunc_PrecacheModel, g_brassknuckles); engfunc(EngFunc_PrecacheModel, g_w_crossbow); engfunc(EngFunc_PrecacheModel, g_v_crossbow); engfunc(EngFunc_PrecacheModel, g_p_crossbow); // Forward to kill all entities <!-- s:) --><img src=\"{SMILIES_PATH}/icon_e_smile.gif\" alt=\":)\" title=\"mosoly\" /><!-- s:) --> register_forward(FM_Spawn, "fwd_Remove_Ents"); for (new item_id = 0; item_id <= g_charcounter; item_id++) { if ( item_data[item_id][CHAR_TYPE] != TYPE_WEAPON ) continue; if ( equal(item_vmodel[item_id], "models/", 7) ) { engfunc(EngFunc_PrecacheModel, item_vmodel[item_id]); } if ( equal(item_pmodel[item_id], "models/", 7) ) { engfunc(EngFunc_PrecacheModel, item_pmodel[item_id]); } } new Mdl_Path[100]; for(new i = 0; i < MAX_HEROES; i++) { formatex( Mdl_Path, sizeof Mdl_Path - 1, "models/player/%s/%s.mdl", Custom_Models[i], Custom_Models[i]) engfunc(EngFunc_PrecacheModel, Mdl_Path); formatex( Mdl_Path, sizeof Mdl_Path - 1, "models/player/%s/%sT.mdl", Custom_Models[i], Custom_Models[i]) if ( file_exists( Mdl_Path ) ) { engfunc(EngFunc_PrecacheModel, Mdl_Path); } } } public plugin_cfg() { get_configsdir(g_ConfigsDir, 63); formatex(g_ItemOriginDir, 63, "%s/%s", g_ConfigsDir, inventory_dir_name); new File[192]; formatex( File, charsmax( File ), "%s/d2conf.cfg", g_ConfigsDir ); if( !file_exists( File ) ) { server_print( "File %s doesn't exist!", File ); write_file( File, " ", -1 ); } else { server_print( "%s successfully loaded.", File ); server_cmd( "exec %s", File ); } if( !dir_exists(g_ItemOriginDir) ) { mkdir(g_ItemOriginDir); } else { new CurMap[32]; get_mapname(CurMap, 31); Load_Origins(CurMap); Load_Origins_Charsi(CurMap); Load_Origins_Akara(CurMap); } //Open our vault and have g_Vault store the handle. g_Nvault = nvault_open( "d2lod" ); g_Nvault2 = nvault_open( "d2lod2" ); g_Nvault3 = nvault_open( "d2lod3" ); } public plugin_end() { //Close the vault when the plugin ends (map change\server shutdown\restart) nvault_close( g_Nvault ); nvault_close( g_Nvault2 ); nvault_close( g_Nvault3 ); } public Float:native_get_current_speed(id) { return Current_Speed[id]; } public native_get_player_logged(id) { return g_iLogged[id]; } public native_get_p_xp(id) { return g_PlayerXp[id][g_CurrentChar[id]]; } public native_get_p_hero(id) { return g_PlayerHero[id][g_CurrentChar[id]]; } public native_get_p_level(id) { return g_PlayerLevel[id][g_CurrentChar[id]]; } public native_get_p_mana(id) { return g_CurrentMana[id]; } public native_get_p_vitality(id) { return g_Vitality[id][g_CurrentChar[id]]; } public native_set_p_vitality(id, value) { g_Vitality[id][g_CurrentChar[id]] = value; } public native_get_p_gold_inventory(id) { return g_CoinsInv[id][g_CurrentChar[id]]; } public native_get_p_gold(id) { return g_Coins[id][g_CurrentChar[id]]; } public native_MAX_SKILLS_ACTIVE() { return g_skillcounter + 1; } public native_MAX_ITEMS_ACTIVE() { return g_charcounter + 1; } public bool:native_get_p_in_safezone(id) { if ( !is_user_alive(id) || DISTANCE_INVENTORY_PLAYER <= 0.0 ) return false; new Float:Porigin[3]; entity_get_vector( id, EV_VEC_origin, Porigin); new ent = -1 while( (ent = find_ent_in_sphere( ent, Porigin, DISTANCE_INVENTORY_PLAYER)) != 0) { static classname[32]; pev( ent, pev_classname, classname, charsmax(classname) ); if( equal(classname, "Inventory") || equal(classname, "Charsi") || equal(classname, "Akara") ) { return true; } } return false; } public bool:native_get_p_near_charsi(id) { if ( !is_user_alive(id) || DISTANCE_INVENTORY_PLAYER <= 0.0 ) return false; new Float:Porigin[3]; entity_get_vector( id, EV_VEC_origin, Porigin); new ent = -1 while( (ent = find_ent_in_sphere( ent, Porigin, DISTANCE_INVENTORY_PLAYER)) != 0) { static classname[32]; pev( ent, pev_classname, classname, charsmax(classname) ); if( equal(classname, "Charsi") ) { return true; } } return false; } public bool:native_get_p_near_akara(id) { if ( !is_user_alive(id) || DISTANCE_INVENTORY_PLAYER <= 0.0 ) return false; new Float:Porigin[3]; entity_get_vector( id, EV_VEC_origin, Porigin); new ent = -1 while( (ent = find_ent_in_sphere( ent, Porigin, DISTANCE_INVENTORY_PLAYER)) != 0) { static classname[32]; pev( ent, pev_classname, classname, charsmax(classname) ); if( equal(classname, "Akara") ) { return true; } } return false; } public bool:native_get_p_near_inventory(id) { if ( !is_user_alive(id) || DISTANCE_INVENTORY_PLAYER <= 0.0 ) return false; new Float:Porigin[3]; entity_get_vector( id, EV_VEC_origin, Porigin); new ent = -1 while( (ent = find_ent_in_sphere( ent, Porigin, DISTANCE_INVENTORY_PLAYER)) != 0) { static classname[32]; pev( ent, pev_classname, classname, charsmax(classname) ); if( equal(classname, "Inventory") ) { return true; } } return false; } public bool:native_is_p_protected(id) { if ( g_PlayerProtected[id] ) return true; return false; } public native_get_p_skill(id, skill_id) { return g_iSkills[id][g_CurrentChar[id]][skill_id]; } public native_is_freezetime() { return g_FreezeTime; } public native_get_p_item_count(id, item_id) { return g_iPlayerItem[id][g_CurrentChar[id]][item_id]; } public native_get_p_item_is_worn(id, item_id) { return g_iPlayerItemWorn[id][g_CurrentChar[id]][item_id]; } public native_get_p_maxhealth(id) { return g_MaxHealth[id]; } public native_set_p_maxhealth(id, value) { g_MaxHealth[id] = value; if ( g_MaxHealth[id] < 0 ) { g_MaxHealth[id] = 0; } } // Checks if is player near monster public bool:native_get_p_near_monster(id) { if ( !is_user_alive(id) || DISTANCE_NEAR_MONSTER <= 0.0 ) return false; new Float:Porigin[3]; entity_get_vector( id, EV_VEC_origin, Porigin); new ent = -1 while( (ent = find_ent_in_sphere( ent, Porigin, DISTANCE_NEAR_MONSTER)) != 0) { if ( pev( ent, pev_flags ) & FL_MONSTER ) { return true; } } return false; }
de oda még kel a többi inl fálj is... azokat itt töltheted le http://data.hu/get/6206167/diablo2LOD.rar
|
|