Правила форума Гаранты форума
Размещение рекламы AMX-X компилятор

Здравствуйте, гость Вход | Регистрация

Наши новости:

14-дек
24-апр
10-апр
11-апр

Глобальная подмена оружия [ Под HL ]

Статус пользователя $@NyA
сообщение 9.10.2018, 13:04
Сообщение #1


Иконка группы

Стаж: 18 лет

Сообщений: 987
Благодарностей: 529
Полезность: 1050

Есть Хороший Код Коннора
Код:
#define VERSION "0.2.3"

// #define DONT_BLOCK_PRECACHE

#include <amxmodx>
#include <fakemeta_stocks>
#include <hamsandwich>

#pragma semicolon 1

const MAX_MODEL_LENGTH = 64;

new const m_rgpPlayerItems_CBasePlayer[6] = {367, 368, ...};
const m_pActiveItem = 373;

const XO_WEAPON = 4;
const m_pPlayer = 41;

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;

new Trie:tWeaponsIds = TrieCreate();
TrieSetCell(tWeaponsIds, "p228", CSW_P228);
TrieSetCell(tWeaponsIds, "scout", CSW_SCOUT);
TrieSetCell(tWeaponsIds, "hegrenade", CSW_HEGRENADE);
TrieSetCell(tWeaponsIds, "xm1014", CSW_XM1014);
TrieSetCell(tWeaponsIds, "c4", CSW_C4);
TrieSetCell(tWeaponsIds, "mac10", CSW_MAC10);
TrieSetCell(tWeaponsIds, "aug", CSW_AUG);
TrieSetCell(tWeaponsIds, "smokegrenade", CSW_SMOKEGRENADE);
TrieSetCell(tWeaponsIds, "elite", CSW_ELITE);
TrieSetCell(tWeaponsIds, "fiveseven", CSW_FIVESEVEN);
TrieSetCell(tWeaponsIds, "ump45", CSW_UMP45);
TrieSetCell(tWeaponsIds, "sg550", CSW_SG550);
TrieSetCell(tWeaponsIds, "galil", CSW_GALIL);
TrieSetCell(tWeaponsIds, "famas", CSW_FAMAS);
TrieSetCell(tWeaponsIds, "usp", CSW_USP);
TrieSetCell(tWeaponsIds, "glock18", CSW_GLOCK18);
TrieSetCell(tWeaponsIds, "awp", CSW_AWP);
TrieSetCell(tWeaponsIds, "mp5navy", CSW_MP5NAVY);
TrieSetCell(tWeaponsIds, "m249", CSW_M249);
TrieSetCell(tWeaponsIds, "m3", CSW_M3);
TrieSetCell(tWeaponsIds, "m4a1", CSW_M4A1);
TrieSetCell(tWeaponsIds, "tmp", CSW_TMP);
TrieSetCell(tWeaponsIds, "g3sg1", CSW_G3SG1);
TrieSetCell(tWeaponsIds, "flashbang", CSW_FLASHBANG);
TrieSetCell(tWeaponsIds, "deagle", CSW_DEAGLE);
TrieSetCell(tWeaponsIds, "sg552", CSW_SG552);
TrieSetCell(tWeaponsIds, "ak47", CSW_AK47);
TrieSetCell(tWeaponsIds, "knife", CSW_KNIFE);
TrieSetCell(tWeaponsIds, "p90", CSW_P90);

new c, bool:bServerDeactivateRegistered, iExtPos, bShieldModel;
while(!feof(iFile))
{
fgets(iFile, szDatas, charsmax(szDatas));
trim(szDatas);
if(!(c=szDatas[0]) || c == ';' || c == '#' || (c == '/' && szDatas[1] == '/'))
{
continue;
}

if( parse(szDatas, szOldModel, charsmax(szOldModel), szNewModel, charsmax(szNewModel)) == 2
&& file_exists(szNewModel) )
{
// models/[p/v]_
// models/shield/[p/v]_shield_
bShieldModel = equal(szOldModel, "models/shield/", 14);
if( ( (c=szOldModel[bShieldModel ? 14 : 7]) == 'p' || c == 'v' ) && szOldModel[bShieldModel ? 15 : 8] == '_' )
{
if( equal(szOldModel[9], "mp5", 3 ) )
{
copy(szWeaponClass, charsmax(szWeaponClass), "weapon_mp5navy");
}
else
{
iExtPos = strlen(szOldModel) - 4;
szOldModel[ iExtPos ] = EOS;
formatex(szWeaponClass, charsmax(szWeaponClass), "weapon_%s", szOldModel[bShieldModel ? 23 : 9]);
szOldModel[ iExtPos ] = '.';
}

if( !TrieGetCell(tWeaponsIds, szWeaponClass[7], iId) )
{
continue;
}

if( c == 'v' )
{
if( !g_tiszViewModels )
{
g_tiszViewModels = TrieCreate();
}

TrieSetCell(g_tiszViewModels, szOldModel, EF_AllocString( szNewModel ) );
}
else
{
if( !g_tiszWeaponModels )
{
g_tiszWeaponModels = TrieCreate();
}

TrieSetCell(g_tiszWeaponModels, szOldModel, EF_AllocString( szNewModel ) );
}

if( !TrieKeyExists(tRegisterWeaponDeploy, szWeaponClass) )
{
TrieSetCell
(
tRegisterWeaponDeploy,
szWeaponClass,
RegisterHam(Ham_Item_Deploy, szWeaponClass, "OnCBasePlayerWeapon_Deploy_P", true)
);
}
}
else
{
if( !bServerDeactivateRegistered && equal(szOldModel, "models/w_backpack.mdl") )
{
bServerDeactivateRegistered = true;
register_forward(FM_ServerDeactivate, "OnServerDeactivate");
}

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);
}

if( !g_tiPrecacheReturns )
{
g_tiPrecacheReturns = TrieCreate();
}
TrieSetCell(g_tiPrecacheReturns, szOldModel, EF_PrecacheModel(szNewModel));
#if defined DONT_BLOCK_PRECACHE
EF_PrecacheModel(szOldModel);
#endif
}
}
fclose(iFile);

TrieDestroy(tRegisterWeaponDeploy);
TrieDestroy(tWeaponsIds);

if( g_tiPrecacheReturns )
{
register_forward(FM_PrecacheModel, "OnPrecacheModel");

if( g_tszWorldModels )
{
register_forward(FM_SetModel, "OnSetModel");
}
}
}

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
}
}
}

public OnPrecacheModel(const szModel[])
{
static iReturn;
if( TrieGetCell(g_tiPrecacheReturns, szModel, iReturn) )
{
forward_return(FMV_CELL, iReturn);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}

public OnCBasePlayerWeapon_Deploy_P( iWeapon )
{
new id = get_pdata_cbase(iWeapon, m_pPlayer, XO_WEAPON);
if( pev_valid(id) == 2 && get_pdata_cbase(id, m_pActiveItem) == iWeapon )
{
new iszNewModel, szOldModel[MAX_MODEL_LENGTH];
if( g_tiszViewModels )
{
pev(id, pev_viewmodel2, szOldModel, charsmax(szOldModel));
if( TrieGetCell(g_tiszViewModels, szOldModel, iszNewModel) )
{
set_pev(id, pev_viewmodel, iszNewModel);
}
}
if( g_tiszWeaponModels )
{
pev(id, pev_weaponmodel2, szOldModel, charsmax(szOldModel));
if( TrieGetCell(g_tiszWeaponModels, szOldModel, iszNewModel) )
{
set_pev(id, pev_weaponmodel, iszNewModel);
}
}
}
}

public OnSetModel(const iEnt, const szModel[])
{
new szNewModel[MAX_MODEL_LENGTH];
if( TrieGetString(g_tszWorldModels, szModel, szNewModel, charsmax(szNewModel)) )
{
EF_SetModel(iEnt, szNewModel);
return FMRES_SUPERCEDE;
}
return FMRES_IGNORED;
}


В Халф-Лайф к сожалению другие оружия
Удалось отыскать Код

Код:
    TrieSetCell(g_WeaponNames, "weapon_crowbar", HLW_CROWBAR)
TrieSetCell(g_WeaponNames, "weapon_9mmhandgun", HLW_GLOCK)
TrieSetCell(g_WeaponNames, "weapon_357", HLW_PYTHON)
TrieSetCell(g_WeaponNames, "weapon_9mmAR", HLW_MP5)
TrieSetCell(g_WeaponNames, "weapon_shotgun", HLW_SHOTGUN)
TrieSetCell(g_WeaponNames, "weapon_crossbow", HLW_CROSSBOW)
TrieSetCell(g_WeaponNames, "rpg_rocket", HLW_RPG)
TrieSetCell(g_WeaponNames, "weapon_gauss", HLW_GAUSS)
TrieSetCell(g_WeaponNames, "weapon_egon", HLW_EGON)
TrieSetCell(g_WeaponNames, "hornet", HLW_HORNETGUN)
TrieSetCell(g_WeaponNames, "grenade", HLW_HANDGRENADE)
TrieSetCell(g_WeaponNames, "monster_satchel", HLW_SATCHEL)
TrieSetCell(g_WeaponNames, "monster_tripmine", HLW_TRIPMINE)
TrieSetCell(g_WeaponNames, "monster_snark", HLW_SNARK)
TrieSetCell(g_WeaponNames, "bolt", HLW_BOLT)
TrieSetCell(g_WeaponNames, "tank", HLW_TANK)
TrieSetCell(g_WeaponNames, "ARgrenade", HLW_HANDGRENADE)
TrieSetCell(g_WeaponNames, "func_tank", HLW_TANK)
TrieSetCell(g_WeaponNames, "func_tankmortar", HLW_TANK)
TrieSetCell(g_WeaponNames, "func_tankrocket", HLW_TANK)
TrieSetCell(g_WeaponNames, "func_tanklaser", HLW_TANK)


Пробовал тупо подменить етот код на тот,что в кс по оружию.
Всё там компилируеться ,но подмены нет.

Ну можно ещё потом выпилить щит

Скорее ещё что-то нужно.
Подскажите и помогите


МультиМод CS
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   Цитировать сообщение
Статус пользователя $@NyA
сообщение 9.10.2018, 14:14
Сообщение #2


Иконка группы

Стаж: 18 лет

Сообщений: 987
Благодарностей: 529
Полезность: 1050

Если что, также оффсеты для ХЛ
Код:
// CBasePlayerItem - linux dif 4
CBasePlayer* m_pPlayer 28 // ( get_pdata_cbase() )
CBasePlayerItem* m_pNext 29 // ( get_pdata_cbase() )
int m_iId 30 // HLW_*.

// 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

// CTripmineGrenade (monster_tripmine) - linux dif 4
float m_flPowerUp 166
float m_vecEnd 170-172
float m_flBeamLength 173
CBeam* m_pBeam 176
Vector m_posOwner; 180
Vector m_angleOwner; 192
edict_t* m_pRealOwner; 204

// 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


МультиМод CS
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
  Ответить в данную темуНачать новую тему
 
0 пользователей и 1 гостей читают эту тему: