SDK type declarations

Macro definitions

PLUGIN_API_MAJOR

The major version number used by the plugin SDK. The server will refuse to load plugins that do not use the same major version of the SDK. Changes to the major version indicate breaking changes.

PLUGIN_API_MINOR

The minor version number used by the plugin SDK. The server will load plugins with different minor versions as long as PLUGIN_API_MAJOR is compatible. SDKs with newer minor versions typically have added properties but do not remove or break types or function declarations and are thus backwards-compatible.

ServerSettings

ServerSettings

Used by PluginFuncs.GetServerSettings() to provide information about basic server settings to the plugin.

uint32_t ServerSettings.structSize

The size of the ServerSettings struct in bytes. Useful for checking if extended properties are present. For example, if a new API version adds a new field but you’d like to retain backwards-compatibility with older servers, you can check the size of this struct before referencing the new field.

char[128] ServerSettings.serverName

The name of the server. Also accessible via PluginFuncs.GetServerName() and PluginFuncs.SetServerName().

uint32_t ServerSettings.maxPlayers

The maximum number of players that can connect to the server. Also accessible via PluginFuncs.GetMaxPlayers() and PluginFuncs.SetMaxPlayers().

uint32_t ServerSettings.port

The port the server is listening on. This field cannot be changed while the server is running.

uint32_t ServerSettings.flags

Reserved. Currently always set to zero.

PluginInfo

PluginInfo

Describes a plugin so that it can be looked up and referenced by other plugins. Should only be altered in VcmpPluginInit(), but can be searched for in plugin functions.

uint32_t PluginInfo.structSize

The size of the PluginInfo struct in bytes. Useful for checking if extended properties are present. For example, if a new API version adds a new field but you’d like to retain backwards-compatibility with older servers, you can check the size of this struct before referencing the new field.

This property is set by the server and should not be altered.

uint32_t PluginInfo.pluginId

A unique 32-bit identifier for the plugin. The server assigns pluginId starting at zero and increasing it for each plugin loaded.

This property is set by the server and should not be altered.

char[32] PluginInfo.name

A name for the plugin. Can be used to search for the plugin using PluginFuncs.FindPlugin().

By default this is the filename of the plugin without the file extension, but can be edited to make it more readily searchable.

uint32_t PluginInfo.pluginVersion

A version number for the plugin. Can be used by other plugins to check for compatibility.

uint16_t PluginInfo.apiMajorVersion

The major version of the plugin SDK that this plugin supports. Should be set to PLUGIN_API_MAJOR in new/updated plugins for the plugin to load.

uint16_t PluginInfo.apiMinorVersion

The minor version of the plugin SDK that this plugin supports. Should be set to PLUGIN_API_MINOR in new/updated plugins for maximum compatibility.

vcmpError

vcmpError

An enumeration of error codes that may be returned by plugin functions.

int32_t vcmpErrorNone

No errors have occurred.

int32_t vcmpErrorNoSuchEntity

For plugin functions that take an entity ID (e.g. players, pickups, objects), indicates that no entity could be found with the ID given.

int32_t vcmpErrorBufferTooSmall

For plugin functions that take a char array/char pointer for storing strings, indicates that the buffer is too small to fit the string being copied.

int32_t vcmpErrorTooLargeInput

A char array used for setting a string value was too large to be copied.

int32_t vcmpErrorArgumentOutOfBounds

An argument’s value is not within the accepted range.

int32_t vcmpErrorNullArgument

An argument was null when some valid pointer was expected.

int32_t vcmpErrorPoolExhausted

For plugin functions that create entities, indicates that no more entities of a given type can be created.

int32_t vcmpErrorInvalidName

Tried to set a player’s name to a different value but the name contained invalid characters.

int32_t vcmpErrorRequestDenied

The server asked an entity to perform an action, but the entity refused to do so, likely because it was doing something else.

int32_t forceSizeVcmpError

Reserved. Only used to force the vcmpError enum to be at least as large as an int32_t.

vcmpEntityPool

vcmpEntityPool

An enumeration of entity pool types. Entity pools keep track of all instances of entities that can be created and destroyed by the server.

int32_t vcmpEntityPoolVehicle

The vehicle pool.

int32_t vcmpEntityPoolObject

The object pool.

int32_t vcmpEntityPoolPickup

The pickup pool.

int32_t vcmpEntityPoolRadio

The custom radio station pool.

int32_t vcmpEntityPoolBlip

The map blip pool.

int32_t vcmpEntityPoolCheckpoint

The checkpoint/sphere pool.

int32_t forceSizeVcmpEntityPool

See forceSizeVcmpError.

vcmpDisconectReason

vcmpDisconnectReason

An enumeration of reasons a player may have been disconnected from the server for.

int32_t vcmpDisconnectReasonTimeout

The player did not respond to pings in a timely fashion and so the server has assumed their connection has been lost.

int32_t vcmpDisconnectReasonQuit

The player quit using the /q command or by exiting through the menu.

int32_t vcmpDisconnectReasonKick

The player was kicked by the server.

int32_t vcmpDisconnectReasonCrash

The player’s game crashed and failed to recover.

int32_t vcmpDisconnectReasonAntiCheat

The player was flagged for cheating.

int32_t forceSizeVcmpDisconnectReason

See forceSizeVcmpError.

vcmpEntityPool

vcmpBodyPart

An enumeration of body parts that may be reported when a player is shot or killed.

int32_t vcmpBodyPartBody

Somewhere on the body, exact location undetermined.

int32_t vcmpBodyPartTorso

The torso.

int32_t vcmpBodyPartLeftArm

The left arm.

int32_t vcmpBodyPartRightArm

The right arm.

int32_t vcmpBodyPartLeftLeg

The left leg.

int32_t vcmpBodyPartRightLeg

The right leg.

int32_t vcmpBodyPartHead

The head.

int32_t vcmpBodyPartInVehicle

The player was in a vehicle when they were shot/killed.

int32_t forceSizeVcmpBodyPart

See forceSizeVcmpError.

vcmpPlayerState

vcmpPlayerState

An enumeration of player states that may be returned by PluginFuncs.GetPlayerState().

int32_t vcmpPlayerStateNone

The player is not currently being synced.

int32_t vcmpPlayerStateNormal

The player is on-foot.

int32_t vcmpPlayerStateAim

The player is firing a weapon or aiming through a scoped weapon. This player state has aim position and aim direction data associated with it. See PluginFuncs.GetPlayerAimPosition() and PluginFuncs.GetPlayerAimDirection() for more information.

int32_t vcmpPlayerStateDriver

The player is driving a vehicle.

int32_t vcmpPlayerStatePassenger

The player is a passenger in a vehicle.

int32_t vcmpPlayerStateEnterDriver

The player is entering a car as a driver.

int32_t vcmpPlayerStateEnterPassenger

The player is entering a car as a passenger.

int32_t vcmpPlayerStateExit

The player is exiting a vehicle.

int32_t vcmpPlayerStateUnspawned

The player is not spawned.

int32_t forceSizeVcmpPlayerState

See forceSizeVcmpError.

vcmpPlayerUpdate

vcmpPlayerUpdate

An enumeration of player update types passed to PluginCallbacks.OnPlayerUpdate().

int32_t vcmpPlayerUpdateNormal

The player is on-foot being synced as a normal ped.

int32_t vcmpPlayerUpdateAiming

The player is firing a weapon or aiming through a scoped weapon. This sync type has aim position and aim direction data associated with it. See PluginFuncs.GetPlayerAimPosition() and PluginFuncs.GetPlayerAimDirection() for more information.

int32_t vcmpPlayerUpdateDriver

The player is driving a vehicle. Coincides with a vcmpVehicleUpdateDriverSync update.

int32_t vcmpPlayerUpdatePassenger

The player is a vehicle passenger.

int32_t forceSizeVcmpPlayerUpdate

See forceSizeVcmpError.

vcmpPlayerVehicle

vcmpPlayerVehicle

An enumeration of players’ vehicle entry states as reported by PluginFuncs.GetPlayerInVehicleStatus().

int32_t vcmpPlayerVehicleOut

The player is not in a vehicle.

int32_t vcmpPlayerVehicleEntering

The player is entering a vehicle.

int32_t vcmpPlayerVehicleExiting

The player is exiting a vehicle.

int32_t vcmpPlayerVehicleIn

The player is in a vehicle.

int32_t forceSizeVcmpPlayerVehicle

See forceSizeVcmpError.

vcmpVehicleSync

vcmpVehicleSync

An enumeration of vehicles’ sync states as reported by PluginFuncs.GetVehicleSyncType().

int32_t vcmpVehicleSyncNone

The vehicle is not being synced by anyone.

int32_t vcmpVehicleSyncDriver

The vehicle is being driven and is synced by its driver.

int32_t vcmpVehicleSyncPassenger

The vehicle has no driver but is primarily synced by one of its passengers.

int32_t vcmpVehicleSyncNear

The vehicle has no occupants but is being synced by a nearby player.

int32_t forceSizeVcmpVehicleSync

See forceSizeVcmpError.

vcmpVehicleUpdate

vcmpVehicleUpdate

An enumeration of vehicle update types passed to PluginCallbacks.OnVehicleUpdate().

int32_t vcmpVehicleUpdateDriverSync

The vehicle’s state is being updated by its driver. Coincides with a vcmpPlayerUpdateDriver update.

int32_t vcmpVehicleUpdateOtherSync

The vehicle’s state is being updated by a passenger or nearby player.

int32_t vcmpVehicleUpdatePosition

The vehicle’s position was changed by a plugin via PluginFuncs.SetVehiclePosition().

int32_t vcmpVehicleUpdateHealth

The vehicle’s health was changed by a plugin via PluginFuncs.SetVehicleHealth().

int32_t vcmpVehicleUpdateColour

The vehicle’s primary or secondary colour was changed by a plugin via PluginFuncs.SetVehicleColour().

int32_t vcmpVehicleUpdateRotation

The vehicle’s rotation was changed by a plugin via PluginFuncs.SetVehicleRotation() or PluginFuncs.SetVehicleRotationEuler().

int32_t forceSizeVcmpVehicleUpdate

See forceSizeVcmpError.

vcmpServerOption

vcmpServerOption

An enumeration of boolean (on/off) server settings that can be configured via PluginFuncs.SetServerOption().

int32_t vcmpServerOptionSyncFrameLimiter

Default: off

Controls whether or not the frame limiter graphics setting is synced. Enabling this option forces players’ games to respect the frame limiter status controlled by vcmpServerOptionFrameLimiter.

Warning

While Vice City looks smoother at 60fps, parts of the game (e.g. physics simulations, looping sounds) will not behave consistently above 30fps. If consistency is critical, such as in a competitive deathmatch server, you should sync the frame limiter setting regardless of whether you prefer to have it on or off.

int32_t vcmpServerOptionFrameLimiter

Default: off

Controls whether or not the frame limiter should be enabled for players.

Note

Disabling the frame limiter will still limit players to 60fps at most due to game engine limitations.

int32_t vcmpServerOptionTaxiBoostJump

Default: off

Controls whether taxis can boost jump by pressing the horn key, as is possible in single-player by completing 100 taxi fares.

int32_t vcmpServerOptionDriveOnWater

Default: off

Controls whether cars can drive on water, as is possible in single-player by using the SEAWAYS cheat.

int32_t vcmpServerOptionFastSwitch

Default: off

Controls whether or not players can switch weapons while in the middle of a shooting animation.

int32_t vcmpServerOptionFriendlyFire

Default: on

Controls whether or not players on the same team do damage to each other.

int32_t vcmpServerOptionDisableDriveBy

Default: off

Controls whether or not drive-bys are disabled.

int32_t vcmpServerOptionPerfectHandling

Default: off

Controls whether or not vehicle turn handling and traction are incresed, as is possible in single-player with the GRIPISEVERYTHING cheat.

int32_t vcmpServerOptionFlyingCars

Default: off

Controls whether or not cars can fly, as is possible in single-player with the COMEFLYWITHME cheat.

int32_t vcmpServerOptionJumpSwitch

Default: on

Controls whether or not players can change weapons while jumping in the air.

int32_t vcmpServerOptionShowMarkers

Default: on

Controls whether or not players appear on the radar to other players.

int32_t vcmpServerOptionOnlyShowTeamMarkers

Default: off

Controls whether or not players only see markers of players who are on the same team.

int32_t vcmpServerOptionStuntBike

Default: off

If enabled, players will not be able to fall off of bikes.

int32_t vcmpServerOptionShootInAir

Default: off

Controls whether or not players can shoot weapons in mid-air.

int32_t vcmpServerOptionShowNameTags

Default: on

Controls whether or not nametags are enabled.

int32_t vcmpServerOptionJoinMessages

Default: on

Controls whether or not the server automatically sends a chat message when a player joins.

int32_t vcmpServerOptionDeathMessages

Default: on

Controls whether or not the server automatically sends a chat message when a player dies.

int32_t vcmpServerOptionChatTagsEnabled

Default: on

Controls whether or not players can use color tags like [#FF0000] in their chat messages.

int32_t vcmpServerOptionUseClasses

Default: on

Controls whether or not the server uses class selection. Enabling class selection allows you to set up a spawn screen with different classes that spawn in configurable locations with configurable weapons.

int32_t vcmpServerOptionWallGlitch

Default: off

Controls whether or not players can wallglitch. The game engine can allow players to shoot through walls in some cases, a glitch known as wallglitching. If disabled, the game applies additional checks to make sure the player cannot shoot through obstacles.

int32_t vcmpServerOptionDisableBackfaceCulling

Default: off

Controls whether or not backface culling is disabled. Backface culling is a game engine optimization where the game does not render polygons facing away from the camera. Some objects, such as those imported from GTA3 maps, do not behavior correctly is backface culling is enabled.

int32_t vcmpServerOptionDisableHeliBladeDamage

Default: off

Controls whether or not damage from helicopter blades is disabled.

int32_t forceSizeVcmpServerOption

See forceSizeVcmpError.

vcmpPlayerOption

vcmpPlayerOption

An enumeration of boolean (on/off) player settings that can be configured via PluginFuncs.SetPlayerOption().

int32_t vcmpPlayerOptionControllable

Default: on

Controls whether or not the player can control their character (i.e. move around, fire weapons). If disabled the player is frozen but can still use commands and chat.

int32_t vcmpPlayerOptionDriveBy

Default: on

Controls whether or not the player can perform drivebys.

Note

vcmpServerOptionDisableDriveBy overrides this setting if enabled.

int32_t vcmpPlayerOptionWhiteScanlines

Default: off

Controls whether or not the player has white VCR scanlines on the screen.

int32_t vcmpPlayerOptionGreenScanlines

Default: off

Controls whether or not the player has green scanlines on the screen.

int32_t vcmpPlayerOptionWidescreen

Default: off

Controls whether or not the player has a cinematic widescreen effect like in single-player mission cutscenes. Enabling this also disables the HUD.

int32_t vcmpPlayerOptionShowMarkers

Default: on

Controls whether or not this player can see other players’ markers on the radar and map.

int32_t vcmpPlayerOptionCanAttack

Default: on

Controls whether or not this player can use any weapons, including fists.

int32_t vcmpPlayerOptionHasMarker

Default: on

Controls whether or not other players can see this player on the radar and map.

int32_t vcmpPlayerOptionChatTagsEnabled

Default: on

Controls whether or not this player can use color tags like [#FF0000] in chat.

Note

vcmpServerOptionChatTagsEnabled overrides this setting.

int32_t vcmpPlayerOptionDrunkEffects

Default: off

Controls whether or not this player has a drunk haze effect on their screen.

int32_t forceSizeVcmpPlayerOption

See forceSizeVcmpError.

vcmpVehicleOption

vcmpVehicleOption

An enumeration of boolean (on/off) vehicle settings that can be configured via PluginFuncs.SetVehicleOption().

int32_t vcmpVehicleOptionDoorsLocked

Default: off

Controls whether or not the doors are locked. If enabled, players will not be able to enter the vehicle by themselves.

int32_t vcmpVehicleOptionAlarm

Default: off

Controls whether or not the car alarm is currently enabled.

int32_t vcmpVehicleOptionLights

Default: off

Controls whether or not the vehicle’s high beams are enabled.

int32_t vcmpVehicleOptionRadioLocked

Default: off

If enabled, the driver will not be able to change the radio station by themselves. PluginFuncs.SetVehicleRadio() can still be used to change the radio station.

int32_t vcmpVehicleOptionGhost

Default: off

If enabled, this vehicle will not collide with other vehicles.

int32_t vcmpVehicleOptionSiren

Default: off

Controls whether or not the vehicle’s siren is enabled. Only applicable to emergency vehicles like firetrucks, ambulances and police cars.

int32_t vcmpVehicleOptionSingleUse

Default: off

Controls whether or not the vehicle is a single-use entity. If enabled, the vehicle will delete itself instead of respawning after the vehicle is destroyed.

int32_t forceSizeVcmpVehicleOption

See forceSizeVcmpError.

vcmpPickupOption

vcmpPickupOption

An enumeration of boolean (on/off) pickup settings that can be configured via PluginFuncs.SetPickupOption().

int32_t vcmpPickupOptionSingleUse

Default: off

Controls whether or not the pickup is a single-use entity. If enabled, the pickup will delete itself instead of respawning after being picked up.

int32_t forceSizeVcmpPickupOption

See forceSizeVcmpError.