GM
Primary Gamemode Bootstrap
- ClientCalcRagdollEyes(ply, Origin, Angles, FOV) → table|nilSource ☍
-
Parameters
- plyany
- Originany
- Anglesany
- FOVany
Returns
- table|nil
- Clientcityrp.formattime(time, showmins) → stringSource ☍
-
Parameters
- timenumber?
- showminsboolean
Returns
- string
- ClientDrawDeathMessage()Source ☍
- ClientfireEmitters()Source ☍
- ClientGM:AdjustMaximumWidth(font, text, width, addition, extra) → number|unknownSource ☍
-
Adjust WIDTH to be maximum value of (width of text (plus a bit)) or (width)
Parameters
- fontstringFont name.
- textstringText.
- widthnumberMaximum width to set to.
- additionnumberPost-check text padding size.
- extranumberPre-check text padding.
Returns
- number|unknown
- ClientGM:CalculateTime(seconds) → number, numberSource ☍
-
Convert seconds to a hours, minutes format.
Parameters
- secondsnumber
Returns
- 1number
- 2number
- ServerGM:CanExitVehicle(veh, ply) → booleanSource ☍
-
Called to check if a player is able to exit a vehicle.
Parameters
- vehVehicleThe vehicle (or, for a seat attached to a parent vehicle, its resolved parent) being exited.
- plyPlayerThe player attempting to exit.
Returns
- booleanIf the player is allowed to exit.
- ServerGM:CanPlayerSuicide(ply) → booleanSource ☍
-
Called when a player attempts suicide.
Parameters
- plyPlayerSuiciding player.
Returns
- booleanIf the suicide was allowed.
- ServerGM:CanTool(ply, trace, tool) → booleanSource ☍
-
Called when a player attempts to use their toolgun.
Parameters
- plyPlayerCalling player.
- traceTraceResultstructure.
- toolstringThe active toolmode.
Returns
- booleanIf the toolgun was allowed.
- ClientGM:ChatText(index, name, text, filter) → booleanSource ☍
-
Called when a player says something or a message is received from the server.
Parameters
- indexany
- nameany
- textany
- filterany
Returns
- boolean
- ServerGM:CheckPassword(id64, ipAddr, svPass, clPass, name) → boolean, string|nilSource ☍
-
Called when a player joins and attempts to check their password.
Parameters
- id64any
- ipAddrany
- svPassany
- clPassany
- nameany
Returns
- 1boolean
- 2string|nil
- ServerGM:ConnectToDatabase()Source ☍
-
Connect the gamemode to the database.
- ClientGM:CreateScoreboard()Source ☍
-
Creates the scoreboard for the server's selected version, replacing any existing one.
- ServerGM:DBConnected()Source ☍
-
Called when the database is connected.
- ServerGM:DoPlayerDeath(ply, attacker, damageInfo)Source ☍
-
Parameters
- plyany
- attackerany
- damageInfoany
- ClientGM:DrawInformation(text, font, x, y, color, alpha, left, callback, shadow) → numberSource ☍
-
Draw Information.
Parameters
- textstringInformation to draw.
- fontstringThe font to draw.
- xnumberX position to draw at.
- ynumberY position to draw at.
- colorColorColour to draw in.
- alphanumberAlpha to draw at.
- leftboolean?If the x is the left or center point. Defaults to false.
- callbackfun(x: number, y: number, width: number, height: number):number?, number?Callback function to overwrite the x and y positions.
- shadowboolean?If a shadow should be drawn. Defaults to false.
Returns
- numberNew y position.
- ServerGM:EntityKeyValue(ent, key, value)Source ☍
-
Called when a mapper-set keyvalue is read on an entity, for prop protection overrides.
Parameters
- entEntityThe entity carrying the keyvalue.
- keystringThe keyvalue name.
- valuestringThe keyvalue value.
- ServerGM:EntityTakeDamage(entity, damageInfo) → booleanSource ☍
-
Called when an entity takes damage.
Parameters
- entityEntityEntity which took damage.
- damageInfoDamageInfoInformation about the damage.
Returns
- booleanIf true, the damage is not applied.
- ServerGM:GetOOCDelay(ply) → numberSource ☍
-
Get how long a player must wait between OOC messages. Quieter servers get a shorter delay: half at or below the low player count, rising linearly to the full delay at the high count. Members wait half that.
Parameters
- plyPlayerThe player talking.
Returns
- numberThe delay in seconds.
- ClientGM:GetScreenCenterBounce(bounce) → unknown, unknownSource ☍
-
Get the bouncing position of the screen's center.
Parameters
- bouncenumber?How much the screen should bounce by. Defaults to 8.
Returns
- 1unknown
- 2unknown
- ServerGM:GravGunPickupAllowed(ply, ent) → boolean|nilSource ☍
-
Called to check if a player is allowed to pick up an entity with the gravity gun.
Parameters
Returns
- boolean|nilnil defers to the engine default.
- ServerGM:GravGunPunt(ply, ent) → booleanSource ☍
-
Called when a player attempts to punt an entity with the gravity gun.
Parameters
Returns
- booleanIf the punt is allowed.
- ClientGM:HUDAmmoPickedUp()Source ☍
- ClientGM:HUDDrawScoreBoard() → booleanSource ☍
-
Called when the scoreboard should be drawn.
Returns
- boolean
- ClientGM:HUDDrawTargetID()Source ☍
-
Called when the target ID should be drawn.
- ClientGM:HUDItemPickedUp()Source ☍
- ClientGM:HUDPaint() → booleanSource ☍
-
Called every time the HUD should be painted.
Returns
- boolean
- ClientGM:HUDShouldDraw(name) → booleanSource ☍
-
A function to override whether a HUD element should draw.
Parameters
- namestringHUD element name to draw.
Returns
- booleanIf the HUD element should draw.
- ClientGM:HUDWeaponPickedUp()Source ☍
-
Override the weapon, item and ammo pickup functions.
- ServerGM:Initialize()Source ☍
-
Run the gamemode startup procedure.
- ServerGM:InitPostEntity()Source ☍
-
Called when all of the map entities have been initialized.
- ClientGM:IsUsingCamera() → booleanSource ☍
-
Check if the local player is using the camera.
Returns
- booleanIf the local player is using a camera weapon.
- ServerGM:KeyPress(ply, key)Source ☍
-
Called when a player presses a key.
Parameters
- plyPlayerThe player who pressed the key.
- keynumberThe key enum pressed.
- ServerGM:KeyRelease(ply, key)Source ☍
-
Called when a player releases a key.
Parameters
- plyPlayerPlayer who pressed the key.
- keynumberKEY_ enum which was pressed.
- ClientGM:OnEntityCreated(ent)Source ☍
-
Called when an entity is created.
Parameters
- entEntityThe entity that was created.
- ServerGM:OnPhysgunReload(weapon, ply) → boolean|nilSource ☍
-
Called when a player reloads the physgun on an entity, to check if it may be dropped/removed.
Parameters
Returns
- boolean|nilnil defers to the engine default.
- ServerGM:OnUpdateDatabase()Source ☍
-
Called whenever the database is updated. Typically on a 60s timer.
- ServerGM:PhysgunDrop(ply, ent)Source ☍
-
Called when a player attempts to drop an entity with the physics gun.
Parameters
- ServerGM:PhysgunPickup(ply, ent) → boolean|nilSource ☍
-
Called when a player attempts to pick up an entity with the physics gun.
Parameters
Returns
- boolean|nilIf the pickup was allowed.
- ServerGM:PlayerArrest(ply, tgt) → boolean|nilSource ☍
-
Called when a player is arresting another player.
Parameters
Returns
- boolean|nilIf the arrest is allowed, nil for default (allowed).
- ClientGM:PlayerBindPress(ply, bind, press)Source ☍
-
Called when a player presses a bind.
Parameters
- plyPlayerPlayer pressing the bind.
- bindstringThe bind being pressed.
- pressbooleanIf the bind was depressed or unpressed.
- ServerGM:PlayerCanArrest(ply, tgt) → boolean|nilSource ☍
-
Called when a player attempts to arrest another player.
Parameters
Returns
- boolean|nilIf the pickup arrest was allowed.
- ServerGM:PlayerCanDemote(ply, tObj) → boolean, string|nilSource ☍
-
Called when a player attempts to demote another player.
Parameters
Returns
- 1booleanIf the demote was allowed.
- 2string|nilIf the demote was not allowed, a reason to display to the player. If no string is provided, no error is shown.
- ServerGM:PlayerCanDrop(ply, weapon, silent, attacker) → boolean|nilSource ☍
-
Called when a player drops a weapon.
Parameters
- plyPlayerThe player dropping a weapon.
- weaponWeaponThe weapon being dropped.
- silentbooleanIf the drop is "silent" (a backend drop, ie. on death).
- attackerPlayer?The attacker for the player.
Returns
- boolean|nilIf the drop is allowed, nil for default (allowed).
- ServerGM:PlayerCanDropItem(ply, item, amt, pos, meta) → boolean, stringSource ☍
-
Called when a player attempts to drop an item on the ground.
Parameters
- plyPlayerThe player dropping the item.
- itemstringThe uniqueID of the item being dropped.
- amtnumberThe amount of items being dropped.
- posVectorThe position that the items would be created at.
- metastring?The item metadata key for the stack being dropped.
Returns
- 1booleanIf the drop was allowed.
- 2stringError message to display to the player, if any.
- ServerGM:PlayerCanEarnContraband(ply) → booleanSource ☍
-
Checks if a player can earn contraband.
Parameters
- plyPlayerThe player earning.
Returns
- booleanIf the earn was allowed.
- ServerGM:PlayerCanGainFrag(ply, victim) → booleanSource ☍
-
Hook function called when a player gains a kill.
Parameters
Returns
- booleanIf the frag is allowed to be counted.
- ServerGM:PlayerCanGiveItem(ply, item, amt, to, meta) → boolean, stringSource ☍
-
Called when a player attempts to give an item to another player.
Parameters
- plyPlayerThe player giving the item.
- itemstringThe uniqueID of the item being given.
- amtnumberThe amount of items being given.
- toPlayerThe player being given the items.
- metastring?The item metadata key for the stack being given.
Returns
- 1booleanIf the give was allowed.
- 2stringError message to display to the player, if any.
- ServerGM:PlayerCanHearPlayersVoice(ply, tgt) → booleanSource ☍
-
Hook function called to check if a player can be heard.
Parameters
Returns
- booleanIf the voice can be heard.
- ServerGM:PlayerCanHolster(ply, weapon, silent) → boolean|nilSource ☍
-
Called when a player holsters a weapon.
Parameters
- plyPlayerThe player holstering a weapon.
- weaponWeaponThe weapon being holstered.
- silentbooleanIf the holster is "silent" (a backend holstering ie. on death).
Returns
- boolean|nilIf the holster is allowed, nil for default (allowed).
- ServerGM:PlayerCanJoinTeam(ply, team) → booleanSource ☍
-
Check if a player can join a team.
Parameters
- plyPlayerThe player changing team.
- teamnumberThe new team.
Returns
- booleanIf the player can join the team.
- ServerGM:PlayerCanKnockOut(ply, tgt) → booleanSource ☍
-
Called when a player attempts to knock out another player.
Parameters
Returns
- booleanIf the knockout is allowed.
- ServerGM:PlayerCanOwnDoor(ply, door) → boolean|nilSource ☍
-
Called when a player buys a door.
Parameters
Returns
- boolean|nilIf the purchase is allowed, nil for default (allowed).
- ServerGM:PlayerCanPromote(ply, tgt) → booleanSource ☍
-
Called when a player attempts to promote another player.
Parameters
Returns
- booleanIf the promote was allowed.
- ServerGM:PlayerCanRamDoor(ply, door, silent) → booleanSource ☍
-
Called when a player attempts to ram a door.
Parameters
- plyPlayerThe player ramming the door.
- doorEntityThe door being rammed.
- silentbooleanIf the ram is silent.
Returns
- booleanIf the ram is allowed.
- ServerGM:PlayerCanRemoveItem(ply, item) → boolean, stringSource ☍
-
Called when a player attempts to remove an item.
Parameters
- plyPlayerThe player removing the item.
- itemstringThe uniqueID of the item being removed.
Returns
- 1booleanIf the removal was allowed.
- 2stringError message to display to the player, if any.
- ServerGM:PlayerCanSayIC(ply, text) → booleanSource ☍
-
Check if a player can say IC text.
Parameters
- plyPlayerThe player talking.
- textstringThe words said.
Returns
- booleanIf the chat will be shown.
- ServerGM:PlayerCanSayLOOC(ply, text) → booleanSource ☍
-
Check if a player can say Local OOC text.
Parameters
- plyPlayerThe player talking.
- textstringThe words said.
Returns
- booleanIf the chat will be shown.
- ServerGM:PlayerCanSayOOC(ply, text) → booleanSource ☍
-
Check if a player can say OOC text.
Parameters
- plyPlayerThe player talking.
- textstringThe words said.
Returns
- booleanIf the chat will be shown.
- ServerGM:PlayerCanSellItem(ply, item, amt, meta) → boolean, stringSource ☍
-
Called when a player attempts to sell an item from inventory.
Parameters
- plyPlayerThe player selling the item.
- itemstringThe uniqueID of the item being sold.
- amtnumberThe amount of items being sold.
- metastring?The item metadata key for the stack being sold.
Returns
- 1booleanIf the sell was allowed.
- 2stringError message to display to the player, if any.
- ServerGM:PlayerCanUnarrest(ply, tgt) → boolean|nilSource ☍
-
Called when a player attempts to unarrest another player.
Parameters
Returns
- boolean|nilIf the pickup was allowed.
- ServerGM:PlayerCanUnwarrant(ply, tgt) → booleanSource ☍
-
Called when a player attempts to unwarrant a player.
Parameters
Returns
- booleanIf the unwarrant was allowed.
- ServerGM:PlayerCanUseCommand(ply, command, arguments) → booleanSource ☍
-
Check if a player can run a command.
Parameters
- plyPlayerThe calling player.
- commandstringThe command being ran.
- argumentstableThe arguments table.
Returns
- booleanIf the command is allowed.
- ServerGM:PlayerCanUseDoor(ply, door) → booleanSource ☍
-
Called when a player attempts to use a door.
Parameters
Returns
- booleanIf the use is allowed.
- ServerGM:PlayerCanUseItem(ply, item, silent) → booleanSource ☍
-
Called when a player attempts to use an item.
Parameters
- plyPlayerThe player using an item.
- itemstringThe item being used.
- silentbooleanIf the use is silent.
Returns
- booleanIf the use is allowed.
- ServerGM:PlayerCanViewDoor(ply, door) → boolean|nilSource ☍
-
Called when a player views a door.
Parameters
Returns
- boolean|nilIf the viewing is allowed, nil for default (allowed).
- ClientGM:PlayerCanVoice(ply) → booleanSource ☍
-
Called to check if a player can use voice.
Parameters
- plyany
Returns
- boolean
- ServerGM:PlayerCanWakeUp(ply, tgt) → booleanSource ☍
-
Called when a player attempts to wake up another player.
Parameters
Returns
- booleanIf the wakeup is allowed.
- ServerGM:PlayerCanWarrant(ply, tgt) → booleanSource ☍
-
Called when a player attempts to warrant another player.
Parameters
Returns
- booleanIf the warrant is allowed.
- ServerGM:PlayerDataLoaded(ply, success)Source ☍
-
Called after a player's data has finished loading and their default, session-scoped fields have been applied.
successdistinguishes an existing account being loaded from the database (true, via pMeta:LoadData) from a first-time player whose record has just been created (false, via pMeta:LoadDataNew).Parameters
- plyPlayerThe player whose data was loaded.
- successbooleanWhether an existing save was loaded (true) or a new player record was just created (false).
- ServerGM:PlayerDeath(ply, inflictor, attacker, ragdoll)Source ☍
-
Called when a player dies.
Parameters
- ServerGM:PlayerDeathSound() → booleanSource ☍
-
Called to check if the default death sound should be played.
Returns
- booleanIf true, the default death sound is not played.
- ServerGM:PlayerDeathThink(ply) → boolean|unknownSource ☍
-
Called every frame that a player is dead.
Parameters
- plyPlayerDead player.
Returns
- boolean|unknown
- ServerGM:PlayerDemote(ply, tgt, from, reason) → boolean|nilSource ☍
-
Called when a player is demoting another player.
from: | `TEAM_PRESIDENT` | `TEAM_VP` | `TEAM_SSL` | `TEAM_SS` | `TEAM_GAL` | `TEAM_GA` | `TEAM_POLICECOMMANDER` | `TEAM_POLICEOFFICER` | `TEAM_FIRECHIEF` | `TEAM_RESCUE` | `TEAM_FIREMAN` | `TEAM_PARAMEDIC` | `TEAM_NEXUSDESK` | `TEAM_CITIZEN` | `TEAM_CHEF` | `TEAM_DOCTOR` | `TEAM_ARMSDEALER` | `TEAM_MECHANIC` | `TEAM_TAXI` | `TEAM_SECURITY` | `TEAM_REBEL` | `TEAM_REBELLEADER` | `TEAM_ANARCHIST` | `TEAM_BLACKMARKETDEALER` | `TEAM_MAFIABOSS` | `TEAM_MAFIA` | `TEAM_AFK`Parameters
- plyPlayerThe player demoting the target.
- tgtPlayerThe player being demoted.
- from`TEAM_AFK`|`TEAM_ANARCHIST`|`TEAM_ARMSDEALER`|`TEAM_BLACKMARKETDEALER`|`TEAM_CHEF`...(+22)The team they're being demoted from.
- reasonstringThe reason they're being demoted.
Returns
- boolean|nilIf the demote is allowed.
- ServerGM:PlayerDisconnected(player)Source ☍
-
Called when a player has disconnected.
Parameters
- playerany
- ClientGM:PlayerEndVoice(ply)Source ☍
-
Parameters
- plyany
- SharedGM:PlayerFootstep(ply, pos, foot, sound, vol, recip) → boolean|unknownSource ☍
-
Parameters
- plyany
- posany
- footany
- soundany
- volany
- recipany
Returns
- boolean|unknown
- ServerGM:PlayerGiveSWEP(ply, class, wep) → booleanSource ☍
-
Called when a player attempts to give a SWEP.
Parameters
- plyPlayerThe spawning player.
- classstringThe SWEP class.
- weptableThe weapon table.
Returns
- boolean
- ServerGM:PlayerHostage(ply, tgt) → boolean|nilSource ☍
-
Called when a player hostages player.
Parameters
Returns
- boolean|nilIf the hostage is allowed, nil for default (allowed).
- ServerGM:PlayerInitialized(ply)Source ☍
-
Called when the player has initialized.
Parameters
- plyany
- ServerGM:PlayerInitialSpawn(ply)Source ☍
-
Called when a player initially spawns.
Parameters
- plyany
- ServerGM:PlayerKnockOut(ply, tgt)Source ☍
-
Called by pMeta:KnockOut once a player has been knocked out, whatever the cause. To block one, use PlayerCanKnockOut.
Parameters
- ServerGM:PlayerLoadout(player)Source ☍
-
Called when a player's weapons should be given, on a real spawn. The loadouts plugin grants every weapon; plugins'
playerLoadoutmethods then dress the player.Parameters
- playerPlayer
- ClientGM:PlayerNoClip(ply, state) → booleanSource ☍
-
Predicts whether the server lets the local player change noclip state; the server copy in init.lua decides and echoes.
Parameters
- plyPlayerPlayer changing state.
- statebooleanThe requested noclip state.
Returns
- booleanIf the state change was allowed.
- ServerGM:PlayerPromotedToLeader(requester, target, fromTeam, toTeam)Source ☍
-
Called once a member has accepted a leader promotion and both players have changed team. To block one, use PlayerCanPromoteLeader.
Parameters
- requesterPlayerThe leader who made the request; now on the member job.
- targetPlayerThe member who accepted; now on the leader job.
- fromTeam`TEAM_AFK`|`TEAM_ANARCHIST`|`TEAM_ARMSDEALER`|`TEAM_BLACKMARKETDEALER`|`TEAM_CHEF`...(+22)The member job the target left.
- toTeam`TEAM_AFK`|`TEAM_ANARCHIST`|`TEAM_ARMSDEALER`|`TEAM_BLACKMARKETDEALER`|`TEAM_CHEF`...(+22)The leader job the target took.
- ServerGM:PlayerRanAdminCommand(ply, cmd, args)Source ☍
-
Called after an admin command is ran.
Parameters
- plyPlayerThe player running the command.
- cmdstringThe command ran.
- argstableThe arguments list.
- ServerGM:PlayerRanCommand(ply, cmd, args)Source ☍
-
Called after a command is ran.
Parameters
- plyPlayerThe player running the command.
- cmdstringThe command ran.
- argstableThe arguments list.
- ServerGM:PlayerSaid(ply, msg, msgType)Source ☍
-
Called after a player sends a message in chat.
Parameters
- plyPlayerThe player talking.
- msgstringThe message which was sent.
- msgTypestringThe message type ("ic", "gagged", "arrested", or "hostaged").
- ServerGM:PlayerSaidLOOC(ply, msg)Source ☍
-
Called after a player sends a message in Local OOC.
Parameters
- plyPlayerThe player talking in LOOC.
- msgstringThe message which was sent.
- ServerGM:PlayerSaidOOC(ply, msg)Source ☍
-
Called after a player sends a message in OOC.
Parameters
- plyPlayerThe player talking in OOC.
- msgstringThe message which was sent.
- ServerGM:PlayerSay(ply, text, public) → stringSource ☍
-
Hook function for when any message is sent to the server.
Parameters
- plyPlayerThe talking player.
- textstringThe message being sent.
- publicbooleanIf the message is sent in team or global chat.
Returns
- stringOverride string to send in chat.
- ServerGM:PlayerSayAdminOOC(ply, msg)Source ☍
-
Called after a staff member sends a message in staff OOC (!//).
Parameters
- plyPlayerThe staff member talking in staff OOC.
- msgstringThe message which was sent.
- ServerGM:PlayerSetHandsModel(ply, ent)Source ☍
-
Choose the model for hands according to their player model.
Parameters
- plyany
- entany
- ServerGM:PlayerSetModel(ply)Source ☍
-
Loadout hook function called when a player's model needs to be set.
Parameters
- plyPlayerPlayer's whos model is being set.
- ServerGM:PlayerShouldTakeDamage(ply, attacker) → booleanSource ☍
-
Called when a player should take damage.
Parameters
- plyany
- attackerany
Returns
- boolean
- ServerGM:PlayerShouldTaunt(ply, act) → boolean|nilSource ☍
-
Called when player tries to act something out. Coded by Voluptious.
Parameters
- plyPlayerActing player.
- actnumber<a>href='http://wiki.garrysmod.com/page/Enums/ACT'>ACT_</a> Enum.
Returns
- boolean|nilIf the act was allowed.
- ServerGM:PlayerSpawn(ply)Source ☍
-
Called when a player spawns.
Parameters
- plyPlayerSpawning Player.
- ServerGM:PlayerSpawnedEffect(ply, mdl, ent)Source ☍
-
Called when a player has spawned an effect.
Parameters
- ServerGM:PlayerSpawnedProp(ply, mdl, ent)Source ☍
-
Called when a player has spawned a prop.
Parameters
- ServerGM:PlayerSpawnedRagdoll(ply, model, ent)Source ☍
-
Called when a player has spawned a ragdoll.
Parameters
- ServerGM:PlayerSpawnedSENT(ply, ent)Source ☍
-
Called when a player spawns a SENT, to assign them ownership of it.
Parameters
- ServerGM:PlayerSpawnedVehicle(ply, ent)Source ☍
-
Called when a player spawns a vehicle, to tag its default ownership.
Parameters
- ServerGM:PlayerSpawnEffect(ply, mdl) → booleanSource ☍
-
Called when a player attempts to spawn an effect.
Parameters
- plyPlayerThe player spawning the prop.
- mdlstringThe model path being spawned.
Returns
- booleanIf the spawn was allowed.
- ServerGM:PlayerSpawnNPC(ply, class, weapon) → booleanSource ☍
-
Called when a player attempts to spawn an NPC.
Parameters
- plyPlayerThe player spawning an NPC.
- classstringThe NPC class.
- weaponstringThe NPCs weapon.
Returns
- booleanIf the act was allowed.
- ServerGM:PlayerSpawnProp(ply, model, state) → booleanSource ☍
-
Called when a player attempts to spawn a prop.
Parameters
- plyPlayerThe player spawning the prop.
- modelstringThe model path being spawned.
- statestring?Optional state data.
Returns
- booleanIf the spawn was allowed.
- ServerGM:PlayerSpawnRagdoll(ply, model) → booleanSource ☍
-
Called when a player attempts to spawn a ragdoll.
Parameters
- plyPlayerSpawning player.
- modelstringThe model being spawned.
Returns
- booleanIf the spawn was allowed.
- ServerGM:PlayerSpawnSENT(ply, class) → booleanSource ☍
-
Called when attempts to spawn a SENT.
Parameters
- plyPlayerThe spawning player.
- classstringThe SENT class.
Returns
- boolean
- ServerGM:PlayerSpawnSWEP(ply, class, wep) → booleanSource ☍
-
Called when a player attempts to spawn a SWEP.
Parameters
- plyPlayerThe spawning player.
- classstringThe SWEP class.
- weptableThe weapon table.
Returns
- boolean
- ServerGM:PlayerSpawnVehicle(ply, model) → booleanSource ☍
-
Called when a player attempts to spawn a vehicle.
Parameters
- plyPlayerSpawning player.
- modelstringThe model being spawned.
Returns
- booleanIf the spawn was allowed.
- ServerGM:PlayerSpray(ply) → booleanSource ☍
-
Called when a player should be allowed to spray.
Parameters
- plyPlayerPlayer attempting to spray.
Returns
- booleanIf the spray is allowed.
- ClientGM:PlayerStartVoice(ply)Source ☍
-
Parameters
- plyany
- ServerGM:PlayerSwitchFlashlight(ply, on) → booleanSource ☍
-
Called when a player switches their flashlight on or off.
Parameters
- plyPlayerThe player switching their flashlight.
- onbooleanThe requested flashlight state.
Returns
- booleanIf their flashlight is allowed to change state.
- ServerGM:PlayerUnarrest(ply, tgt) → boolean|nilSource ☍
-
Called when a player unarrests player.
Parameters
Returns
- boolean|nilIf the unarrest is allowed, nil for default (allowed).
- ServerGM:PlayerUnwarrant(ply, tgt) → boolean|nilSource ☍
-
Called when a player unwarrants player.
Parameters
Returns
- boolean|nilIf the unwarrant is allowed, nil for default (allowed).
- ServerGM:PlayerUse(ply, ent) → boolean|unknownSource ☍
-
Called when a player attempts to use an entity.
Parameters
Returns
- boolean|unknown
- ServerGM:PlayerWakeUp(ply, tgt) → boolean|nilSource ☍
-
Called when a player is waking up another player.
Parameters
Returns
- boolean|nilIf the wakeup is allowed, nil for default (allowed).
- ServerGM:PlayerWarrant(ply, tgt, class) → boolean|nilSource ☍
-
Called when a player warrants a player.
-- The kinds of warrant that can be held against a player. -- @section Type Unions class: | "bolo" | "search" | "arrest"Parameters
- plyPlayerThe player warranting.
- tgtPlayerThe player being warranted.
- class"arrest"|"bolo"|"search"The warrant class.
Returns
- boolean|nilIf the warranting is allowed, nil for default (allowed).
- ServerGM:PlyCanPickupAdmin(ply, ent) → boolean|nilSource ☍
-
Can a player with extended access (admin/mod) pickup this entity?
Parameters
Returns
- boolean|nilIf the pickup was allowed.
- ServerGM:PlyCanPickupRegular(ply, ent) → boolean|nilSource ☍
-
Can a regular player pickup this entity?
Parameters
Returns
- boolean|nilIf the pickup was allowed.
- ClientGM:PreDrawHalos()Source ☍
- ClientGM:RenderScreenspaceEffects()Source ☍
-
Called when screen space effects should be rendered.
- ClientGM:Restored() → booleanSource ☍
-
Returns
- boolean
- ClientGM:Saved() → booleanSource ☍
-
Disable saving / restoring buttons.
Returns
- boolean
- ServerGM:ScalePlayerDamage(ply, hitgroup, damageInfo)Source ☍
-
Called when a player takes damage to a specific body part. Defined here to shadow base's implementation, which hardcodes head x2 and limb x0.25.
Parameters
- plyPlayerPlayer which took the damage.
- hitgroupnumber
HITGROUP_*enum of the body part which was hit. - damageInfoDamageInfoInformation about the damage.
- ClientGM:ScoreboardHide()Source ☍
-
Hides the scoreboard.
- ClientGM:ScoreboardShow()Source ☍
-
Shows the scoreboard, rebuilding it first if the server has switched version since it was made.
- ServerGM:SetupSalary(ply)Source ☍
-
Set up a player's salary timer.
Parameters
- plyPlayerPlayer to setup.
- ServerGM:ShowHelp(ply)Source ☍
-
Called when a player presses F1.
Parameters
- plyany
- ServerGM:ShowSpare2(ply)Source ☍
-
Called when a player presses F4.
Parameters
- plyany
- ServerGM:ShowTeam(ply)Source ☍
-
Called when a player presses F2.
Parameters
- plyany
- ServerGM:ShutDown()Source ☍
-
Called when the server shuts down or the map changes.
- ClientGM:StartChat(team) → booleanSource ☍
-
Called when a player begins typing.
Parameters
- teamany
Returns
- boolean
- ServerGM.UpdateDatabase()Source ☍
-
Update the database and player's data.
- ServerGM:VehicleHPChange(ent, delta, cur) → numberSource ☍
-
Hook function called when vehicle HP changes.
Parameters
- entEntityVehicle to which the HP change is occuring.
- deltanumberHP change
- curnumberCurrent HP.
Returns
- numberModified delta.
- ServerGM:VehicleHPChanged(veh, new, old)Source ☍
-
Hook function called after vehicle HP changes.
Parameters
- vehVehicleVehicle to which the change occured.
- newnumberCurrent HP
- oldnumberOld HP
- ClientHUD_removeVoicePanel(ply)Source ☍
-
Parameters
- plyany
- Clientprintf(str, _)Source ☍
-
Define string formatting functions. These are documented in init.lua
Parameters
- strany
- unknown
- ServerpTable(tbl, indent)Source ☍
-
For when PrintTable doesnt work
Parameters
- tblany
- indentany
- Clientsprintf(str, _)Source ☍
-
Parameters
- strany
- unknown
- ServerBetaWhitelistSource ☍
- Servercityrp.AllowedToolsSource ☍
- Servercityrp.BlockedToolsSource ☍
-
This is the file name of the tool to block
- ClientGM.ammoCountSource ☍
- ServerGM.entitiesSource ☍
-
A table that will hold entities that were there when the map started.
- ClientGM.topTextGradientSource ☍
-
Set some information for the gamemode.
- ClientGM.variableQueueSource ☍
- ServerGMSource ☍
- ClientbillboardSource ☍
- Clientcityrp.barheightSource ☍
- Servercityrp.BlockedTools.lampSource ☍
- Servercityrp.BlockedTools.lightSource ☍
- ServerDB_MAINSource ☍
- ServerDB_MAIN.debuggingSource ☍
- ClientFireEmitterSource ☍
- Clientg_VoicePanelListSource ☍
- ClientGAMEMODE.playerInitFailedSource ☍
- ClientGAMEMODE.playerInitializedSource ☍
- ServerGMSource ☍
- SharedGM.AuthorSource ☍
- SharedGM.EmailSource ☍
- SharedGM.NameSource ☍
-
Name: "sh_init.lua". Product: "CityRP 2 (Roleplay)".
- SharedGM.WebsiteSource ☍
- ClientlplyvSource ☍
- ClientSmokeEmitterSource ☍