diff --git a/plugins/include/fakemeta.inc b/plugins/include/fakemeta.inc new file mode 100755 index 00000000..437277d1 --- /dev/null +++ b/plugins/include/fakemeta.inc @@ -0,0 +1,38 @@ +/* FakeMeta functions + * This file is provided as-is with no warrenties. + */ + +#if defined _fakemeta_included + #endinput +#endif +#define _fakemeta_included + +#include + +/* Returns entvar data from an entity Use the pev_* enum to specify which form of data you want returned. */ +native pev(_index,_value,{Float,_}:...) + +/* Sets entvar data for an entity. Use the pev_* enum */ +native set_pev(_index,_value,{Float,_}:...) + +/* Returns an integer from private data. _linuxdiff is added into the _Offset if it's used on a linux server. */ +native get_pdata_int(_index,_Offset,_linuxdiff=5); + +/* Sets an integer from private data. _linuxdiff is added into the _Offset if it's used on a linux server. */ +native set_pdata_int(_index,_Offset,_Value,_linuxdiff=5); + +/* Returns a float from private data. _linuxdiff is added into the _Offset if it's used on a linux server. */ +native Float:get_pdata_float(_index,_Offset,_linuxdiff=5); + +/* Sets a float from private data. _linuxdiff is added into the _Offset if it's used on a linux server. */ +native set_pdata_float(_index,_Offset,Float:_Value,_linuxdiff=5); + + +/* Registers a forward */ +native register_forward(_forwardType,_function[],_post=0); + +/* Returns data for metamod */ +native forward_return(type,{Float,_}:...); + +native engfunc(type,{Float,_}:...); +native dllfunc(type,{Float,_}:...); \ No newline at end of file diff --git a/plugins/include/fakemeta_const.inc b/plugins/include/fakemeta_const.inc new file mode 100755 index 00000000..c0f5f96f --- /dev/null +++ b/plugins/include/fakemeta_const.inc @@ -0,0 +1,429 @@ +/* Fake meta constants + * This file is provided as-is (no warrenties) + */ +#if defined _fakemeta_included + #endinput +#endif +#define _fakemeta_included + +// For forward_return +#define FMV_STRING 1 +#define FMV_FLOAT 2 +#define FMV_CELL 3 + + +// The actual return value of the function +#define FMRES_HANDLED 2 +#define FMRES_SUPERCEDE 4 +#define FMRES_IGNORED 1 +#define FMRES_OVERRIDE 3 + + + +enum { + EngFunc_PrecacheModel, // int ) (char* s); + EngFunc_PrecacheSound, // int ) (char* s); + EngFunc_SetModel, // void ) (edict_t *e, const char *m); + EngFunc_ModelIndex, // int ) (const char *m); + EngFunc_ModelFrames, // int ) (int modelIndex); + EngFunc_SetSize, // void ) (edict_t *e, const float *rgflMin, const float *rgflMax); + EngFunc_ChangeLevel, // void ) (char* s1, char* s2); + EngFunc_VecToYaw, // float) (const float *rgflVector); + EngFunc_VecToAngles, // void ) (const float *rgflVectorIn, float *rgflVectorOut); + EngFunc_MoveToOrigin, // void ) (edict_t *ent, const float *pflGoal, float dist, int iMoveType); + EngFunc_ChangeYaw, // void ) (edict_t* ent); + EngFunc_ChangePitch, // void ) (edict_t* ent); + EngFunc_FindEntityByString, // edict) (edict_t *pEdictStartSearchAfter, const char *pszField, const char *pszValue); + EngFunc_GetEntityIllum, // int ) (edict_t* pEnt); + EngFunc_FindEntityInSphere, // edict) (edict_t *pEdictStartSearchAfter, const float *org, float rad); + EngFunc_FindClientInPVS, // edict) (edict_t *pEdict); + EngFunc_EntitiesInPVS, // edict) (edict_t *pplayer); + EngFunc_MakeVectors, // void ) (const float *rgflVector); + EngFunc_AngleVectors, // void ) (const float *rgflVector, float *forward, float *right, float *up); + EngFunc_CreateEntity, // edict) (void); + EngFunc_RemoveEntity, // void ) (edict_t* e); + EngFunc_CreateNamedEntity, // edict) (int className); + EngFunc_MakeStatic, // void ) (edict_t *ent); + EngFunc_EntIsOnFloor, // int ) (edict_t *e); + EngFunc_DropToFloor, // int ) (edict_t* e); + EngFunc_WalkMove, // int ) (edict_t *ent, float yaw, float dist, int iMode); + EngFunc_SetOrigin, // void ) (edict_t *e, const float *rgflOrigin); + EngFunc_EmitSound, // void ) (edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch); + EngFunc_EmitAmbientSound, // void ) (edict_t *entity, float *pos, const char *samp, float vol, float attenuation, int fFlags, int pitch); + EngFunc_TraceLine, // void ) (const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); + EngFunc_TraceToss, // void ) (edict_t* pent, edict_t* pentToIgnore, TraceResult *ptr); + EngFunc_TraceMonsterHull, // int ) (edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); + EngFunc_TraceHull, // void ) (const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); + EngFunc_TraceModel, // void ) (const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); + EngFunc_TraceTexture, // const char *) (edict_t *pTextureEntity, const float *v1, const float *v2 ); + EngFunc_TraceSphere, // void ) (const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); + EngFunc_GetAimVector, // void ) (edict_t* ent, float speed, float *rgflReturn); + EngFunc_ParticleEffect, // void ) (const float *org, const float *dir, float color, float count); + EngFunc_LightStyle, // void ) (int style, char* val); + EngFunc_DecalIndex, // int ) (const char *name); + EngFunc_PointContents, // int ) (const float *rgflVector); + EngFunc_FreeEntPrivateData, // void ) (edict_t *pEdict); + EngFunc_SzFromIndex, // const char * ) (int iString); + EngFunc_AllocString, // int ) (const char *szValue); + EngFunc_RegUserMsg, // int ) (const char *pszName, int iSize); + EngFunc_AnimationAutomove, // void ) (const edict_t* pEdict, float flTime); + EngFunc_GetBonePosition, // void ) (const edict_t* pEdict, int iBone, float *rgflOrigin, float *rgflAngles ); + EngFunc_GetAttachment, // void ) (const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); + EngFunc_SetView, // void ) (const edict_t *pClient, const edict_t *pViewent ); + EngFunc_Time, // float) ( void ); + EngFunc_CrosshairAngle, // void ) (const edict_t *pClient, float pitch, float yaw); + EngFunc_FadeClientVolume, // void ) (const edict_t *pEdict, int fadePercent, int fadeOutSeconds, int holdTime, int fadeInSeconds); + EngFunc_SetClientMaxspeed, // void ) (const edict_t *pEdict, float fNewMaxspeed); + EngFunc_CreateFakeClient, // edict) (const char *netname); // returns NULL if fake client can't be created + EngFunc_RunPlayerMove, // void ) (edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec ); + EngFunc_NumberOfEntities, // int ) (void); + EngFunc_StaticDecal, // void ) ( const float *origin, int decalIndex, int entityIndex, int modelIndex ); + EngFunc_PrecacheGeneric, // int ) (char* s); + EngFunc_BuildSoundMsg, // void ) (edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); + EngFunc_GetPhysicsKeyValue, // const char* ) ( const edict_t *pClient, const char *key ); + EngFunc_SetPhysicsKeyValue, // void ) ( const edict_t *pClient, const char *key, const char *value ); + EngFunc_GetPhysicsInfoString,// const char* ) ( const edict_t *pClient ); + EngFunc_PrecacheEvent, // unsigned short ) ( int type, const char*psz ); + EngFunc_PlaybackEvent, // void ) ( int flags, const edict_t *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ); + EngFunc_CheckVisibility, //) ( const edict_t *entity, unsigned char *pset ); + EngFunc_GetCurrentPlayer, //) ( void ); + EngFunc_CanSkipPlayer, //) ( const edict_t *player ); + EngFunc_SetGroupMask, //) ( int mask, int op ); + EngFunc_GetClientListening, // bool (int iReceiver, int iSender) + EngFunc_SetClientListening, // bool (int iReceiver, int iSender, bool Listen) + EngFunc_MessageBegin, // void (int msg_dest, int msg_type, const float *pOrigin, edict_t *ed) + EngFunc_WriteCoord, // void (float) + EngFunc_WriteAngle, // void (float) + EngFunc_InfoKeyValue, // char* ) (char *infobuffer, char *key); + EngFunc_SetKeyValue, // void ) (char *infobuffer, char *key, char *value); + EngFunc_SetClientKeyValue // void ) (int clientIndex, char *infobuffer, char *key, char *value); +}; + +enum +{ + DLLFunc_GameInit, // void) ( void ); + DLLFunc_Spawn, // int ) ( edict_t *pent ); + DLLFunc_Think, // void ) ( edict_t *pent ); + DLLFunc_Use, // void ) ( edict_t *pentUsed, edict_t *pentOther ); + DLLFunc_Touch, // void ) ( edict_t *pentTouched, edict_t *pentOther ); + DLLFunc_Blocked, // void ) ( edict_t *pentBlocked, edict_t *pentOther ); + DLLFunc_KeyValue, // void ) ( edict_t *pentKeyvalue, KeyValueData *pkvd ); + DLLFunc_SetAbsBox, // void ) ( edict_t *pent ); + DLLFunc_ClientConnect, // bool) ( edict_t *pEntity, const char *pszName, const char *pszAddress, char szRejectReason[ 128 ] ); + + DLLFunc_ClientDisconnect, // void ) ( edict_t *pEntity ); + DLLFunc_ClientKill, // void ) ( edict_t *pEntity ); + DLLFunc_ClientPutInServer, // void ) ( edict_t *pEntity ); + DLLFunc_ClientCommand, // void ) ( edict_t *pEntity ); + + DLLFunc_ServerDeactivate, // void) ( void ); + + DLLFunc_PlayerPreThink, // void ) ( edict_t *pEntity ); + DLLFunc_PlayerPostThink, // void ) ( edict_t *pEntity ); + + DLLFunc_StartFrame, // void ) ( void ); + DLLFunc_ParmsNewLevel, // void ) ( void ); + DLLFunc_ParmsChangeLevel, // void ) ( void ); + + // Returns string describing current .dll. E.g., TeamFotrress 2, Half-Life + DLLFunc_GetGameDescription, // const char * )( void ); + + // Spectator funcs + DLLFunc_SpectatorConnect, // void) ( edict_t *pEntity ); + DLLFunc_SpectatorDisconnect, // void ) ( edict_t *pEntity ); + DLLFunc_SpectatorThink, // void ) ( edict_t *pEntity ); + + // Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. + DLLFunc_Sys_Error, // void ) ( const char *error_string ); + + DLLFunc_PM_FindTextureType, // char )( char *name ); + DLLFunc_RegisterEncoders, // void ) ( void ); + + // Enumerates player hulls. Returns 0 if the hull number doesn't exist, 1 otherwise + DLLFunc_GetHullBounds, // int) ( int hullnumber, float *mins, float *maxs ); + + // Create baselines for certain "unplaced" items. + DLLFunc_CreateInstancedBaselines, // void ) ( void ); + DLLFunc_pfnAllowLagCompensation, // int )( void ); + // I know this does not fit with DLLFUNC(), but I dont want another native just for it. + MetaFunc_CallGameEntity // bool (plid_t plid, const char *entStr,entvars_t *pev); +}; +enum { + pev_string_start = 0, + pev_classname, + pev_globalname, + pev_model, + pev_target, + pev_targetname, + pev_netname, + pev_message, + pev_noise, + pev_noise1, + pev_noise2, + pev_noise3, + pev_string_end, + pev_edict_start, + pev_chain, + pev_dmg_inflictor, + pev_enemy, + pev_aiment, + pev_owner, + pev_groundentity, + pev_euser1, + pev_euser2, + pev_euser3, + pev_euser4, + pev_edict_end, + pev_float_start, + pev_impacttime, + pev_starttime, + pev_idealpitch, + pev_pitch_speed, + pev_yaw_speed, + pev_ltime, + pev_nextthink, + pev_gravity, + pev_friction, + pev_frame, + pev_animtime, + pev_framerate, + pev_scale, + pev_renderamt, + pev_health, + pev_frags, + pev_takedamage, + pev_max_health, + pev_teleport_time, + pev_armortype, + pev_armorvalue, + pev_dmg_take, + pev_dmg_save, + pev_dmg, + pev_dmgtime, + pev_speed, + pev_air_finished, + pev_pain_finished, + pev_radsuit_finished, + pev_maxspeed, + pev_fov, + pev_flFallVelocity, + pev_fuser1, + pev_fuser2, + pev_fuser3, + pev_fuser4, + pev_float_end, + pev_int_start, + pev_fixangle, + pev_modelindex, + pev_viewmodel, + pev_weaponmodel, + pev_movetype, + pev_solid, + pev_skin, + pev_body, + pev_effects, + pev_light_level, + pev_sequence, + pev_gaitsequence, + pev_rendermode, + pev_renderfx, + pev_weapons, + pev_deadflag, + pev_button, + pev_impulse, + pev_spawnflags, + pev_flags, + pev_colormap, + pev_team, + pev_waterlevel, + pev_watertype, + pev_playerclass, + pev_weaponanim, + pev_pushmsec, + pev_bInDuck, + pev_flTimeStepSound, + pev_flSwimTime, + pev_flDuckTime, + pev_iStepLeft, + pev_gamestate, + pev_oldbuttons, + pev_groupinfo, + pev_iuser1, + pev_iuser2, + pev_iuser3, + pev_iuser4, + pev_int_end, + pev_byte_start, + pev_controller_0, + pev_controller_1, + pev_controller_2, + pev_controller_3, + pev_blending_0, + pev_blending_1, + pev_byte_end, + pev_bytearray_start, + pev_controller, + pev_blending, + pev_bytearray_end, + pev_vecarray_start, + pev_origin, + pev_oldorigin, + pev_velocity, + pev_basevelocity, + pev_clbasevelocity, + pev_movedir, + pev_angles, + pev_avelocity, + pev_v_angle, + pev_endpos, + pev_startpos, + pev_absmin, + pev_absmax, + pev_mins, + pev_maxs, + pev_size, + pev_rendercolor, + pev_view_ofs, + pev_vuser1, + pev_vuser2, + pev_vuser3, + pev_vuser4, + pev_punchangle, + pev_vecarray_end +}; +enum { + FM_PrecacheModel = 1, // done + FM_PrecacheSound, // done + FM_SetModel, // done + FM_ModelIndex, // done + FM_ModelFrames, // done + FM_SetSize, // done + FM_ChangeLevel, // done + FM_VecToYaw, // done + FM_VecToAngles, // done + FM_MoveToOrigin, // done + FM_ChangeYaw, // done + FM_ChangePitch, // done + FM_FindEntityByString, // done + FM_GetEntityIllum, // done + FM_FindEntityInSphere, // done + FM_FindClientInPVS, // done + FM_EntitiesInPVS, // done + FM_MakeVectors, // done + FM_AngleVectors, // done + FM_CreateEntity, // done + FM_RemoveEntity, // done + FM_CreateNamedEntity, // done + FM_MakeStatic, // done + FM_EntIsOnFloor, // done + FM_DropToFloor, // done + FM_WalkMove, // int ) (edict_t *ent, float yaw, float dist, int iMode); -- does't work as of 0.20 RC2 + FM_SetOrigin, // done + FM_EmitSound, // done + FM_EmitAmbientSound, // done + FM_TraceLine, // void ) (const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -- does't work as of 0.20 RC2 + FM_TraceToss, // void ) (edict_t* pent, edict_t* pentToIgnore, TraceResult *ptr); -- does't work as of 0.20 RC2 + FM_TraceMonsterHull, // int ) (edict_t *pEdict, const float *v1, const float *v2, int fNoMonsters, edict_t *pentToSkip, TraceResult *ptr); -- does't work as of 0.20 RC2 + FM_TraceHull, // void ) (const float *v1, const float *v2, int fNoMonsters, int hullNumber, edict_t *pentToSkip, TraceResult *ptr); -- does't work as of 0.20 RC2 + FM_TraceModel, // void ) (const float *v1, const float *v2, int hullNumber, edict_t *pent, TraceResult *ptr); -- does't work as of 0.20 RC2 + FM_TraceTexture, // const char *) (edict_t *pTextureEntity, const float *v1, const float *v2 ); -- does't work as of 0.20 RC2 + FM_TraceSphere, // void ) (const float *v1, const float *v2, int fNoMonsters, float radius, edict_t *pentToSkip, TraceResult *ptr); -- does't work as of 0.20 RC2 + FM_GetAimVector, // done + FM_ParticleEffect, // done + FM_LightStyle, // done + FM_DecalIndex, // done + FM_PointContents, // done + FM_MessageBegin, // done + FM_MessageEnd, // done + FM_WriteByte, // done + FM_WriteChar, // done + FM_WriteShort, // done + FM_WriteLong, // done + FM_WriteAngle, // done + FM_WriteCoord, // done + FM_WriteString, // done + FM_WriteEntity, // done + FM_CVarGetFloat, // done + FM_CVarGetString, // done + FM_CVarSetFloat, // done + FM_CVarSetString, // done + FM_FreeEntPrivateData, // done + FM_SzFromIndex, // done + FM_AllocString, // done + FM_RegUserMsg, // done + FM_AnimationAutomove, // done + FM_GetBonePosition, // void ) (const edict_t* pEdict, int iBone, float *rgflOrigin, float *rgflAngles ); -- does't work as of 0.20 RC2 + FM_GetAttachment, // void ) (const edict_t *pEdict, int iAttachment, float *rgflOrigin, float *rgflAngles ); -- does't work as of 0.20 RC2 + FM_SetView, // done + FM_Time, // done + FM_CrosshairAngle, // done + FM_FadeClientVolume, // done + FM_SetClientMaxspeed, // done + FM_CreateFakeClient, // done + FM_RunPlayerMove, // void ) (edict_t *fakeclient, const float *viewangles, float forwardmove, float sidemove, float upmove, unsigned short buttons, byte impulse, byte msec ); -- does't work as of 0.20 RC2 + FM_NumberOfEntities, // done + FM_StaticDecal, // done + FM_PrecacheGeneric, // done + FM_BuildSoundMsg, // void ) (edict_t *entity, int channel, const char *sample, /*int*/float volume, float attenuation, int fFlags, int pitch, int msg_dest, int msg_type, const float *pOrigin, edict_t *ed); -- does't work as of 0.20 RC2 + FM_GetPhysicsKeyValue, // done + FM_SetPhysicsKeyValue, // done + FM_GetPhysicsInfoString,// done + FM_PrecacheEvent, // done + FM_PlaybackEvent, // done + FM_CheckVisibility, //) ( + FM_GetCurrentPlayer, // done + FM_CanSkipPlayer, // done + FM_SetGroupMask, //done + FM_Voice_GetClientListening, // done + FM_Voice_SetClientListening, // done + FM_InfoKeyValue, // done + FM_SetKeyValue, // done + FM_SetClientKeyValue, // done + FM_GetPlayerAuthId, // done + FM_GetPlayerWONId, // done + FM_IsMapValid, // done + + + FM_Spawn, // done + FM_Think, // done + FM_Use, // done + FM_Touch, // done + FM_Blocked, // done + FM_KeyValue, // void ) ( edict_t *pentKeyvalue, KeyValueData *pkvd ); -- does't work as of 0.20 RC2 + FM_SetAbsBox, // done + FM_ClientConnect, // done + + FM_ClientDisconnect, // done + FM_ClientKill, // done + FM_ClientPutInServer, // done + FM_ClientCommand, // done + + FM_ServerDeactivate, // done + + FM_PlayerPreThink, // done + FM_PlayerPostThink, // done + + FM_StartFrame, // done + FM_ParmsNewLevel, // done + FM_ParmsChangeLevel, // done + + // Returns string describing current .dll. E.g., TeamFotrress 2, Half-Life + FM_GetGameDescription, // done + + // Spectator funcs + FM_SpectatorConnect, // done + FM_SpectatorDisconnect, // done + FM_SpectatorThink, // done + + // Notify game .dll that engine is going to shut down. Allows mod authors to set a breakpoint. + FM_Sys_Error, // done + + FM_PM_FindTextureType, // done + FM_RegisterEncoders, // done + + // Enumerates player hulls. Returns 0 if the hull number doesn't exist, 1 otherwise + + // Create baselines for certain "unplaced" items. + FM_CreateInstancedBaselines, // done + FM_AllowLagCompensation, // done +}; diff --git a/plugins/include/ns.inc b/plugins/include/ns.inc index 25cf83ec..88a0662c 100755 --- a/plugins/include/ns.inc +++ b/plugins/include/ns.inc @@ -84,12 +84,6 @@ native ns_has_weapon(id,NSWeapon:weapon,setweapon=-1); */ native ns_get_spawn(team,number=0,Float:ret[3]); -/* Configures display of the custom menus. This display is _very_ similar to set_hudmessage() */ -native ns_set_menu(id,r=NSMENU_R,g=NSMENU_G,b=NSMENU_B,Float:x=NSMENU_X,Float:y=NSMENU_Y, effects=0, Float:fadeintime=0.0, Float:fadeouttime=0.0,channel1=NSMENU_CHAN1,channel2=NSMENU_CHAN2); - -/* Displays a custom menu. It will execute command(id,keys) when the menu is pressed. */ -native ns_show_menu(id,szCommand[],szText[],keys,time); - /* Returns the class of the player. Look in the classes enum in ns_const.inc for the value's meaning. */ native ns_get_class(id); @@ -173,4 +167,8 @@ native ns_get_hive_trait(idHive); /* Sets the trait type tied to the hive. Look at the hivetrait enum for the values. */ native ns_set_hive_trait(idHive,trait); +/* Sets the players field of view, set "_fov" to 0.0 (or omit it) to return to normal. FOV change will persist until disconnect unless reset by a plugin */ native ns_set_fov(idPlayer,Float:_fov=0.0); + +/* Give a player an item. */ +native ns_give_item(id,const _szClassName[]); \ No newline at end of file diff --git a/plugins/include/ns2amx.inc b/plugins/include/ns2amx.inc index 85ba0722..4fa136b8 100755 --- a/plugins/include/ns2amx.inc +++ b/plugins/include/ns2amx.inc @@ -10,23 +10,19 @@ #endif #define _ns2amx_included -#include -#include +#include // various engine calls +#include // pev/engfunc/dllfunc/various calls which rely on engfunc/dllfunc +#include // ns specifics stock is_entity(id) -{ return is_valid_ent(id) -} -stock get_build(classname[], value, number=0, NS_Version) -{ - return ns_get_build(classname, value, number, NS_Version) -} +/* The end of the native is buffered incase the plugin is including an NS_VERSION (no longer supported), ignore it */ +stock get_build(classname[], value, number=0,{Float,_}:...) + return ns_get_build(classname, value, number) stock get_private_i(index, offset, linuxdiff=5) -{ return get_offset_int(index, offset, linuxdiff) -} stock set_private_i(index, offset, value, linuxdiff=5) { @@ -44,84 +40,80 @@ stock Float:set_private_f(index, offset, Float:value, linuxdiff=5) } stock make_string(value[]) -{ - return 0 -} + return EngFunc(EngFunc_AllocString,value) stock string(value, ret[]) { - return 0 + new szString[128] // gah... + EngFunc(EngFunc_SzFromIndex,value,szString,127) + copy(ret,szString,127) } stock gpgobals_time() -{ return halflife_time() -} stock get_range(ida, idb) -{ return entity_get_range(ida, idb) -} stock supercede() -{ - return 0 -} + return 0 stock register_clientkill() -{ return 0 -} stock register_changelvl() -{ return 0 -} stock register_msgblock(msgName[]) -{ return set_msg_block(get_user_msgid(msgName), BLOCK_SET) -} stock register_msgedit(msgName[], cmd[]) -{ return register_message(get_user_msgid(msgName), cmd) -} stock register_playback(event, cmd[]) -{ return 0 -} stock get_spwan(type, number=0, Float:ret[3]) -{ return ns_get_spawn(type, number, ret) -} stock has_weapon(index, weapon, setweapon=-1) -{ - return user_has_weapon(index, weapon, setweapon) -} + return ns_has_weapon(index, weapon, setweapon) stock gpglobals_v(type, Float:ret[3]) { - return get_global_vector(type, ret) + new v_type=0 + switch (type) + { + case 1: + v_type = GL_v_forward + case 2: + v_type = GL_v_right + case 3: + v_type = GL_v_up + } + if (!v_type) + return 0 + return get_global_vector(v_type, ret) } -stock pev(index, value, ...) +stock pev_i(_index,_field) + return pev(_index,_field) + +stock set_pev_i(_index, _field, _val) + return set_pev(_index,_field,_val) + +stock Float:pev_f(_index,_field) { - return 0 + new Float:f + pev(_index,_field,f) + return f } - -stock set_pev(index, value, ...) -{ - return 0 -} - +stock set_pev_f(_index,_field,Float:_val) + return set_pev(_index,_field,_val) + + stock msg_args() -{ return get_msg_args() -} stock Float:msg_loc(vec) { @@ -134,49 +126,31 @@ stock Float:msg_loc(vec) } stock msg_dest() -{ return 0 -} stock msg_type() -{ return 0 -} stock msg_name() -{ return 0 -} stock msg_set_s(number, value[]) -{ return set_msg_arg_string(number, value) -} stock msg_set_f(number, Float:value) -{ return set_msg_arg_float(number, value) -} stock msg_set_i(number, value) -{ return set_msg_arg_int(number, value) -} stock msg_data_type(value) -{ return get_msg_arg_type(value) -} stock msg_strdata(value) -{ return 0 -} stock msg_data(value, ...) -{ return 0 -} stock get_filename(szFile[], len=-1) { @@ -185,72 +159,45 @@ stock get_filename(szFile[], len=-1) return res } -stock get_speedchange(id, speed) -{ - return ns_get_speedchange(id, speed) -} +stock get_speedchange(id) + return ns_get_speedchange(id) stock set_speedchange(id, speed) -{ - return ns_set_speedchange(id) -} + return ns_set_speedchange(id,speed) stock get_maxspeed(id) -{ return ns_get_maxspeed(id) -} - -stock set_ns_menu(id,r=NSMENU_R,g=NSMENU_G,b=NSMENU_B,Float:x=NSMENU_X,Float:y=NSMENU_Y, effects=0, Float:fadeintime=0.0, Float:fadeouttime=0.0,channel1=NSMENU_CHAN1,channel2=NSMENU_CHAN2) -{ - return ns_set_menu(id, r, g, b, x, y, effects, fadeintime, fadeouttime, channel1, channel2) -} - -stock show_ns_menu(id, cmd[], text[], keys, time) -{ - ns_show_menu(id, cmd, text, keys, time) -} stock set_player_model(id, model[]="") -{ return ns_set_player_model(id, model) -} stock set_player_skin(id, skin=-1) -{ return ns_set_player_skin(id, skin) -} stock set_player_body(id, body=-1) -{ return ns_set_player_body(id, body) -} stock ns2amx_version() -{ - return ns_version() -} + return 0 stock set_kvhandled() -{ return 0 -} stock ns2amx_getammo(id,Weapon) -{ - return ns_getammo(id, Weapon) -} -stock ns2amx_setammo(id,Weapon,Value) -{ - return ns_setammo(id, Weapon, Value) -} -stock ns2amx_giveitem(id,svClassname[]) -{ - return ns_giveitem(id, svClassname) + return ns_get_weap_reserve(id, Weapon) + +stock ns2amx_setammo(id,Weapon,Value) + return ns_set_weap_reserve(id, Weapon, Value) + +stock ns2amx_giveitem(id,svClassname[]) + return ns_give_item(id, svClassname) -} stock ns2amx_moveto(idMoved,idDest) { - return ns_moveto(idMoved, idDest) + new Float:origin[3] + entity_get_vector(idDest, EV_VEC_origin,origin) + entity_set_origin(idMoved, origin) + return 1 } /* Returns whether or not the player has the MASK_DIGESTING flag set. */ stock ns2amx_isdigesting(id) @@ -269,53 +216,39 @@ stock ns2amx_inrange(ida,idb,range) } stock ns2amx_nspopup(id,svMessage[190]) -{ - return ns_nspopup(id, svMessage) -} + return ns_popup(id, svMessage) + stock ns2amx_setres(id,value) -{ - return ns_setres(id, value) -} + return ns_set_res(id, float(value)) + stock ns2amx_getenergy(id) -{ - return ns_getenergy(id) -} + return floatround(ns_get_energy(id)) + stock ns2amx_setenergy(id,energy) -{ - return ns_setenergy(id, energy) -} + return ns_set_energy(id, float(energy)) + stock ns2amx_getjpfuel(id) -{ - return ns_getjpfuel(id) -} + return floatround(ns_get_jpfuel(id)) + stock ns2amx_setjpfuel(id,fuel) -{ - return ns_setjpfuel(id, fuel) -} + return ns_set_jpfuel(id, float(fuel)) + stock get_mask(id,mask) -{ return ns_get_mask(id, mask) -} + stock set_mask(id,mask,value) -{ return ns_set_mask(id,mask,value) -} + stock get_special(id,mask) -{ return ns_get_special(id,mask) -} + stock get_res(id) -{ - return ns_get_res(id) -} + return floatround(ns_get_res(id)) + stock get_class(id) -{ return ns_get_class(id) -} stock is_combat() -{ return ns_is_combat() -} diff --git a/plugins/include/ns_const.inc b/plugins/include/ns_const.inc index 168d6e09..22887b86 100755 --- a/plugins/include/ns_const.inc +++ b/plugins/include/ns_const.inc @@ -10,17 +10,7 @@ #endif #define NS_CONST_INC -// These values are customizable (for the custom menus) -// If your menu uses the default menu scheme, then it will use this. -#define NSMENU_X 0.2 -#define NSMENU_Y 0.1 -#define NSMENU_R 255 -#define NSMENU_G 200 -#define NSMENU_B 100 - -#define NSMENU_CHAN1 2 -#define NSMENU_CHAN2 3 - +// entity pev->iuser4 fields enum masks { MASK_NONE = 0, @@ -129,7 +119,18 @@ enum weapons WEAPON_DEVOUR, WEAPON_MAX } +enum playerIcons { + ICON_DEVELOPER = 1, + ICON_GUIDE = 2, + ICON_SERVEROP = 4, + ICON_PLAYTESTER = 8, + ICON_CONTRIBUTOR = 16, + ICON_CHEATINGDEATH = 32, + ICON_VETERAN = 64, + ICON_BETASERVEROP = 128, // Using this messes with ICON_SERVEROPs + ICON_CUSTOM = 512 +} enum hivetraits { HIVETRAIT_NONE = 0,