new Trie:g_tszWorldModels; // handles new models strings (all excepted v_ and w_ models) new Trie:g_tiPrecacheReturns; // handles all new models precache returns integers new Trie:g_tiszViewModels; new Trie:g_tiszWeaponModels;
public plugin_precache() { new szModelsFile[128]; get_localinfo("amxx_configsdir", szModelsFile, charsmax(szModelsFile)); add(szModelsFile, charsmax(szModelsFile), "/new_weapons_HD.ini");
new iFile = fopen(szModelsFile, "rt"); if(!iFile) { return; }
new szDatas[192], szOldModel[MAX_MODEL_LENGTH], szNewModel[MAX_MODEL_LENGTH]; new szWeaponClass[32], Trie:tRegisterWeaponDeploy = TrieCreate(), iId;
if( !g_tszWorldModels ) { g_tszWorldModels = TrieCreate(); } else if( TrieKeyExists(g_tszWorldModels, szOldModel) ) { new szModel[MAX_MODEL_LENGTH]; TrieGetString(g_tszWorldModels, szOldModel, szModel, charsmax(szModel)); log_amx("%s world model is already set to %s, can't set it to %s !!", szWeaponClass, szModel, szNewModel); continue; } TrieSetString(g_tszWorldModels, szOldModel, szNewModel); }
public plugin_init() { register_plugin("Weapons Models", VERSION, "ConnorMcLeod"); }
public OnServerDeactivate() { static bool:bDontPassThisTwice = false; if( bDontPassThisTwice ) // unregister this would be waste of time { return; } bDontPassThisTwice = true;
new id, c4 = FM_NULLENT; while( (c4 = EF_FindEntityByString(c4, "classname", "weapon_c4")) > 0 ) { id = get_pdata_cbase(c4, m_pPlayer); if( id > 0 ) { // can't use set_pdata_cbase on players at this point set_pdata_int(id, m_rgpPlayerItems_CBasePlayer[5], 0); set_pdata_int(id, m_pActiveItem, 0); // tried to remove c4 entity but server just stucks } } }
Пробовал тупо подменить етот код на тот,что в кс по оружию.Всё там компилируеться ,но подмены нет.
Как видишь, там в коде Коннора класс оружия написанный без приставки weapon_ , она уже позже добавляется в коде formatex(szWeaponClass, charsmax(szWeaponClass), "weapon_%s", szOldModel[bShieldModel ? 23 : 9]). А ты замутил полные названия, дак ещё и не все классы оружия в HL имеют приставку weapon_ судя по коду который тебе "удалось отыскать". Я кстате видел такой список:
weapon_357
weapon_9mmAR
weapon_9mmhandgun
weapon_crossbow
weapon_crowbar
weapon_egon
weapon_gauss
weapon_handgrenade
weapon_hornetgun
weapon_rpg
weapon_satchel
weapon_shotgun
weapon_snark
weapon_tripmine
Подозреваю что у тебя немного не тот список, например: rpg_rocket, я подозреваю, что ентити ракеты, которая уже вылетела и летит к цели, а не ентити оружия-РПГ.
Сообщение отредактировал Deadly_Darkness - Вторник, 09.10.2018, 15:18
// CBasePlayerWeapon - linux dif 4 int m_iPlayEmptySound 31 // None. int m_fFireOnEmpty 32 // None. float m_flPumpTime 33 // None. int m_fInSpecialReload 34 // Are we in the middle of a reload for the shotguns float m_flNextPrimaryAttack 35 // soonest time ItemPostFrame will call PrimaryAttack float m_flNextSecondaryAttack 36 // soonest time ItemPostFrame will call SecondaryAttack float m_flTimeWeaponIdle 37 // soonest time ItemPostFrame will call WeaponIdle int m_iPrimaryAmmoType 38 // "primary" ammo index into players m_rgAmmo[] int m_iSecondaryAmmoType 39 // "secondary" ammo index into players m_rgAmmo[] int m_iClip 40 // number of shots left in the primary weapon clip, -1 it not used int m_iClientClip 41 // the last version of m_iClip sent to hud dll int m_iClientWeaponState 42 // the last version of the weapon state sent to hud dll (is current weapon, is on target) int m_fInReload 43 // Are we in the middle of a reload; int m_iDefaultAmmo 44 // How much ammo you get when you pick up this weapon as placed by a level designer
// Weaponbox int iBPAmmo 60 // ammo in weapombox
// CPython (weapon_python) - linux dif 4 int m_fInZoom 45 // Are we in zoom
// CCrossbow (weapon_crossbow) - linux dif 4 int m_fInZoom 45 // Are we in zoom
// CGauss (weapon_gauss) - linux dif 4 int m_fInAttack 19 // gauss attack mode int m_fPrimaryFire 49 // Is primary attack
// CRpg (weapon_rpg) - linux dif 4 CLaserSpot* m_pSpot 45 // laserdot entity int m_fSpotActive 46 // is laserdot active
// CRpgRocket - linux dif 4 CRpg m_pLauncher 168 // remember what RPG fired me
// CSqueakGrenade (monster_tripmine) - linux dif 4 float m_flDie 166 // detonation time
// CSatchel (weapon_satchel) - linux dif 4 int m_chargeReady 18
// CBaseMonster - linux dif 5 Activity m_Activity 88 // what the monster is doing (animation). Activity m_IdealActivity 89 // monster should switch to this activity. int m_LastHitGroup 90 // the last body region that took damage float m_flNextAttack 148 // cannot attack again until this time int m_bitsDamageType 149 // what types of damage has monster (player) taken EHANDLE m_hEnemy 244 // the entity that the monster is fighting. int m_lastDamageAmount 270 // Last damage taken
// CBasePlayer (player) - linux dif 5 int m_iFlashBattery 178 // Flashlight Battery Draw int m_afButtonPressed 179 float m_flSndRange ??184 // dist from player to sound entity float m_flFallVelocity 185 // Player's fall speed int m_rgItems[MAX_ITEMS] 186-190 int m_fKnownItem 191 // True when a new item needs to be added int m_fNewAmmo 192 // True when a new item has been added unsigned int m_afPhysicsFlags 193 // physics flags - set when 'normal' physics should be revisited or overriden float m_fNextSuicideTime ??194 // the time after which the player can next use the suicide command BOOL m_fLongJump 291 // does this player have the longjump module? int m_iFOV 298 // Field of view. int m_iClientFOV 299 // Client's known FOV. int m_pActiveItem 306 // (get_pdata_cbase) int m_pClientActiveItem 307 // Client version of the active item. (get_pdata_cbase) int m_pLastItem 308 // (get_pdata_cbase) int m_rgAmmo 310-321 // Shared ammo slots. int m_rgAmmoLast 342-353 // Shared ammo slots. int m_iDeaths 377 // Player deaths
// CWallHealth (func_healthcharger) and CRecharge (func_recharge) - linux dif 4 int m_iJuice 62 // healthcharger capacity int m_iOn 63 // 0 = off, 1 = startup, 2 = going float m_flSoundTime 64