mirror of
https://github.com/alliedmodders/amxmodx.git
synced 2025-01-12 14:58:06 +03:00
NS b5 stuffs
This commit is contained in:
parent
276886022e
commit
5c72931b94
@ -3,33 +3,33 @@
|
||||
int get_private(edict_t *pEntity, int woffset,int loffset)
|
||||
{
|
||||
#ifdef __linux__
|
||||
return *((int *)pEntity->pvPrivateData + loffset);
|
||||
return *(int*)((char*)(pEntity->pvPrivateData)+loffset);
|
||||
#else
|
||||
return *((int *)pEntity->pvPrivateData + woffset);
|
||||
return *(int*)((char*)(pEntity->pvPrivateData)+woffset);
|
||||
#endif
|
||||
}
|
||||
REAL get_private_f(edict_t *pEntity, int woffset, int loffset)
|
||||
{
|
||||
#ifdef __linux__
|
||||
return *((REAL *)pEntity->pvPrivateData + loffset);
|
||||
return *(REAL*)((char*)(pEntity->pvPrivateData)+loffset);
|
||||
#else
|
||||
return *((REAL *)pEntity->pvPrivateData + woffset);
|
||||
return *(REAL*)((char*)(pEntity->pvPrivateData)+woffset);
|
||||
#endif
|
||||
}
|
||||
void set_private(edict_t *pEntity, int woffset, int loffset, int value)
|
||||
{
|
||||
#ifdef __linux__
|
||||
*((int *)pEntity->pvPrivateData + loffset) = value;
|
||||
*(int*)((char*)(pEntity->pvPrivateData)+loffset) = value;
|
||||
#else
|
||||
*((int *)pEntity->pvPrivateData + woffset) = value;
|
||||
*(int*)((char*)(pEntity->pvPrivateData)+woffset) = value;
|
||||
#endif
|
||||
}
|
||||
void set_private(edict_t *pEntity, int woffset, int loffset, REAL value)
|
||||
{
|
||||
#ifdef __linux__
|
||||
*((REAL *)pEntity->pvPrivateData + loffset) = value;
|
||||
*(REAL*)((char*)(pEntity->pvPrivateData)+loffset) = value;
|
||||
#else
|
||||
*((REAL *)pEntity->pvPrivateData + woffset) = value;
|
||||
*(REAL*)((char*)(pEntity->pvPrivateData)+woffset) = value;
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -317,6 +317,35 @@ static cell AMX_NATIVE_CALL ns_set_icon(AMX *amx, cell *params)
|
||||
return 1;
|
||||
}
|
||||
|
||||
static cell AMX_NATIVE_CALL ns_get_struct_owner(AMX *amx, cell *params)
|
||||
{
|
||||
int id = params[1];
|
||||
if (id <= gpGlobals->maxClients || id <= gpGlobals->maxEntities)
|
||||
return 0;
|
||||
edict_t *pEntity = INDEXENT2(id);
|
||||
if (!pEntity)
|
||||
return 0;
|
||||
if (pEntity->pvPrivateData == NULL)
|
||||
return 0;
|
||||
return get_private(pEntity,OFFSET_WIN_STRUCTOWNER,OFFSET_LIN_STRUCTOWNER);
|
||||
}
|
||||
static cell AMX_NATIVE_CALL ns_set_struct_owner(AMX *amx, cell *params)
|
||||
{
|
||||
int id = params[1];
|
||||
int ido = params[2];
|
||||
if (id <= gpGlobals->maxClients || id <= gpGlobals->maxEntities)
|
||||
return 0;
|
||||
if (ido > gpGlobals->maxClients || ido < -1)
|
||||
return 0;
|
||||
edict_t *pEntity = INDEXENT2(id);
|
||||
if (!pEntity)
|
||||
return 0;
|
||||
if (pEntity->pvPrivateData == NULL)
|
||||
return 0;
|
||||
set_private(pEntity,OFFSET_WIN_STRUCTOWNER,OFFSET_LIN_STRUCTOWNER,ido);
|
||||
return 1;
|
||||
}
|
||||
|
||||
AMX_NATIVE_INFO ns_pdata_natives[] = {
|
||||
/*****************/
|
||||
{ "ns_get_res", ns_get_res },
|
||||
@ -352,6 +381,9 @@ AMX_NATIVE_INFO ns_pdata_natives[] = {
|
||||
{ "ns_get_hive_trait", ns_get_hive_trait },
|
||||
{ "ns_set_hive_trait", ns_set_hive_trait },
|
||||
|
||||
{ "ns_get_struct_owner", ns_get_struct_owner },
|
||||
{ "ns_set_struct_owner", ns_set_struct_owner },
|
||||
|
||||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
|
Binary file not shown.
@ -214,10 +214,13 @@
|
||||
Name="Miscellaneous"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
|
||||
<File
|
||||
RelativePath=".\include\ns.inc">
|
||||
RelativePath="..\..\plugins\include\ns.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\ns_const.inc">
|
||||
RelativePath="..\..\plugins\include\ns2amx.inc">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\plugins\include\ns_const.inc">
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
|
@ -7,56 +7,57 @@
|
||||
// Offsets (used in NPData.cpp)
|
||||
|
||||
#define OFFSET_WIN_RESOURCES 400
|
||||
#define OFFSET_LIN_RESOURCES 405
|
||||
#define OFFSET_LIN_RESOURCES 1612
|
||||
|
||||
#define OFFSET_WIN_WEAPDMG 49
|
||||
#define OFFSET_LIN_WEAPDMG 53
|
||||
#define OFFSET_LIN_WEAPDMG 208
|
||||
|
||||
#define OFFSET_WIN_WEAPRANGE 48
|
||||
#define OFFSET_LIN_WEAPRANGE 52
|
||||
#define OFFSET_LIN_WEAPRANGE 204
|
||||
|
||||
#define OFFSET_WIN_WEAPCLIP 41
|
||||
#define OFFSET_LIN_WEAPCLIP 45
|
||||
#define OFFSET_LIN_WEAPCLIP 176
|
||||
|
||||
#define OFFSET_WIN_HIVE_TRAIT 67
|
||||
#define OFFSET_LIN_HIVE_TRAIT 67
|
||||
#define OFFSET_LIN_HIVE_TRAIT 284
|
||||
|
||||
#define OFFSET_WIN_SCORE 1570
|
||||
#define OFFSET_LIN_SCORE 1567
|
||||
#define OFFSET_LIN_SCORE 6292
|
||||
|
||||
#define OFFSET_WIN_EXP 1557
|
||||
#define OFFSET_LIN_EXP 1554
|
||||
#define OFFSET_LIN_EXP 6240
|
||||
|
||||
#define OFFSET_WIN_POINTS 1559
|
||||
#define OFFSET_LIN_POINTS 1556
|
||||
#define OFFSET_LIN_POINTS 6248
|
||||
|
||||
#define OFFSET_WIN_AMMO_LMG 230
|
||||
#define OFFSET_LIN_AMMO_LMG 235
|
||||
#define OFFSET_LIN_AMMO_LMG 932
|
||||
|
||||
#define OFFSET_WIN_AMMO_PISTOL 231
|
||||
#define OFFSET_LIN_AMMO_PISTOL 236
|
||||
#define OFFSET_LIN_AMMO_PISTOL 936
|
||||
|
||||
#define OFFSET_WIN_AMMO_SHOTGUN 232
|
||||
#define OFFSET_LIN_AMMO_SHOTGUN 237
|
||||
#define OFFSET_LIN_AMMO_SHOTGUN 940
|
||||
|
||||
|
||||
#define OFFSET_WIN_AMMO_HMG 233
|
||||
#define OFFSET_LIN_AMMO_HMG 238
|
||||
#define OFFSET_LIN_AMMO_HMG 944
|
||||
|
||||
|
||||
#define OFFSET_WIN_AMMO_GL 234
|
||||
#define OFFSET_LIN_AMMO_GL 239
|
||||
#define OFFSET_LIN_AMMO_GL 948
|
||||
|
||||
#define OFFSET_WIN_AMMO_HG 235
|
||||
#define OFFSET_LIN_AMMO_HG 240
|
||||
#define OFFSET_LIN_AMMO_HG 952
|
||||
|
||||
#define OFFSET_WIN_DEATHS 296
|
||||
#define OFFSET_LIN_DEATHS 301
|
||||
#define OFFSET_LIN_DEATHS 1196
|
||||
|
||||
#define OFFSET_WIN_ICON 1572
|
||||
#define OFFSET_LIN_ICON 1569
|
||||
|
||||
#define OFFSET_LIN_ICON 6300
|
||||
|
||||
#define OFFSET_WIN_STRUCTOWNER 30
|
||||
#define OFFSET_LIN_STRUCTOWNER 136
|
||||
|
||||
|
||||
|
||||
@ -254,25 +255,5 @@ enum classes
|
||||
};
|
||||
|
||||
|
||||
|
||||
#define MENUDEFAULT_CHANNEL 10;
|
||||
#define MENUDEFAULT_CHANNEL2 11;
|
||||
#define MENUDEFAULT_EFFECT 0;
|
||||
#define MENUDEFAULT_FADEINTIME 0.1;
|
||||
#define MENUDEFAULT_FADEOUTTIME 0.1;
|
||||
#define MENUDEFAULT_FXTIME 0.1;
|
||||
#define MENUDEFAULT_RED1 255;
|
||||
#define MENUDEFAULT_GREEN1 255;
|
||||
#define MENUDEFAULT_BLUE1 255;
|
||||
#define MENUDEFAULT_ALPHA1 255;
|
||||
#define MENUDEFAULT_RED2 255;
|
||||
#define MENUDEFAULT_GREEN2 255;
|
||||
#define MENUDEFAULT_BLUE2 255;
|
||||
#define MENUDEFAULT_ALPHA2 255;
|
||||
#define MENUDEFAULT_X 0.2;
|
||||
#define MENUDEFAULT_Y 0.3;
|
||||
#define MENUDEFAULT_HOLDTIME 30.0;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user