A mandatory step of using those functions is retrieving the CGameRules derived object itself.
Code: Select all
#include <amxmodx>
#include <orpheu>
#include <orpheu_stocks>
new g_pGameRules
public plugin_precache()
{
OrpheuRegisterHook(OrpheuGetFunction("InstallGameRules"),"OnInstallGameRules",OrpheuHookPost)
}
public OnInstallGameRules()
{
g_pGameRules = OrpheuGetReturn()
} Now, hooking a function:
Example GetNextBestWeapon(CBasePlayer *, CBasePlayerItem *)
Code: Select all
public plugin_init()
{
/* GetNextBestWeapon is the name of the function. You can see the name of the function at configs\orpheu\virtualFunctions\CGameRules
CGameRules is the base object and is to be used in every function in the package
OnGetNextBestWeapon is the name of our hook function
*/
OrpheuRegisterHookFromObject(g_pGameRules,"GetNextBestWeapon","CGameRules","OnGetNextBestWeapon")
}
public OnGetNextBestWeapon(gameRules,playerID,weaponID)
{
// Game rules object is always passed as the first argument but we don't need it since we already have it in g_pGameRules
} Example: CanHaveAmmo(CBasePlayer *, char const *, int)
Code: Select all
new OrpheuFunction:CanHaveAmmo = OrpheuGetFunctionFromObject(g_pGameRules,"CanHaveAmmo","CGameRules")
// When you call any of those functions you have to pass g_pGameRules always as the first argument
new result = OrpheuCall(CanHaveAmmo,g_pGameRules,id,"ammo_buckshot",30) After installing the package the functions will be at "configs\orpheu\virtualFunctions\CGameRul es". Check that folder and each file to know the arguments for each function and in which mod it works.
Supported mods:
Code: Select all
cstrike
czero
dod
tfc
ns
ts
SvenCoop
valveCode: Select all
AddToTeamScores
AllowAutoTargetCrosshair
AmmoShouldRespawn
BloodSprite
BloodStream
bodyDamage
Bubbles
BubbleTrails
BuildableBuilt
BuildableKilled
BuildMiniMap
BulletTracers
Camera
CanEntityDoDamageTo
CanHaveAmmo
CanHaveItem
CanHavePlayerItem
ChangeLevel
ChangePlayerTeam
ChangePlayerTeam_dod
CheckMapConditions
CheckWinConditions
CleanUpMap
ClientCommand
ClientCommandDeadOrAlive
ClientCommand_dod
ClientConnected
ClientDisconnected
ClientUserInfoChanged
DeadPlayerAmmo
DeadPlayerWeapons
DeathNotice
DeathNotice_dod
EndMultiplayerGame
Explosion
FAllowFlashlight
FAllowMonsters
FlAmmoRespawnTime
FlHealthChargerRechargeTime
FlHEVChargerRechargeTime
FlItemRespawnTime
FlPlayerFallDamage
FlPlayerSpawnTime
FlWeaponRespawnTime
FlWeaponTryRespawn
FPlayerCanRespawn
FPlayerCanTakeDamage
FShouldSwitchWeapon
gerVoice
GetArePlayersAllowedToJoinImmediately
GetCombatAttackingTeamNumber
GetCountdownStarted
GetGameDescription
GetGameStarted
GetGameTime
GetIndexedTeamName
GetIsClientAuthorizedToPlay
GetIsCombatMode
GetIsHamboneMode
GetIsIronMan
GetIsNSMode
GetIsTournamentMode
GetIsTrainingMode
getMapTime
GetMaxWaveTime
GetNextBestWeapon
GetPlayerSpawnSpot
GetTeamID
GetTeamIndex
getWaveTime
GiveC4
GoToIntermission
Init
InitHUD
IPointsForKill
IsAllowedToSpawn
IsClanMatch
IsClanMatchActive
IsCoOp
IsDeathmatch
IsFreezePeriod
IsMultiplayer
IsRoundFrozen
IsTeamplay
IsValidTeam
ItemShouldRespawn
Pain
PerformHardAuthorization
PlayerGotAmmo
PlayerGotItem
PlayerGotWeapon
PlayerKilled
PlayerKilled_dod
PlayerRelationship
PlayerSpawn
PlayerThink
PlayFootstepSounds
PlayTextureSounds
PopHelmet
ProcessRespawnCostForPlayer
Prone
RecalculateHandicap
RecalculateMapMode
RefreshSkillData
RemoveGuns
RestartRound
ReturnGameRules
RewardPlayerForKill
RoundReset
roundRestartSound
RoundState
ScreenFades
SelectSpawnPoint
SendMOTDToClient
SendTeamScores
ServerDeactivate
SetBloodSprite
SetBloodStream
SetbodyDamage
SetBubbles
SetBubbleTrails
SetBulletTracers
SetCamera
SetClanMatch
SetDefaultPlayerTeam
SetExplosion
SetGameStarted
SetgerVoice
SetMapChangeFromTime
setMapTime
SetPain
SetPopHelmet
SetProne
SetRestartTime
SetRocketTrail
SetRoundReset
SetroundRestartSound
SetRoundState
SetScreenFades
SetShards
SetSmoke
SetSparkShower
SetTeamScores
SetusVoice
setWaveTime
Shards
ShouldAutoAim
Smoke
SparkShower
StartTrail
TeamScores
Think
UpdateGameMode
usVoice
VoteKick
WeaponShouldRespawn