omp

package module
v0.0.0-...-b802f19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2025 License: BSD-3-Clause Imports: 9 Imported by: 0

README

omp

omp is a Go package that allows you to write open.mp gamemodes.

Installation

go get github.com/kodeyeen/omp

Requirements

  • GCC/G++ go build tool will require you to have C and C++ 32 bit compilers available on your system.

Type gcc -v and g++ -v in your terminal and you should see something like this:

Target: i686-w64-mingw32

Note the i686. Otherwise it won't build.

Quickstart

  1. Initialize a go module with go mod init <YOUR MODULE NAME>.
  2. Write some basic gamemode.
package main

import (
	"github.com/kodeyeen/omp"
)

// Gamemode entry point
func init() {
	// Listen to some predefined event
	omp.ListenFunc(omp.EventTypePlayerConnect, func(ctx context.Context, e omp.Event) error {
		ep := e.Payload().(*omp.PlayerConnectEvent)
		// Send client message to the connected player
		ep.Player.SendClientMessage("Hello, world!", 0xFFFF00FF)
		return nil
	})
}

// You MUST declare the main function, otherwise it fails to build
// You shouldn't write any code here
func main() {}

  1. Build it depending on your system (see the section below).
  2. Add the compiled file to the gamemodes folder of your server.
  3. Install and configure the Gomponent.

Now if you run the server and connect to it you should see the message "Hello, world!"

Building

On Windows:

$env:GOARCH=386; $env:CGO_ENABLED=1; go build -buildmode=c-shared -o build\gamemode.dll

On Linux:

GOARCH=386 CGO_ENABLED=1 go build -buildmode=c-shared -o build/gamemode.so

If you're using Visual Studio Code and seeing error messages during development, this is because of your GOARCH and CGO_ENABLED env variable values. You can check them by typing:

go env

If GOARCH value is something different than 386 and CGO_ENABLED is 0 this is the cause of those error messages. You can set them permanently to be 386 and 1 respectively by typing:

go env -w GOARCH=386
go env -w CGO_ENABLED=1

Or you could create a .vscode/settings.json file with the following contents:

{
    "go.toolsEnvVars": {
        "GOARCH": "386",
        "CGO_ENABLED": "1"
    }
}

Now you don't need to set these variables every time you open your project.

Credits

These people helped me a lot during the development of the package:

Documentation

Index

Constants

View Source
const (
	PlayerMarkerModeOff = iota
	PlayerMarkerModeGlobal
	PlayerMarkerModeStreamed
)
View Source
const (
	ObjectEditResponseCancel = iota
	ObjectEditResponseFinal
	ObjectEditResponseUpdate
)
View Source
const (
	ObjectMaterialSize32x32   = 10
	ObjectMaterialSize64x32   = 20
	ObjectMaterialSize64x64   = 30
	ObjectMaterialSize128x32  = 40
	ObjectMaterialSize128x64  = 50
	ObjectMaterialSize128x128 = 60
	ObjectMaterialSize256x32  = 70
	ObjectMaterialSize256x64  = 80
	ObjectMaterialSize256x128 = 90
	ObjectMaterialSize256x256 = 100
	ObjectMaterialSize512x64  = 110
	ObjectMaterialSize512x128 = 120
	ObjectMaterialSize512x256 = 130
	ObjectMaterialSize512x512 = 140
)
View Source
const (
	ObjectMaterialTextAlignLeft = iota
	ObjectMaterialTextAlignCenter
	ObjectMaterialTextAlignRight
)
View Source
const (
	PlayerWeaponSkillPistol = iota
	PlayerWeaponSkillSilencedPistol
	PlayerWeaponSkillDesertEagle
	PlayerWeaponSkillShotgun
	PlayerWeaponSkillSawnOff
	PlayerWeaponSkillSPAS12
	PlayerWeaponSkillUzi
	PlayerWeaponSkillMP5
	PlayerWeaponSkillAK47
	PlayerWeaponSkillM4
	PlayerWeaponSkillSniper
)
View Source
const (
	PlayerKeyAction          = 1
	PlayerKeyCrouch          = 2
	PlayerKeyFire            = 4
	PlayerKeySprint          = 8
	PlayerKeySecondaryAttack = 16
	PlayerKeyJump            = 32
	PlayerKeyLookRight       = 64
	PlayerKeyHandbrake       = 128
	PlayerKeyAim             = 128
	PlayerKeyLookLeft        = 256
	PlayerKeyLookBehind      = 512
	PlayerKeySubmission      = 512
	PlayerKeyWalk            = 1024
	PlayerKeyAnalogUp        = 2048
	PlayerKeyAnalogDown      = 4096
	PlayerKeyAnalogLeft      = 8192
	PlayerKeyAnalogRight     = 16384
	PlayerKeyYes             = 65536
	PlayerKeyNo              = 131072
	PlayerKeyCtrlBack        = 262144
	PlayerKeyUp              = -128
	PlayerKeyDown            = 128
	PlayerKeyLeft            = -128
	PlayerKeyRight           = 128
)
View Source
const (
	PlayerClickSourceScoreboard = iota
)

Variables

View Source
var DefaultDispatcher = NewDispatcher()

Functions

func AddCharModel

func AddCharModel(baseID, newID int, dff, txd string) error

func AddSimpleModel

func AddSimpleModel(vw, baseID, newID int, dff, txd string) error

func AddSimpleModelTimed

func AddSimpleModelTimed(vw, baseID, newID int, dff, txd string, timeOn, timeOff int) error

func AllowAdminTeleport

func AllowAdminTeleport()

func AreAllAnimationsEnabled

func AreAllAnimationsEnabled() bool

func AreInteriorEnterExitsEnabled

func AreInteriorEnterExitsEnabled() bool

func AreInteriorWeaponsAllowed

func AreInteriorWeaponsAllowed() bool

func ArePlayerPedAnimsEnabled

func ArePlayerPedAnimsEnabled() bool

func AreZoneNamesEnabled

func AreZoneNamesEnabled() bool

func ConfigOption

func ConfigOption[T ConfigOptionValue](key string) T

func ConnectNPC

func ConnectNPC(name string, script string)

func DisableAllAnimations

func DisableAllAnimations()

func DisableChatInputFilter

func DisableChatInputFilter()

func DisableInteriorEnterExits

func DisableInteriorEnterExits()

func DisableManualEngineAndLights

func DisableManualEngineAndLights()

func DisableNametagLOS

func DisableNametagLOS()

func DisableNametags

func DisableNametags()

func DisableObjectsCameraCollision

func DisableObjectsCameraCollision()

func DisablePlayerPedAnims

func DisablePlayerPedAnims()

func DisablePlayerTurfCheck

func DisablePlayerTurfCheck(turf *PlayerTurf)

func DisableTurfCheck

func DisableTurfCheck(turf *Turf)

func DisableVehicleFriendlyFire

func DisableVehicleFriendlyFire()

func DisableZoneNames

func DisableZoneNames()

func DisallowAdminTeleport

func DisallowAdminTeleport()

func EnableAllAnimations

func EnableAllAnimations()

func EnableChatInputFilter

func EnableChatInputFilter()

func EnableInteriorEnterExits

func EnableInteriorEnterExits()

func EnableManualEngineAndLights

func EnableManualEngineAndLights()

func EnableNametagLOS

func EnableNametagLOS()

func EnableNametags

func EnableNametags()

func EnableObjectsCameraCollision

func EnableObjectsCameraCollision()

func EnablePlayerPedAnims

func EnablePlayerPedAnims()

func EnablePlayerTurfCheck

func EnablePlayerTurfCheck(turf *PlayerTurf)

func EnableStuntBonuses

func EnableStuntBonuses()

func EnableTurfCheck

func EnableTurfCheck(turf *Turf)

func EnableVehicleFriendlyFire

func EnableVehicleFriendlyFire()

func EnableZoneNames

func EnableZoneNames()

func FreeActor

func FreeActor(actor *Actor)

func FreeClass

func FreeClass(cls *Class)

func FreeMenu

func FreeMenu(menu *Menu)

func FreeObject

func FreeObject(obj *Object)

func FreePickup

func FreePickup(pickup *Pickup)

func FreePlayerObject

func FreePlayerObject(obj *PlayerObject)

func FreePlayerPickup

func FreePlayerPickup(pickup *PlayerPickup)

func FreePlayerTextLabel

func FreePlayerTextLabel(tl *PlayerTextLabel)

func FreePlayerTextdraw

func FreePlayerTextdraw(td *PlayerTextdraw)

func FreePlayerTurf

func FreePlayerTurf(turf *PlayerTurf)

func FreeTextLabel

func FreeTextLabel(tl *TextLabel)

func FreeTextdraw

func FreeTextdraw(td *Textdraw)

func FreeTurf

func FreeTurf(turf *Turf)

func FreeVehicle

func FreeVehicle(veh *Vehicle)

func IsAdminTeleportAllowed

func IsAdminTeleportAllowed() bool

func IsChatInputFilterEnabled

func IsChatInputFilterEnabled() bool

func IsIPBanned

func IsIPBanned(IP string) bool

func IsManualEngineAndLightsEnabled

func IsManualEngineAndLightsEnabled() bool

func IsNametagLOSEnabled

func IsNametagLOSEnabled() bool

func IsNametagsEnabled

func IsNametagsEnabled() bool

func IsValidModel

func IsValidModel(modelID int) bool

func IsVehicleFriendlyFireEnabled

func IsVehicleFriendlyFireEnabled() bool

func LimitGlobalChatRadius

func LimitGlobalChatRadius(radius float64)

func LimitPlayerMarkerRadius

func LimitPlayerMarkerRadius(radius float64)

func Listen

func Listen(_type EventType, listener Listener)

func ListenFunc

func ListenFunc(_type EventType, listener func(context.Context, Event) error)

func Log

func Log(level LogLevel, format string, a ...any)

func MaxPlayers

func MaxPlayers() int

func ModelNameFromCRC

func ModelNameFromCRC(crc int) string

func ModelPath

func ModelPath(modelID int) (modelPath, error)

func PlayerMarkerMode

func PlayerMarkerMode() int

func Println

func Println(format string, a ...any)

func SendDeathMessage

func SendDeathMessage(killer *Player, killee *Player, weapon int)

func SendRCONCommand

func SendRCONCommand(command string)

func SetConfigOption

func SetConfigOption[T ConfigOptionValue](key string, value T)

func SetEventListener

func SetEventListener(listener Listener)

func SetGameModeText

func SetGameModeText(text string)

func SetLanguage

func SetLanguage(language string)

func SetMapName

func SetMapName(name string)

func SetNametagDrawRadius

func SetNametagDrawRadius(radius float64)

func SetPlayerMarkerMode

func SetPlayerMarkerMode(mode int)

func SetServerName

func SetServerName(name string)

func SetURL

func SetURL(url string)

func SetWeather

func SetWeather(weather int)

func SetWorldTime

func SetWorldTime(hours int)

func ShowGameTextForAll

func ShowGameTextForAll(msg string, delay time.Duration, style int)

func UsedVehicleModelCount

func UsedVehicleModelCount() int

Get the number of used vehicle models on the server.

func VehicleCountByModel

func VehicleCountByModel(model VehicleModel) int

func Weather

func Weather() int

func WorldTime

func WorldTime() int

Types

type Actor

type Actor struct {
	// contains filtered or unexported fields
}

func NewActor

func NewActor(skin int, pos Vector3, angle float32) (*Actor, error)

func (*Actor) Animation

func (a *Actor) Animation() Animation

func (*Actor) ApplyAnimation

func (a *Actor) ApplyAnimation(anim Animation)

func (*Actor) ClearAnimations

func (a *Actor) ClearAnimations()

func (*Actor) FacingAngle

func (a *Actor) FacingAngle() float32

func (*Actor) Health

func (a *Actor) Health() float32

func (*Actor) IsInvulnerable

func (a *Actor) IsInvulnerable() bool

func (*Actor) IsStreamedInFor

func (a *Actor) IsStreamedInFor(plr *Player) bool

func (*Actor) MakeInvulnerable

func (a *Actor) MakeInvulnerable()

func (*Actor) Position

func (a *Actor) Position() Vector3

func (*Actor) SetFacingAngle

func (a *Actor) SetFacingAngle(angle float32)

func (*Actor) SetHealth

func (a *Actor) SetHealth(health float32)

func (*Actor) SetPosition

func (a *Actor) SetPosition(pos Vector3)

func (*Actor) SetSkin

func (a *Actor) SetSkin(skin int)

func (*Actor) SetVirtualWorld

func (a *Actor) SetVirtualWorld(vw int)

func (*Actor) Skin

func (a *Actor) Skin() int

func (*Actor) SpawnData

func (a *Actor) SpawnData() ActorSpawnData

func (*Actor) UnmakeInvulnerable

func (a *Actor) UnmakeInvulnerable()

func (*Actor) VirtualWorld

func (a *Actor) VirtualWorld() int

type ActorSpawnData

type ActorSpawnData struct {
	Position    Vector3
	FacingAngle float32
	Skin        int
}

type ActorStreamInEvent

type ActorStreamInEvent struct {
	Actor     *Player
	ForPlayer *Player
}

type ActorStreamOutEvent

type ActorStreamOutEvent struct {
	Actor     *Player
	ForPlayer *Player
}

type Animation

type Animation struct {
	Lib, Name                  string
	Delta                      float32
	Loop, LockX, LockY, Freeze bool
	Duration                   time.Duration
}

type BodyPart

type BodyPart int
const (
	BodyPartTorso BodyPart = iota + 3
	BodyPartGroin
	BodyPartLeftArm
	BodyPartRightArm
	BodyPartLeftLeg
	BodyPartRightLeg
	BodyPartHead
)

type Class

type Class struct {
	// contains filtered or unexported fields
}

func NewClass

func NewClass(
	team,
	skin int,
	spawnPos Vector3,
	angle float32,
	weapon1 Weapon,
	ammo1 int,
	weapon2 Weapon,
	ammo2 int,
	weapon3 Weapon,
	ammo3 int,
) (*Class, error)

func (*Class) Ammo1

func (c *Class) Ammo1() int

func (*Class) Ammo2

func (c *Class) Ammo2() int

func (*Class) Ammo3

func (c *Class) Ammo3() int

func (*Class) Angle

func (c *Class) Angle() float32

func (*Class) ID

func (c *Class) ID() int

func (*Class) SetAmmo1

func (c *Class) SetAmmo1(ammo1 int)

func (*Class) SetAmmo2

func (c *Class) SetAmmo2(ammo2 int)

func (*Class) SetAmmo3

func (c *Class) SetAmmo3(ammo3 int)

func (*Class) SetAngle

func (c *Class) SetAngle(angle float32)

func (*Class) SetSkin

func (c *Class) SetSkin(skin int)

func (*Class) SetSpawnPosition

func (c *Class) SetSpawnPosition(pos Vector3)

func (*Class) SetTeam

func (c *Class) SetTeam(team int)

func (*Class) SetWeapon1

func (c *Class) SetWeapon1(weapon1 Weapon)

func (*Class) SetWeapon2

func (c *Class) SetWeapon2(weapon2 Weapon)

func (*Class) SetWeapon3

func (c *Class) SetWeapon3(weapon3 Weapon)

func (*Class) Skin

func (c *Class) Skin() int

func (*Class) SpawnPosition

func (c *Class) SpawnPosition() Vector3

func (*Class) Team

func (c *Class) Team() int

func (*Class) Weapon1

func (c *Class) Weapon1() Weapon

func (*Class) Weapon2

func (c *Class) Weapon2() Weapon

func (*Class) Weapon3

func (c *Class) Weapon3() Weapon

type ClientCheckResponseEvent

type ClientCheckResponseEvent struct {
	Player     *Player
	ActionType int
	Address    int
	Results    int
}

type ConfigOptionValue

type ConfigOptionValue interface {
	float64 | int | bool
}

type ConsoleTextEvent

type ConsoleTextEvent struct {
	Command    string
	Parameters string
}

type DefaultCheckpoint

type DefaultCheckpoint struct {
	// contains filtered or unexported fields
}

func (*DefaultCheckpoint) Disable

func (c *DefaultCheckpoint) Disable()

func (*DefaultCheckpoint) Enable

func (c *DefaultCheckpoint) Enable()

func (*DefaultCheckpoint) IsEnabled

func (c *DefaultCheckpoint) IsEnabled() bool

func (*DefaultCheckpoint) IsPlayerInside

func (c *DefaultCheckpoint) IsPlayerInside() bool

func (*DefaultCheckpoint) Position

func (c *DefaultCheckpoint) Position() Vector3

func (*DefaultCheckpoint) Radius

func (c *DefaultCheckpoint) Radius() float32

func (*DefaultCheckpoint) SetPosition

func (c *DefaultCheckpoint) SetPosition(pos Vector3)

func (*DefaultCheckpoint) SetRadius

func (c *DefaultCheckpoint) SetRadius(radius float32)

type DialogResponse

type DialogResponse int
const (
	DialogResponseRight DialogResponse = iota
	DialogResponseLeft
)

type DisconnectReason

type DisconnectReason int
const (
	DisconnectReasonTimeout DisconnectReason = iota
	DisconnectReasonQuit
	DisconnectReasonKicked
	DisconnectReasonCustom
	DisconnectReasonModeEnd
)

type Dispatcher

type Dispatcher struct {
	// contains filtered or unexported fields
}

func NewDispatcher

func NewDispatcher() *Dispatcher

func (*Dispatcher) HandleEvent

func (d *Dispatcher) HandleEvent(ctx context.Context, e Event) error

func (*Dispatcher) HasListener

func (d *Dispatcher) HasListener(_type EventType) bool

func (*Dispatcher) Listen

func (d *Dispatcher) Listen(_type EventType, listener Listener)

func (*Dispatcher) ListenFunc

func (d *Dispatcher) ListenFunc(_type EventType, listener func(context.Context, Event) error)

func (*Dispatcher) Subscribe

func (d *Dispatcher) Subscribe(subscriber Subscriber)

func (*Dispatcher) SubscribeFunc

func (d *Dispatcher) SubscribeFunc(subscriber func() any)

type EnterExitModShopEvent

type EnterExitModShopEvent struct {
	Player     *Player
	EnterExit  bool
	InteriorID int
}

type Event

type Event interface {
	Type() EventType
	Payload() any
}

func NewEvent

func NewEvent(_type EventType, payload any) Event

type EventType

type EventType string
const (
	EventTypeGameModeInit EventType = "gameModeInit"
	EventTypeGameModeExit EventType = "gameModeExit"

	// Actor events
	EventTypePlayerGiveDamageActor EventType = "playerGiveDamageActor"
	EventTypeActorStreamOut        EventType = "actorStreamOut"
	EventTypeActorStreamIn         EventType = "actorStreamIn"

	// Checkpoint events
	EventTypePlayerEnterCheckpoint     EventType = "playerEnterCheckpoint"
	EventTypePlayerLeaveCheckpoint     EventType = "playerLeaveCheckpoint"
	EventTypePlayerEnterRaceCheckpoint EventType = "playerEnterRaceCheckpoint"
	EventTypePlayerLeaveRaceCheckpoint EventType = "playerLeaveRaceCheckpoint"

	// Class events
	EventTypePlayerRequestClass EventType = "playerRequestClass"

	// Console events
	EventTypeConsoleText      EventType = "consoleText"
	EventTypeRconLoginAttempt EventType = "rconLoginAttempt"

	// Custom model events
	EventTypePlayerFinishedDownloading EventType = "playerFinishedDownloading"
	EventTypePlayerRequestDownload     EventType = "playerRequestDownload"

	// Player dialog event
	EventTypeDialogResponse EventType = "dialogResponse"
	EventTypeDialogShow     EventType = "dialogShow"
	EventTypeDialogHide     EventType = "dialogHide"

	// Turf events
	EventTypePlayerEnterTurf       EventType = "playerEnterTurf"
	EventTypePlayerEnterPlayerTurf EventType = "playerEnterPlayerTurf"
	EventTypePlayerLeaveTurf       EventType = "playerLeaveTurf"
	EventTypePlayerLeavePlayerTurf EventType = "playerLeavePlayerTurf"
	EventTypePlayerClickTurf       EventType = "playerClickTurf"
	EventTypePlayerClickPlayerTurf EventType = "playerClickPlayerTurf"

	// Menu events
	EventTypePlayerSelectedMenuRow EventType = "playerSelectedMenuRow"
	EventTypePlayerExitedMenu      EventType = "playerExitedMenu"

	// Object events
	EventTypeObjectMoved            EventType = "objectMoved"
	EventTypePlayerObjectMoved      EventType = "playerObjectMoved"
	EventTypeObjectSelected         EventType = "objectSelected"
	EventTypePlayerObjectSelected   EventType = "playerObjectSelected"
	EventTypeObjectEdited           EventType = "objectEdited"
	EventTypePlayerObjectEdited     EventType = "playerObjectEdited"
	EventTypePlayerAttachmentEdited EventType = "playerAttachmentEdited"

	// Pickup events
	EventTypePlayerPickUpPickup       EventType = "playerPickUpPickup"
	EventTypePlayerPickUpPlayerPickup EventType = "playerPickUpPlayerPickup"

	// Player spawn events
	EventTypePlayerRequestSpawn EventType = "playerRequestSpawn"
	EventTypePlayerSpawn        EventType = "playerSpawn"

	// Player connect events
	EventTypeIncomingConnection EventType = "incomingConnection"
	EventTypePlayerConnect      EventType = "playerConnect"
	EventTypePlayerDisconnect   EventType = "playerDisconnect"
	EventTypePlayerClientInit   EventType = "playerClientInit"

	// Player stream events
	EventTypePlayerStreamIn  EventType = "playerStreamIn"
	EventTypePlayerStreamOut EventType = "playerStreamOut"

	// Player text events
	EventTypePlayerText        EventType = "playerText"
	EventTypePlayerCommandText EventType = "playerCommandText"

	// Player shot events
	EventTypePlayerShotMissed       EventType = "playerShotMissed"
	EventTypePlayerShotPlayer       EventType = "playerShotPlayer"
	EventTypePlayerShotVehicle      EventType = "playerShotVehicle"
	EventTypePlayerShotObject       EventType = "playerShotObject"
	EventTypePlayerShotPlayerObject EventType = "playerShotPlayerObject"

	// Player change events
	EventTypePlayerScoreChange    EventType = "playerScoreChange"
	EventTypePlayerNameChange     EventType = "playerNameChange"
	EventTypePlayerInteriorChange EventType = "playerInteriorChange"
	EventTypePlayerStateChange    EventType = "playerStateChange"
	EventTypePlayerKeyStateChange EventType = "playerKeyStateChange"

	// Player damage events
	EventTypePlayerDeath      EventType = "playerDeath"
	EventTypePlayerTakeDamage EventType = "playerTakeDamage"
	EventTypePlayerGiveDamage EventType = "playerGiveDamage"

	// Player click events
	EventTypePlayerClickMap    EventType = "playerClickMap"
	EventTypePlayerClickPlayer EventType = "playerClickPlayer"

	// Player check events
	EventTypeClientCheckResponse EventType = "clientCheckResponse"

	// Player update event
	EventTypePlayerUpdate EventType = "playerUpdate"

	// TextDraw events
	EventTypePlayerClickTextDraw                 EventType = "playerClickTextDraw"
	EventTypePlayerClickPlayerTextDraw           EventType = "playerClickPlayerTextDraw"
	EventTypePlayerCancelTextDrawSelection       EventType = "playerCancelTextDrawSelection"
	EventTypePlayerCancelPlayerTextDrawSelection EventType = "playerCancelPlayerTextDrawSelection"

	// Vehicle events
	EventTypeVehicleStreamIn           EventType = "vehicleStreamIn"
	EventTypeVehicleStreamOut          EventType = "vehicleStreamOut"
	EventTypeVehicleDeath              EventType = "vehicleDeath"
	EventTypePlayerEnterVehicle        EventType = "playerEnterVehicle"
	EventTypePlayerExitVehicle         EventType = "playerExitVehicle"
	EventTypeVehicleDamageStatusUpdate EventType = "vehicleDamageStatusUpdate"
	EventTypeVehiclePaintJob           EventType = "vehiclePaintJob"
	EventTypeVehicleMod                EventType = "vehicleMod"
	EventTypeVehicleRespray            EventType = "vehicleRespray"
	EventTypeEnterExitModShop          EventType = "enterExitModShop"
	EventTypeVehicleSpawn              EventType = "vehicleSpawn"
	EventTypeUnoccupiedVehicleUpdate   EventType = "unoccupiedVehicleUpdate"
	EventTypeTrailerUpdate             EventType = "trailerUpdate"
	EventTypeVehicleSirenStateChange   EventType = "vehicleSirenStateChange"
)

type IncomingConnectionEvent

type IncomingConnectionEvent struct {
	Player    *Player
	IPAddress string
	Port      int
}

type InputDialog

type InputDialog struct {
	Events                        *Dispatcher
	Title, Body, Button1, Button2 string
	// contains filtered or unexported fields
}

func NewInputDialog

func NewInputDialog(title, body, button1, button2 string) *InputDialog

func NewPasswordDialog

func NewPasswordDialog(title, body, button1, button2 string) *InputDialog

func (*InputDialog) HideFor

func (d *InputDialog) HideFor(player *Player)

func (*InputDialog) ShowFor

func (d *InputDialog) ShowFor(player *Player)

type InputDialogResponseEvent

type InputDialogResponseEvent struct {
	Player    *Player
	Response  DialogResponse
	InputText string
}

type ListDialog

type ListDialog struct {
	Events                  *Dispatcher
	Title, Button1, Button2 string
	// contains filtered or unexported fields
}

func NewListDialog

func NewListDialog(title, button1, button2 string) *ListDialog

func (*ListDialog) Add

func (d *ListDialog) Add(items ...string)

func (*ListDialog) HideFor

func (d *ListDialog) HideFor(player *Player)

func (*ListDialog) SetItems

func (d *ListDialog) SetItems(items []string)

func (*ListDialog) ShowFor

func (d *ListDialog) ShowFor(player *Player)

type ListDialogResponseEvent

type ListDialogResponseEvent struct {
	Player     *Player
	Response   DialogResponse
	ItemNumber int
	Item       string
}

type Listener

type Listener interface {
	HandleEvent(context.Context, Event) error
}

func EventListener

func EventListener() Listener

type ListenerFunc

type ListenerFunc func(context.Context, Event) error

func (ListenerFunc) HandleEvent

func (f ListenerFunc) HandleEvent(ctx context.Context, e Event) error

type LogLevel

type LogLevel int
const (
	LogLevelDebug LogLevel = iota
	LogLevelMessage
	LogLevelWarning
	LogLevelError
)
type Menu struct {
	// contains filtered or unexported fields
}

func NewMenu

func NewMenu(title string, pos Vector2, columns int, col1Width, col2Width float32) (*Menu, error)
func (m *Menu) AddItem(column int, text string)
func (m *Menu) ColumnCount() int
func (m *Menu) ColumnHeader(column int) string
func (m *Menu) ColumnWidths() Vector2
func (m *Menu) Disable()
func (m *Menu) DisableRow(row int)
func (m *Menu) HideFor(plr *Player)
func (m *Menu) IsEnabled() bool
func (m *Menu) IsRowEnabled(row int) bool
func (m *Menu) Item(column, row int) string
func (m *Menu) Position() Vector2
func (m *Menu) RowCount(column int) int
func (m *Menu) SetColumnHeader(column int, header string)
func (m *Menu) ShowFor(plr *Player)

type MessageDialog

type MessageDialog struct {
	Events                        *Dispatcher
	Title, Body, Button1, Button2 string
}

func NewMessageDialog

func NewMessageDialog(title, body, button1, button2 string) *MessageDialog

func (*MessageDialog) HideFor

func (d *MessageDialog) HideFor(player *Player)

func (*MessageDialog) ShowFor

func (d *MessageDialog) ShowFor(player *Player)

type MessageDialogResponseEvent

type MessageDialogResponseEvent struct {
	Player   *Player
	Response DialogResponse
}

type NPC

type NPC struct {
	// contains filtered or unexported fields
}

func CreateNPC

func CreateNPC(name string) *NPC

func GetNPCByID

func GetNPCByID(id int) *NPC

func (*NPC) AimAtPlayer

func (n *NPC) AimAtPlayer(player *Player, shoot bool, shootDelay int, updateAngle bool)

func (*NPC) Armour

func (n *NPC) Armour() float32

func (*NPC) FacingAngle

func (n *NPC) FacingAngle() float32

func (*NPC) Health

func (n *NPC) Health() float32

func (*NPC) ID

func (n *NPC) ID() int

func (*NPC) Interior

func (n *NPC) Interior() int

func (*NPC) IsDead

func (n *NPC) IsDead() bool

func (*NPC) IsInvulnerable

func (n *NPC) IsInvulnerable() bool

func (*NPC) IsMoving

func (n *NPC) IsMoving() bool

func (*NPC) IsPlayingPlayback

func (n *NPC) IsPlayingPlayback() bool

func (*NPC) IsStreamedInFor

func (n *NPC) IsStreamedInFor(player *Player) bool

func (*NPC) IsValid

func (n *NPC) IsValid() bool

func (*NPC) Keys

func (n *NPC) Keys() NPCKeyData

func (*NPC) MoveToPlayer

func (n *NPC) MoveToPlayer(player *Player, moveType NPCMoveType, speed float32, stopRange float32, autoRestart bool)

func (*NPC) PausePlayback

func (n *NPC) PausePlayback()

func (*NPC) Position

func (n *NPC) Position() Vector3

func (*NPC) PutInVehicle

func (n *NPC) PutInVehicle(vehicle *Vehicle, seat int)

func (*NPC) Release

func (n *NPC) Release()

func (*NPC) RemoveFromVehicle

func (n *NPC) RemoveFromVehicle()

func (*NPC) Respawn

func (n *NPC) Respawn()

func (*NPC) ResumePlayback

func (n *NPC) ResumePlayback()

func (*NPC) Rotation

func (n *NPC) Rotation() Vector3

func (*NPC) SetAmmo

func (n *NPC) SetAmmo(ammo int)

func (*NPC) SetArmour

func (n *NPC) SetArmour(armour float32)

func (*NPC) SetFacingAngle

func (n *NPC) SetFacingAngle(angle float32)

func (*NPC) SetHealth

func (n *NPC) SetHealth(health float32)

func (*NPC) SetInterior

func (n *NPC) SetInterior(interior int)

func (*NPC) SetInvulnerable

func (n *NPC) SetInvulnerable(invuln bool)

func (*NPC) SetKeys

func (n *NPC) SetKeys(upDown, leftRight, keys uint16)

func (*NPC) SetPosition

func (n *NPC) SetPosition(pos Vector3)

func (*NPC) SetRotation

func (n *NPC) SetRotation(rot Vector3)

func (*NPC) SetSkin

func (n *NPC) SetSkin(skin int)

func (*NPC) SetVirtualWorld

func (n *NPC) SetVirtualWorld(vw int)

func (*NPC) SetWeapon

func (n *NPC) SetWeapon(weapon Weapon)

func (*NPC) SetWeaponAccuracy

func (n *NPC) SetWeaponAccuracy(weapon Weapon, accuracy float32)

func (*NPC) SetWeaponSkillLevel

func (n *NPC) SetWeaponSkillLevel(skill PlayerWeaponSkill, level int)

func (*NPC) Spawn

func (n *NPC) Spawn()

func (*NPC) StartPlayback

func (n *NPC) StartPlayback(recordName string, autoUnload bool, startPos Vector3, startRot Vector3)

func (*NPC) StopAim

func (n *NPC) StopAim()

func (*NPC) StopMove

func (n *NPC) StopMove()

func (*NPC) StopPlayback

func (n *NPC) StopPlayback()

func (*NPC) Vehicle

func (n *NPC) Vehicle() (*Vehicle, error)

func (*NPC) VehicleSeat

func (n *NPC) VehicleSeat() int

func (*NPC) VirtualWorld

func (n *NPC) VirtualWorld() int

func (*NPC) Weapon

func (n *NPC) Weapon() Weapon

type NPCKeyData

type NPCKeyData struct {
	UpDown    uint16
	LeftRight uint16
	Keys      uint16
}

type NPCMoveType

type NPCMoveType int
const (
	NPCMoveTypeAuto NPCMoveType = iota
	NPCMoveTypeWalk
	NPCMoveTypeRun
	NPCMoveTypeSprint
	NPCMoveTypeDrive
)

type Object

type Object struct {
	// contains filtered or unexported fields
}

func NewObject

func NewObject(modelID int, drawDist float32, pos Vector3, rot Vector3) (*Object, error)

func (*Object) AttachToPlayer

func (o *Object) AttachToPlayer(plr *Player, offset Vector3, rot Vector3)

func (*Object) AttachToVehicle

func (o *Object) AttachToVehicle(veh *Vehicle, offset Vector3, rot Vector3)

func (*Object) DisableCameraCollision

func (o *Object) DisableCameraCollision()

func (*Object) DrawDistance

func (o *Object) DrawDistance() float32

func (*Object) EnableCameraCollision

func (o *Object) EnableCameraCollision()

func (*Object) IsCameraCollisionEnabled

func (o *Object) IsCameraCollisionEnabled() bool

func (*Object) IsMaterialSlotUsed

func (o *Object) IsMaterialSlotUsed(slotIdx int) bool

func (*Object) IsMoving

func (o *Object) IsMoving() bool

func (*Object) Material

func (o *Object) Material(slotIdx int) (ObjectMaterial, error)

func (*Object) MaterialText

func (o *Object) MaterialText(slotIdx int) (ObjectMaterialText, error)

func (*Object) Model

func (o *Object) Model() int

func (*Object) Move

func (o *Object) Move(pos Vector3, rot Vector3, speed float32) time.Duration

func (*Object) MovingData

func (o *Object) MovingData() ObjectMoveData

func (*Object) Position

func (o *Object) Position() Vector3

func (*Object) ResetAttachment

func (o *Object) ResetAttachment()

func (*Object) Rotation

func (o *Object) Rotation() Vector3

func (*Object) SetDrawDistance

func (o *Object) SetDrawDistance(drawDist float32)

func (*Object) SetMaterial

func (o *Object) SetMaterial(idx, model int, textureLib, textureName string, color int)

func (*Object) SetMaterialText

func (o *Object) SetMaterialText(
	slotIdx int,
	text string,
	size ObjectMaterialSize,
	fontFace string,
	fontSize int,
	bold bool,
	fontColor, bgColor uint,
	align ObjectMaterialTextAlign,
)

func (*Object) SetModel

func (o *Object) SetModel(model int)

func (*Object) SetPosition

func (o *Object) SetPosition(pos Vector3)

func (*Object) SetRotation

func (o *Object) SetRotation(rot Vector3)

func (*Object) Stop

func (o *Object) Stop()

type ObjectAttachmentData

type ObjectAttachmentData[T ObjectAttachmentTarget] struct {
	SyncRotation bool
	Target       T
	Offset       Vector3
	Rotation     Vector3
}

func ObjectAttachedData

func ObjectAttachedData[T ObjectAttachmentTarget](obj *Object) (ObjectAttachmentData[T], error)

type ObjectAttachmentTarget

type ObjectAttachmentTarget interface {
	Vehicle | Object | Player
}

type ObjectEditResponse

type ObjectEditResponse int

type ObjectEditedEvent

type ObjectEditedEvent struct {
	Player   *Player
	Object   *Object
	Response ObjectEditResponse
	Offset   Vector3
	Rotation Vector3
}

type ObjectMaterial

type ObjectMaterial struct {
	ModelID     int
	TextureLib  string
	TextureName string
	Color       uint
}

type ObjectMaterialSize

type ObjectMaterialSize int

type ObjectMaterialText

type ObjectMaterialText struct {
	Text            string
	MaterialSize    int
	FontFace        string
	FontSize        int
	IsBold          bool
	FontColor       uint
	BackgroundColor uint
	Alignment       int
}

type ObjectMaterialTextAlign

type ObjectMaterialTextAlign int

type ObjectMoveData

type ObjectMoveData struct {
	TargetPos Vector3
	TargetRot Vector3
	Speed     float32
}

type ObjectMovedEvent

type ObjectMovedEvent struct {
	Object *Object
}

type ObjectSelectedEvent

type ObjectSelectedEvent struct {
	Player   *Player
	Object   *Object
	Model    int
	Position Vector3
}

type Pickup

type Pickup struct {
	// contains filtered or unexported fields
}

func NewPickup

func NewPickup(modelID int, _type PickupType, virtualWorld int, pos Vector3) (*Pickup, error)

func (*Pickup) HideFor

func (p *Pickup) HideFor(plr *Player)

func (*Pickup) ID

func (p *Pickup) ID() int

func (*Pickup) IsHiddenFor

func (p *Pickup) IsHiddenFor(plr *Player) bool

func (*Pickup) IsStreamedInFor

func (p *Pickup) IsStreamedInFor(plr *Player) bool

func (*Pickup) Model

func (p *Pickup) Model() int

func (*Pickup) Position

func (p *Pickup) Position() Vector3

func (*Pickup) SetModel

func (p *Pickup) SetModel(model int)

func (*Pickup) SetPosition

func (p *Pickup) SetPosition(pos Vector3)

func (*Pickup) SetType

func (p *Pickup) SetType(_type PickupType)

func (*Pickup) SetVirtualWorld

func (p *Pickup) SetVirtualWorld(vw int)

func (*Pickup) ShowFor

func (p *Pickup) ShowFor(plr *Player)

func (*Pickup) Type

func (p *Pickup) Type() PickupType

func (*Pickup) VirtualWorld

func (p *Pickup) VirtualWorld() int

type PickupType

type PickupType uint8

type Player

type Player struct {
	// contains filtered or unexported fields
}

func Players

func Players() []*Player

func (*Player) Action

func (p *Player) Action() PlayerSpecialAction

Action returns the player's current special action.

func (*Player) AimZ

func (p *Player) AimZ() float32

AimZ returns the player's Z Aim (related to the camera and aiming).

func (*Player) AllowTeleport

func (p *Player) AllowTeleport()

AllowTeleport enables the teleporting ability for the player by right-clicking on the map.

func (*Player) AllowWeapons

func (p *Player) AllowWeapons()

AllowWeapons allows weapons for the player.

func (*Player) AnimationFlags

func (p *Player) AnimationFlags() int

AnimationFlags returns the player animation flags.

func (*Player) AnimationIndex

func (p *Player) AnimationIndex() int

AnimationIndex returns the index of any running applied animations.

func (*Player) ApplyAnimation

func (p *Player) ApplyAnimation(anim Animation, syncType PlayerAnimationSyncType)

ApplyAnimation applies an animation to the player.

func (*Player) AreWeaponsAllowed

func (p *Player) AreWeaponsAllowed() bool

AreWeaponsAllowed reports whether weapons are allowed for this player.

func (*Player) ArmedWeapon

func (p *Player) ArmedWeapon() Weapon

ArmedWeapon returns the weapon the player is currently holding.

func (*Player) ArmedWeaponAmmo

func (p *Player) ArmedWeaponAmmo() int

ArmedWeaponAmmo returns the amount of ammo in the player's current weapon.

func (*Player) Armor

func (p *Player) Armor() float32

Armor returns the armor level of the player.

func (*Player) AttachCameraToObject

func (p *Player) AttachCameraToObject(obj *Object)

AttachCameraToObject attaches the player camera to objects.

func (*Player) Attachment

func (p *Player) Attachment(slotIdx int) PlayerAttachment

Attachment returns the player attachment object data by slot index.

func (*Player) Ban

func (p *Player) Ban(reason string)

Ban bans the player with a reason.

func (*Player) BeginObjectEditing

func (p *Player) BeginObjectEditing(obj *Object)

BeginObjectEditing allows the player to edit an object (position and rotation) using their mouse on a GUI (Graphical User Interface).

func (*Player) BeginObjectSelecting

func (p *Player) BeginObjectSelecting()

BeginObjectSelecting displays the cursor and allows the player to select an object. EventTypeObjectSelected is called when the player selects an object.

func (*Player) CameraAspectRatio

func (p *Player) CameraAspectRatio() float32

CameraAspectRatio returns the aspect ratio of the player's camera.

func (*Player) CameraFrontVector

func (p *Player) CameraFrontVector() Vector3

CameraFrontVector returns the current direction of player's aiming in 3-D space, the coords are relative to the camera position, see CameraPosition method.

func (*Player) CameraLookAt

func (p *Player) CameraLookAt() Vector3

func (*Player) CameraMode

func (p *Player) CameraMode() int

CameraMode returns the current GTA camera mode for the requested player. The camera modes are useful in determining whether a player is aiming, doing a passenger driveby etc.

func (*Player) CameraPosition

func (p *Player) CameraPosition() Vector3

CameraPosition returns the position of the player's camera.

func (*Player) CameraTargetActor

func (p *Player) CameraTargetActor() *Actor

CameraTargetActor returns the actor the player is looking at (if any).

func (*Player) CameraTargetObject

func (p *Player) CameraTargetObject() *Object

CameraTargetActor returns the object the player is looking at (if any).

func (*Player) CameraTargetPlayer

func (p *Player) CameraTargetPlayer() *Player

CameraTargetActor returns the player the player is looking at (if any).

func (*Player) CameraTargetVehicle

func (p *Player) CameraTargetVehicle() *Vehicle

CameraTargetActor returns the vehicle the player is looking at (if any).

func (*Player) CameraZoom

func (p *Player) CameraZoom() float32

CameraZoom returns the game camera zoom level for the player.

func (*Player) ClearAnimations

func (p *Player) ClearAnimations(syncType PlayerAnimationSyncType)

ClearAnimations clears all animations for the player. It also cancels all current tasks such as jetpacking, parachuting, entering vehicles, driving (removes player out of vehicle), swimming, etc.

func (*Player) ClientVersion

func (p *Player) ClientVersion() int

func (*Player) ClientVersionName

func (p *Player) ClientVersionName() string

func (*Player) Color

func (p *Player) Color() uint

Color returns the color of the player's name and radar marker. Only works after SetColor.

func (*Player) ColorFor

func (p *Player) ColorFor(other *Player) (uint, error)

ColorFor returns another player's color for this player

func (*Player) CreateExplosion

func (p *Player) CreateExplosion(_type int, radius float32, pos Vector3)

CreateExplosion creates an explosion that is only visible to the player. This can be used to isolate explosions from other players or to make them only appear in specific virtual worlds.

func (*Player) CustomSkin

func (p *Player) CustomSkin() int

CustomSkin returns the class of the players custom skin downloaded from the server.

func (*Player) DefaultCheckpoint

func (p *Player) DefaultCheckpoint() *DefaultCheckpoint

DefaultCheckpoint returns the player's default checkpoint.

func (*Player) Dialog

func (p *Player) Dialog() (dialog, error)

Dialog returns the dialog that is shown to the player.

func (*Player) DialogData

func (p *Player) DialogData()

func (*Player) DialogID

func (p *Player) DialogID()

func (*Player) DisableCameraTargeting

func (p *Player) DisableCameraTargeting()

DisableCameraTargeting disables camera targetting functions for the player. Disabled by default to save bandwidth.

func (*Player) DisableGhostMode

func (p *Player) DisableGhostMode()

DisableGhostMode disables the player's ghost mode. Ghost mode disables the collision between player models.

func (*Player) DisableRemoteVehicleCollisions

func (p *Player) DisableRemoteVehicleCollisions()

DisableRemoteVehicleCollisions disables collisions between occupied vehicles for the player.

func (*Player) DisableSpectating

func (p *Player) DisableSpectating()

DisableSpectating disables the player's spectator mode.

func (*Player) DisableStuntBonuses

func (p *Player) DisableStuntBonuses()

DisableStuntBonuses disables stunt bonuses for the player.

func (*Player) DisableWidescreen

func (p *Player) DisableWidescreen()

DisableWidescreen disables player's widescreen.

func (*Player) DisallowTeleport

func (p *Player) DisallowTeleport()

DisallowTeleport disables the teleporting ability for the player by right-clicking on the map.

func (*Player) DisallowWeapons

func (p *Player) DisallowWeapons()

DisallowWeapons disallows weapons for the player.

func (*Player) DistanceFrom

func (p *Player) DistanceFrom(point Vector3) float32

DistanceFrom calculates the distance between the player and a map coordinate.

func (*Player) DrunkLevel

func (p *Player) DrunkLevel() int

DrunkLevel returns the player's level of drunkenness. If the level is less than 2000, the player is sober. The player's level of drunkness goes down slowly automatically (26 levels per second) but will always reach 2000 at the end. The higher drunkenness levels affect the player's camera, and the car driving handling. The level of drunkenness increases when the player drinks from a bottle (You can use SetSpecialAction to give them bottles).

func (*Player) EditAttachment

func (p *Player) EditAttachment(slotIdx int)

EditAttachment enters edition mode for an attached object.

func (*Player) EnableCameraTargeting

func (p *Player) EnableCameraTargeting()

EnableCameraTargeting enables camera targetting functions for the player. Disabled by default to save bandwidth.

func (*Player) EnableGhostMode

func (p *Player) EnableGhostMode()

EnableGhostMode enables the player's ghost mode. Ghost mode disables the collision between player models.

func (*Player) EnableRemoteVehicleCollisions

func (p *Player) EnableRemoteVehicleCollisions()

EnableRemoteVehicleCollisions enables collisions between occupied vehicles for the player.

func (*Player) EnableSpectating

func (p *Player) EnableSpectating()

EnableSpectating toggle the player to be in spectator mode. While in spectator mode the player can spectate (watch) other players and vehicles. After using this function, either SpectatePlayer or SpectateVehicle needs to be used.

func (*Player) EnableStuntBonuses

func (p *Player) EnableStuntBonuses()

EnableStuntBonuses enables stunt bonuses for the player.

func (*Player) EnableWidescreen

func (p *Player) EnableWidescreen()

EnableWidescreen enables player's widescreen.

func (*Player) EndObjectEditing

func (p *Player) EndObjectEditing()

EndObjectEditing cancels object edition mode for the player.

func (*Player) FacingAngle

func (p *Player) FacingAngle() float32

FacingAngle returns the angle the player is facing.

func (*Player) FightingStyle

func (p *Player) FightingStyle() PlayerFightingStyle

FightingStyle returns the fighting style the player currently using.

func (*Player) ForceClassSelection

func (p *Player) ForceClassSelection()

ForceClassSelection the player to go back to class selection.

func (*Player) Freeze

func (p *Player) Freeze()

Freeze freezes the player so that it cannot control their character. The player will also be unable to move their camera.

func (*Player) GameText

func (p *Player) GameText(style int) *PlayerGameText

GameText returns all the information on the given game text style.

func (*Player) GiveMoney

func (p *Player) GiveMoney(money int)

GiveMoney gives money to or takes money from the player.

func (*Player) GiveWeapon

func (p *Player) GiveWeapon(weapon Weapon, ammo int)

GiveWeapon gives the player a weapon with a specified amount of ammo.

func (*Player) Gravity

func (p *Player) Gravity() float32

Gravity returns the player's gravity.

func (*Player) HasAttachment

func (p *Player) HasAttachment(slotIdx int) bool

HasAttachment reports whether the player has an attachment in the specified slot index.

func (*Player) Health

func (p *Player) Health() float32

Health allows you to retrieve the health of the player. Useful for cheat detection, among other things.

func (*Player) HideClock

func (p *Player) HideClock()

HideClock hides the in-game clock (top-right corner) for the player.

func (*Player) HideGameText

func (p *Player) HideGameText(style int)

HideGameText stops showing a gametext style to the player.

func (*Player) HideNameTagFor

func (p *Player) HideNameTagFor(other *Player)

HideNameTagFor disables the drawing of player nametags, healthbars and armor bars which display above their head.

func (*Player) ID

func (p *Player) ID() int

func (*Player) IP

func (p *Player) IP() string

IP returns the player's IP address.

func (*Player) Interior

func (p *Player) Interior() int

Interior returns the player's current interior. A list of currently known interiors with their positions can be found on this page: https://www.open.mp/docs/scripting/resources/interiorids

func (*Player) InterpolateCameraLookAt

func (p *Player) InterpolateCameraLookAt(from Vector3, to Vector3, time int, cutType PlayerCameraCutType)

InterpolateCameraLookAt interpolates the player's camera's 'look at' point between two coordinates with a set speed. Can be be used with InterpolateCameraPosition.

func (*Player) InterpolateCameraPosition

func (p *Player) InterpolateCameraPosition(from Vector3, to Vector3, time int, cutType PlayerCameraCutType)

InterpolateCameraPosition moves the player's camera from one position to another, within the set time. Useful for scripted cut scenes.

func (*Player) IsAdmin

func (p *Player) IsAdmin() bool

IsAdmin reports whether the player is an RCON admin.

func (*Player) IsBot

func (p *Player) IsBot() bool

IsBot reports whether the player is an actual player or a bot (NPC).

func (*Player) IsCameraTargetingEnabled

func (p *Player) IsCameraTargetingEnabled() bool

IsCameraTargetingEnabled reports whether camera targetting functions are enabled for the player. Disabled by default to save bandwidth.

func (*Player) IsClockShown

func (p *Player) IsClockShown() bool

IsClockShown reports whether the in-game clock is shown for the player.

func (*Player) IsEditingObject

func (p *Player) IsEditingObject() bool

IsEditingObject reports whether the player is in object edition mode.

func (*Player) IsFrozen

func (p *Player) IsFrozen() bool

IsFrozen reports whether the player can control their character.

func (*Player) IsGameTextShown

func (p *Player) IsGameTextShown(style int)

IsGameTextShown reports whether the player currently have text in the given gametext style displayed.

func (*Player) IsGhostModeEnabled

func (p *Player) IsGhostModeEnabled() bool

IsGhostModeEnabled reports whether ghost mode is enabled.

func (*Player) IsInRangeOf

func (p *Player) IsInRangeOf(point Vector3, _range float32) bool

IsInRangeOf reports whether the player is in range of a point.

func (*Player) IsSelectingObject

func (p *Player) IsSelectingObject() bool

IsSelectingObject reports whether the player is in object selection mode.

func (*Player) IsSpawned

func (p *Player) IsSpawned() bool

IsSpawned reports whether the player is spawned.

func (*Player) IsStreamedInFor

func (p *Player) IsStreamedInFor(other *Player) bool

IsStreamedInFor reports whether the player is streamed in another player's client.

func (*Player) IsTeleportAllowed

func (p *Player) IsTeleportAllowed() bool

Reports whether the teleporting ability for the player by right-clicking on the map is enabled.

func (*Player) IsUsingOfficialClient

func (p *Player) IsUsingOfficialClient() bool

IsUsingOfficialClient reports whether the player is using the official SA-MP client.

func (*Player) IsWidescreenEnabled

func (p *Player) IsWidescreenEnabled() bool

IsWidescreenEnabled reports whether player's widescreen is enabled.

func (*Player) KeyData

func (p *Player) KeyData() PlayerKeyData

KeyData checks which keys the player is pressing.

func (*Player) Kick

func (p *Player) Kick()

Kick kicks the player from the server. They will have to quit the game and re-connect if they wish to continue playing.

func (*Player) LastPlayedAudio

func (p *Player) LastPlayedAudio() string

LastPlayedAudio returns the player's last played audio URL.

func (*Player) LastPlayedSound

func (p *Player) LastPlayedSound() int

LastPlayedSound returns the sound that was last played for the player.

func (*Player) MakeAdmin

func (p *Player) MakeAdmin()

MakeAdmin makes the player as an RCON admin.

func (*Player) Menu

func (p *Player) Menu(target *Player)

func (*Player) Money

func (p *Player) Money() int

Money checks how much money the player has.

func (*Player) Name

func (p *Player) Name() string

Name returns the player's name.

func (*Player) NetworkStats

func (p *Player) NetworkStats()

func (*Player) Ping

func (p *Player) Ping() int

Ping returns the ping of the player. The ping measures the amount of time it takes for the server to 'ping' the client and for the client to send the message back.

func (*Player) PlayAudio

func (p *Player) PlayAudio(url string, usePos bool, pos Vector3, distance float32)

PlayAudio plays an 'audio stream' for the player. Normal audio files also work (e.g. MP3).

func (*Player) PlayCrimeReport

func (p *Player) PlayCrimeReport(suspect *Player, crime int)

PlayCrimeReport plays a crime report for the player - just like in single-player when CJ commits a crime.

func (*Player) PlaySound

func (p *Player) PlaySound(sound int, pos Vector3)

PlaySound plays the specified sound for the player.

func (*Player) Position

func (p *Player) Position() Vector3

Position returns the player's position.

func (*Player) RaceCheckpoint

func (p *Player) RaceCheckpoint() *RaceCheckpoint

RaceCheckpoint returns the player's race checkpoint.

func (*Player) RawIP

func (p *Player) RawIP() int

RawIP returns the player's Raw IP address (v4).

func (*Player) RedirectDownload

func (p *Player) RedirectDownload(url string) error

func (*Player) RemoveAttachment

func (p *Player) RemoveAttachment(slotIdx int)

RemoveAttachment removes an attached object from the player.

func (*Player) RemoveDefaultObjects

func (p *Player) RemoveDefaultObjects(model int, radius float32, pos Vector3)

RemoveDefaultObjects removes a standard San Andreas model for the player within a specified range.

func (*Player) RemoveFromVehicle

func (p *Player) RemoveFromVehicle(force bool)

RemoveFromVehicle removes/ejects the player from their vehicle.

func (*Player) RemoveWeapon

func (p *Player) RemoveWeapon(weapon Weapon)

RemoveWeapon removes a specified weapon from the player.

func (*Player) RemovedBuildingCount

func (p *Player) RemovedBuildingCount() int

RemovedBuildingCount returns the number of removed buildings for the player.

func (*Player) ResetMoney

func (p *Player) ResetMoney()

ResetMoney resets the player's money to $0.

func (*Player) ResetWeapons

func (p *Player) ResetWeapons()

ResetWeapons removes all weapons from a player.

func (*Player) Rotation

func (p *Player) Rotation() Vector4

Rotation returns the players rotation on all axes as a quaternion.

func (*Player) Score

func (p *Player) Score() int

Score returns the player's score as it was set using SetScore.

func (*Player) SendClientCheck

func (p *Player) SendClientCheck(actionType, address, offset, count int)

SendClientCheck performs a memory check on the client.

func (*Player) SendClientMessage

func (p *Player) SendClientMessage(msg string, color uint)

SendClientMessage sends a message to the player with a chosen color in the chat. The whole line in the chatbox will be in the set color unless color embedding is used.

func (*Player) SendDeathMessage

func (p *Player) SendDeathMessage(killer *Player, killee *Player, weapon int)

SendDeathMessage adds a death to the 'killfeed' on the right-hand side of the screen for the player.

func (*Player) SendEmptyDeathMessage

func (p *Player) SendEmptyDeathMessage()

func (*Player) SendMessageFrom

func (p *Player) SendMessageFrom(sender *Player, msg string)

SendMessageFrom sends a message in the name of a player to this player on the server. The message will appear in the chat box, but can only be seen by the player. The line will start with the sender's name in their color, followed by the message in white.

func (*Player) Serial

func (p *Player) Serial() string

Serial fetches the CI of the player, this is linked to their SAMP/GTA on their computer.

func (*Player) SetAction

func (p *Player) SetAction(action PlayerSpecialAction)

SetAction sets the players special action.

func (*Player) SetArmedWeapon

func (p *Player) SetArmedWeapon(weapon Weapon)

SetArmedWeapon sets which weapon (that the player already has) the player is holding.

func (*Player) SetArmor

func (p *Player) SetArmor(armor float32)

SetArmor sets the player's armor level.

func (*Player) SetAttachment

func (p *Player) SetAttachment(slotIdx int, attachment PlayerAttachment)

SetAttachment attaches an object to a specific bone on the player.

func (*Player) SetCameraBehind

func (p *Player) SetCameraBehind()

SetCameraBehind restores the camera to a place behind the player, after using a function like SetCameraPosition.

func (*Player) SetCameraLookAt

func (p *Player) SetCameraLookAt(pos Vector3, cutType PlayerCameraCutType)

SetCameraLookAt sets the direction the player's camera looks at. Generally meant to be used in combination with SetCameraPosition.

func (*Player) SetCameraPosition

func (p *Player) SetCameraPosition(pos Vector3)

SetCameraPosition sets the camera to a specific position for the player.

func (*Player) SetChatBubble

func (p *Player) SetChatBubble(text string, color uint, drawDist float32, expire time.Duration)

SetChatBubble creates a chat bubble above the player's name tag.

func (*Player) SetColor

func (p *Player) SetColor(color uint)

SetColor sets the color of the player's nametag and marker (radar blip).

func (*Player) SetColorFor

func (p *Player) SetColorFor(other *Player, color uint)

SetColorFor sets another player's color for this player

func (*Player) SetDrunkLevel

func (p *Player) SetDrunkLevel(level int)

SetDrunkLevel sets the drunk level of the player which makes the player's camera sway and vehicles hard to control.

func (*Player) SetFacingAngle

func (p *Player) SetFacingAngle(angle float32)

SetFacingAngle sets the player's facing angle (Z rotation).

func (*Player) SetFightingStyle

func (p *Player) SetFightingStyle(style PlayerFightingStyle)

SetFightingStyle sets the player's special fighting style. To use in-game, aim and press the 'secondary attack' key (ENTER by default).

func (*Player) SetGravity

func (p *Player) SetGravity(gravity float32)

SetGravity sets the player's gravity.

func (*Player) SetHealth

func (p *Player) SetHealth(health float32)

SetHealth sets the health of the player.

func (*Player) SetInterior

func (p *Player) SetInterior(interior int)

SetInterior sets the player's interior. A list of currently known interiors and their positions can be found here: https://www.open.mp/docs/scripting/resources/interiorids

func (*Player) SetMapIcon

func (p *Player) SetMapIcon(ID int, _type int, color uint, style int, pos Vector3)

SetMapIcon places an icon/marker on the player's map. Can be used to mark locations such as banks and hospitals to players.

func (*Player) SetMoney

func (p *Player) SetMoney(money int)

SetMoney sets the player's money

func (*Player) SetName

func (p *Player) SetName(name string) PlayerNameStatus

SetName sets the name of the player.

func (*Player) SetPosition

func (p *Player) SetPosition(pos Vector3)

SetPosition sets the player's position.

func (*Player) SetPositionFindZ

func (p *Player) SetPositionFindZ(pos Vector3)

SetPositionFindZ sets the player's position then adjusts the player's z-coordinate to the nearest solid ground under the position.

func (*Player) SetScore

func (p *Player) SetScore(score int)

SetScore sets the player's score. Players' scores are shown in the scoreboard (shown by holding the TAB key).

func (*Player) SetShopName

func (p *Player) SetShopName(name string)

SetShopName loads or unloads an interior script for the player (for example the ammunation menu).

func (*Player) SetSkillLevel

func (p *Player) SetSkillLevel(skill PlayerWeaponSkill, level int)

SetSkillLevel sets the skill level of a certain weapon type for the player.

func (*Player) SetSkin

func (p *Player) SetSkin(skin int)

SetSkin sets the skin of the player. A player's skin is their character model.

func (*Player) SetTeam

func (p *Player) SetTeam(team int)

SetTeam sets the team of the player.

func (*Player) SetTime

func (p *Player) SetTime(time PlayerTime)

SetTime sets the game time for the player. If the player's clock is enabled (EnableClock) the time displayed by it will update automatically.

func (*Player) SetVelocity

func (p *Player) SetVelocity(velocity Vector3)

SetVelocity sets the player's velocity on the X, Y and Z axes.

func (*Player) SetVirtualWorld

func (p *Player) SetVirtualWorld(vw int)

SetVirtualWorld sets the virtual world of the player. They can only see other players or vehicles that are in that same world.

func (*Player) SetWantedLevel

func (p *Player) SetWantedLevel(level int)

SetWantedLevel sets the player's wanted level (6 brown stars under HUD).

func (*Player) SetWeaponAmmo

func (p *Player) SetWeaponAmmo(weapon Weapon, ammo int)

SetWeaponAmmo sets the ammo of the player's weapon.

func (*Player) SetWeather

func (p *Player) SetWeather(weather int)

SetWeather sets the player's weather.

func (*Player) SetWorldBounds

func (p *Player) SetWorldBounds(bounds Vector4)

SetWorldBounds sets the world boundaries for the player. Players can not go out of the boundaries (they will be pushed back in).

func (*Player) SetWorldTime

func (p *Player) SetWorldTime(time int)

SetWorldTime sets the game time for the player. If the player's clock is enabled (ShowClock) the time displayed by it will update automatically.

func (*Player) ShopName

func (p *Player) ShopName() string

ShopName returns an interior script loaded or unloaded for the player

func (*Player) ShowClock

func (p *Player) ShowClock()

ShowClock shows the in-game clock (top-right corner) for the player. When this is enabled, time will progress at 1 minute per second. Weather will also interpolate (slowly change over time) when set using SetWeather/(*Player).SetWeather.

func (*Player) ShowGameText

func (p *Player) ShowGameText(msg string, delay time.Duration, style int)

ShowGameText shows 'game text' (on-screen text) for a certain length of time for the player.

func (*Player) ShowNameTagFor

func (p *Player) ShowNameTagFor(other *Player)

ShowNameTagFor enables the drawing of player nametags, healthbars and armor bars which display above their head. For use of a similar function like this on a global level, ShowNameTags function.

func (*Player) Skin

func (p *Player) Skin() int

Skin returns the class of the players skin.

func (*Player) Spawn

func (p *Player) Spawn()

Spawn (re)spawns the player.

func (*Player) SpectatePlayer

func (p *Player) SpectatePlayer(player *Player, mode PlayerSpectateMode)

SpectatePlayer makes the player spectate (watch) another player.

func (*Player) SpectateVehicle

func (p *Player) SpectateVehicle(vehicle *Vehicle, mode PlayerSpectateMode)

SpectateVehicle sets the player to spectate another vehicle. Their camera will be attached to the vehicle as if they are driving it.

func (*Player) SpectatingPlayer

func (p *Player) SpectatingPlayer() (*Player, error)

SpectatingPlayer returns the player the player is spectating (watching).

func (*Player) SpectatingVehicle

func (p *Player) SpectatingVehicle() (*Vehicle, error)

SpectatingVehicle returns the vehicle the player is spectating (watching).

func (*Player) State

func (p *Player) State() PlayerState

State returns the player's current state.

func (*Player) StopAudio

func (p *Player) StopAudio()

StopAudio stops the current audio stream for the player.

func (*Player) TargetActor

func (p *Player) TargetActor() *Actor

TargetActor returns the actor which is aimed by the player.

func (*Player) TargetPlayer

func (p *Player) TargetPlayer() *Player

TargetPlayer checks who the player is aiming at.

func (*Player) Team

func (p *Player) Team() int

Team returns the ID of the team the player is on.

func (*Player) Time

func (p *Player) Time() PlayerTime

Time returns the player's current game time. Set by SetWorldTime, or by the game automatically if EnableClock is used.

func (*Player) Unfreeze

func (p *Player) Unfreeze()

Unfreeze unfreezes the player so that it can control their character.

func (*Player) UnmakeAdmin

func (p *Player) UnmakeAdmin()

MakeAdmin unmakes the player as an RCON admin.

func (*Player) UnsetMapIcon

func (p *Player) UnsetMapIcon(ID int)

UnsetMapIcon removes a map icon for the player.

func (*Player) UnsetWorldBounds

func (p *Player) UnsetWorldBounds()

UnsetWorldBounds resets the player's world boundaries to default world boundaries.

func (*Player) Vehicle

func (p *Player) Vehicle() (*Vehicle, error)

Vehicle returns the vehicle the player is currently in.

func (*Player) VehicleSeat

func (p *Player) VehicleSeat() int

VehicleSeat returns the seat the player is in.

func (*Player) Velocity

func (p *Player) Velocity() Vector3

Returns the velocity (speed) of the player on the X, Y and Z axes.

func (*Player) VirtualWorld

func (p *Player) VirtualWorld() int

VirtualWorld returns the virtual world of the player.

func (*Player) WantedLevel

func (p *Player) WantedLevel() int

WantedLevel returns the wanted level of the player.

func (*Player) WeaponSlot

func (p *Player) WeaponSlot(slotIdx WeaponSlotIndex) (WeaponSlot, error)

WeaponSlot returns the weapon slot at a specified slot index An error is returned if invalid slot index is specified

func (*Player) WeaponSlots

func (p *Player) WeaponSlots() []*WeaponSlot

func (*Player) WeaponState

func (p *Player) WeaponState() PlayerWeaponState

WeaponState checks the state of the player's weapon.

func (*Player) Weather

func (p *Player) Weather() int

Weather returns the player's weather.

func (*Player) WorldBounds

func (p *Player) WorldBounds() Vector4

WorldBounds returns the player's world boundaries.

type PlayerAnimationSyncType

type PlayerAnimationSyncType int
const (
	PlayerAnimationSyncTypeNoSync PlayerAnimationSyncType = iota
	PlayerAnimationSyncTypeSync
	PlayerAnimationSyncTypeSyncOthers
)

type PlayerAttachment

type PlayerAttachment struct {
	ModelID            int
	Bone               PlayerBone
	Offset, Rot, Scale Vector3
	Color1, Color2     uint
}

type PlayerAttachmentEdited

type PlayerAttachmentEdited struct {
	Player     *Player
	Index      int
	Saved      bool
	Attachment PlayerAttachment
}

type PlayerBone

type PlayerBone int
const (
	PlayerBoneSpine PlayerBone = iota + 1
	PlayerBoneHead
	PlayerBoneLeftUpperArm
	PlayerBoneRightUpperArm
	PlayerBoneLeftHand
	PlayerBoneRightHand
	PlayerBoneLeftThigh
	PlayerBoneRightThigh
	PlayerBoneLeftFoot
	PlayerBoneRightFoot
	PlayerBoneRightCalf
	PlayerBoneLeftCalf
	PlayerBoneLeftForearm
	PlayerBoneRightForearm
	PlayerBoneLeftClavicle
	PlayerBoneRightClavicle
	PlayerBoneNeck
	PlayerBoneJaw
)

type PlayerBullet

type PlayerBullet struct {
	Origin  Vector3
	HitPos  Vector3
	Offset  Vector3
	Weapon  Weapon
	HitType int
	HitID   int
}

type PlayerBulletHitType

type PlayerBulletHitType int
const (
	PlayerBulletHitTypeNone PlayerBulletHitType = iota
	PlayerBulletHitTypePlayer
	PlayerBulletHitTypeVehicle
	PlayerBulletHitTypeObject
	PlayerBulletHitTypePlayerObject
)

type PlayerCameraCutType

type PlayerCameraCutType int
const (
	PlayerCameraCutTypeCut PlayerCameraCutType = iota
	PlayerCameraCutTypeMove
)

type PlayerCancelPlayerTextDrawSelectionEvent

type PlayerCancelPlayerTextDrawSelectionEvent struct {
	Player *Player
}

type PlayerCancelTextDrawSelectionEvent

type PlayerCancelTextDrawSelectionEvent struct {
	Player *Player
}

type PlayerClickMapEvent

type PlayerClickMapEvent struct {
	Player   *Player
	Position Vector3
}

type PlayerClickPlayerEvent

type PlayerClickPlayerEvent struct {
	Player  *Player
	Clicked *Player
	Source  PlayerClickSource
}

type PlayerClickPlayerTextDrawEvent

type PlayerClickPlayerTextDrawEvent struct {
	Player   *Player
	Textdraw *PlayerTextdraw
}

type PlayerClickPlayerTurfEvent

type PlayerClickPlayerTurfEvent struct {
	Player *Player
	Turf   *PlayerTurf
}

type PlayerClickSource

type PlayerClickSource int

type PlayerClickTextDrawEvent

type PlayerClickTextDrawEvent struct {
	Player   *Player
	Textdraw *Textdraw
}

type PlayerClickTurfEvent

type PlayerClickTurfEvent struct {
	Player *Player
	Turf   *Turf
}

type PlayerClientInitEvent

type PlayerClientInitEvent struct {
	Player *Player
}

type PlayerCommandTextEvent

type PlayerCommandTextEvent struct {
	Sender   *Player
	Name     string
	Args     []string
	RawValue string
}

type PlayerConnectEvent

type PlayerConnectEvent struct {
	Player *Player
}

type PlayerDeathEvent

type PlayerDeathEvent struct {
	Player *Player
	Killer *Player
	Reason int
}

type PlayerDisconnectEvent

type PlayerDisconnectEvent struct {
	Player *Player
	Reason DisconnectReason
}

type PlayerEnterCheckpointEvent

type PlayerEnterCheckpointEvent struct {
	Player *Player
}

type PlayerEnterPlayerTurfEvent

type PlayerEnterPlayerTurfEvent struct {
	Player *Player
	Turf   *PlayerTurf
}

type PlayerEnterRaceCheckpointEvent

type PlayerEnterRaceCheckpointEvent struct {
	Player *Player
}

type PlayerEnterTurfEvent

type PlayerEnterTurfEvent struct {
	Player *Player
	Turf   *Turf
}

type PlayerEnterVehicleEvent

type PlayerEnterVehicleEvent struct {
	Player      *Player
	Vehicle     *Vehicle
	IsPassenger bool
}

type PlayerExitVehicleEvent

type PlayerExitVehicleEvent struct {
	Player  *Player
	Vehicle *Vehicle
}

type PlayerExitedMenuEvent

type PlayerExitedMenuEvent struct {
	Player *Player
}

type PlayerFightingStyle

type PlayerFightingStyle int
const (
	PlayerFightingStyleNormal   PlayerFightingStyle = 4
	PlayerFightingStyleBoxing   PlayerFightingStyle = 5
	PlayerFightingStyleKungfu   PlayerFightingStyle = 6
	PlayerFightingStyleKneeHead PlayerFightingStyle = 7
	PlayerFightingStyleGrabKick PlayerFightingStyle = 15
	PlayerFightingStyleElbow    PlayerFightingStyle = 16
)

type PlayerFinishedDownloadingEvent

type PlayerFinishedDownloadingEvent struct {
	Player *Player
}

type PlayerGameText

type PlayerGameText struct {
	Text      string
	Delay     time.Duration
	Remaining time.Duration
}

type PlayerGiveDamageActorEvent

type PlayerGiveDamageActorEvent struct {
	Player *Player
	Actor  *Player
	Amount float32
	Weapon uint
	Part   BodyPart
}

type PlayerGiveDamageEvent

type PlayerGiveDamageEvent struct {
	Player *Player
	To     *Player
	Amount float32
	Weapon Weapon
	Part   BodyPart
}

type PlayerInteriorChangeEvent

type PlayerInteriorChangeEvent struct {
	Player      *Player
	NewInterior uint
	OldInterior uint
}

type PlayerKeyData

type PlayerKeyData struct {
	Keys      int
	UpDown    int
	LeftRight int
}

type PlayerKeyStateChangeEvent

type PlayerKeyStateChangeEvent struct {
	Player  *Player
	NewKeys uint
	OldKeys uint
}

type PlayerLeaveCheckpointEvent

type PlayerLeaveCheckpointEvent struct {
	Player *Player
}

type PlayerLeavePlayerTurfEvent

type PlayerLeavePlayerTurfEvent struct {
	Player *Player
	Turf   *PlayerTurf
}

type PlayerLeaveRaceCheckpointEvent

type PlayerLeaveRaceCheckpointEvent struct {
	Player *Player
}

type PlayerLeaveTurfEvent

type PlayerLeaveTurfEvent struct {
	Player *Player
	Turf   *Turf
}

type PlayerNameChangeEvent

type PlayerNameChangeEvent struct {
	Player  *Player
	OldName string
}

type PlayerNameStatus

type PlayerNameStatus int
const (
	PlayerNameStatusUpdated PlayerNameStatus = iota
	PlayerNameStatusTaken
	PlayerNameStatusInvalid
)

type PlayerObject

type PlayerObject struct {
	// contains filtered or unexported fields
}

func NewPlayerObject

func NewPlayerObject(plr *Player, modelID int, drawDist float32, pos Vector3, rot Vector3) (*PlayerObject, error)

func (*PlayerObject) AttachToPlayer

func (o *PlayerObject) AttachToPlayer(plr *Player, offset Vector3, rot Vector3)

func (*PlayerObject) AttachToVehicle

func (o *PlayerObject) AttachToVehicle(veh *Vehicle, offset Vector3, rot Vector3)

func (*PlayerObject) DisableCameraCollision

func (o *PlayerObject) DisableCameraCollision()

func (*PlayerObject) DrawDistance

func (o *PlayerObject) DrawDistance() float32

func (*PlayerObject) EnableCameraCollision

func (o *PlayerObject) EnableCameraCollision()

func (*PlayerObject) IsCameraCollisionEnabled

func (o *PlayerObject) IsCameraCollisionEnabled() bool

func (*PlayerObject) IsMaterialSlotUsed

func (o *PlayerObject) IsMaterialSlotUsed(slotIdx int) bool

func (*PlayerObject) IsMoving

func (o *PlayerObject) IsMoving() bool

func (*PlayerObject) Material

func (o *PlayerObject) Material(slotIdx int) (ObjectMaterial, error)

func (*PlayerObject) MaterialText

func (o *PlayerObject) MaterialText(slotIdx int) (ObjectMaterialText, error)

func (*PlayerObject) Model

func (o *PlayerObject) Model() int

func (*PlayerObject) Move

func (o *PlayerObject) Move(pos Vector3, rot Vector3, speed float32) time.Duration

func (*PlayerObject) MovingData

func (o *PlayerObject) MovingData() ObjectMoveData

func (*PlayerObject) Player

func (o *PlayerObject) Player() *Player

func (*PlayerObject) Position

func (o *PlayerObject) Position() Vector3

func (*PlayerObject) ResetAttachment

func (o *PlayerObject) ResetAttachment()

func (*PlayerObject) Rotation

func (o *PlayerObject) Rotation() Vector3

func (*PlayerObject) SetDrawDistance

func (o *PlayerObject) SetDrawDistance(drawDist float32)

func (*PlayerObject) SetMaterial

func (o *PlayerObject) SetMaterial(idx, model int, textureLib, textureName string, color int)

func (*PlayerObject) SetMaterialText

func (o *PlayerObject) SetMaterialText(
	slotIdx int,
	text string,
	size ObjectMaterialSize,
	fontFace string,
	fontSize int,
	bold bool,
	fontColor, bgColor uint,
	align ObjectMaterialTextAlign,
)

func (*PlayerObject) SetModel

func (o *PlayerObject) SetModel(model int)

func (*PlayerObject) SetPosition

func (o *PlayerObject) SetPosition(pos Vector3)

func (*PlayerObject) SetRotation

func (o *PlayerObject) SetRotation(rot Vector3)

func (*PlayerObject) Stop

func (o *PlayerObject) Stop()

type PlayerObjectEditedEvent

type PlayerObjectEditedEvent struct {
	Player   *Player
	Object   *PlayerObject
	Response ObjectEditResponse
	Offset   Vector3
	Rotation Vector3
}

type PlayerObjectMovedEvent

type PlayerObjectMovedEvent struct {
	Player *Player
	Object *PlayerObject
}

type PlayerObjectSelectedEvent

type PlayerObjectSelectedEvent struct {
	Player   *Player
	Object   *PlayerObject
	Model    int
	Position Vector3
}

type PlayerPickUpPickupEvent

type PlayerPickUpPickupEvent struct {
	Player *Player
	Pickup *Pickup
}

type PlayerPickUpPlayerPickupEvent

type PlayerPickUpPlayerPickupEvent struct {
	Player *Player
	Pickup *PlayerPickup
}

type PlayerPickup

type PlayerPickup struct {
	// contains filtered or unexported fields
}

func NewPlayerPickup

func NewPlayerPickup(plr *Player, modelID int, _type PickupType, virtualWorld int, pos Vector3) (*PlayerPickup, error)

func (*PlayerPickup) Hide

func (p *PlayerPickup) Hide()

func (*PlayerPickup) ID

func (p *PlayerPickup) ID() int

func (*PlayerPickup) IsHidden

func (p *PlayerPickup) IsHidden() bool

func (*PlayerPickup) IsStreamedIn

func (p *PlayerPickup) IsStreamedIn() bool

func (*PlayerPickup) Model

func (p *PlayerPickup) Model() int

func (*PlayerPickup) Player

func (p *PlayerPickup) Player() *Player

func (*PlayerPickup) Position

func (p *PlayerPickup) Position() Vector3

func (*PlayerPickup) SetModel

func (p *PlayerPickup) SetModel(model int)

func (*PlayerPickup) SetPosition

func (p *PlayerPickup) SetPosition(pos Vector3)

func (*PlayerPickup) SetType

func (p *PlayerPickup) SetType(_type PickupType)

func (*PlayerPickup) SetVirtualWorld

func (p *PlayerPickup) SetVirtualWorld(vw int)

func (*PlayerPickup) Show

func (p *PlayerPickup) Show()

func (*PlayerPickup) Type

func (p *PlayerPickup) Type() PickupType

func (*PlayerPickup) VirtualWorld

func (p *PlayerPickup) VirtualWorld() int

type PlayerRequestClassEvent

type PlayerRequestClassEvent struct {
	Player *Player
	Class  *Class
}

type PlayerRequestDownloadEvent

type PlayerRequestDownloadEvent struct {
	Player         *Player
	Type, Checksum int
}

type PlayerRequestSpawnEvent

type PlayerRequestSpawnEvent struct {
	Player *Player
}

type PlayerScoreChangeEvent

type PlayerScoreChangeEvent struct {
	Player *Player
	Score  int
}

type PlayerSelectedMenuRowEvent

type PlayerSelectedMenuRowEvent struct {
	Player  *Player
	MenuRow uint8
}

type PlayerShotMissedEvent

type PlayerShotMissedEvent struct {
	Player *Player
	Bullet PlayerBullet
}

type PlayerShotObjectEvent

type PlayerShotObjectEvent struct {
	Player *Player
	Target *Object
	Bullet PlayerBullet
}

type PlayerShotPlayerEvent

type PlayerShotPlayerEvent struct {
	Player *Player
	Target *Player
	Bullet PlayerBullet
}

type PlayerShotPlayerObjectEvent

type PlayerShotPlayerObjectEvent struct {
	Player *Player
	Target *PlayerObject
	Bullet PlayerBullet
}

type PlayerShotVehicleEvent

type PlayerShotVehicleEvent struct {
	Player *Player
	Target *Vehicle
	Bullet PlayerBullet
}

type PlayerSpawnEvent

type PlayerSpawnEvent struct {
	Player *Player
}

type PlayerSpecialAction

type PlayerSpecialAction int
const (
	PlayerSpecialActionNone PlayerSpecialAction = iota
	PlayerSpecialActionDuck
	PlayerSpecialActionJetpack
	PlayerSpecialActionEnterVehicle
	PlayerSpecialActionExitVehicle
	PlayerSpecialActionDance1
	PlayerSpecialActionDance2
	PlayerSpecialActionDance3
	PlayerSpecialActionDance4
)
const (
	PlayerSpecialActionHandsUp PlayerSpecialAction = iota + 10
	PlayerSpecialActionCellphone
	PlayerSpecialActionSitting
	PlayerSpecialActionStopCellphone
)
const (
	PlayerSpecialActionBeer PlayerSpecialAction = iota + 20
	PlayerSpecialActionSmoke
	PlayerSpecialActionWine
	PlayerSpecialActionSprunk
	PlayerSpecialActionCuffed
	PlayerSpecialActionCarry
)
const PlayerSpecialActionPissing PlayerSpecialAction = 68

type PlayerSpectateMode

type PlayerSpectateMode int
const (
	PlayerSpectateModeNormal PlayerSpectateMode = iota + 1
	PlayerSpectateModeFixed
	PlayerSpectateModeSide
)

type PlayerState

type PlayerState int
const (
	PlayerStateNone PlayerState = iota
	PlayerStateOnFoot
	PlayerStateDriver
	PlayerStatePassenger
	PlayerStateExitVehicle
	PlayerStateEnterVehicleDriver
	PlayerStateEnterVehiclePassenger
	PlayerStateWasted
	PlayerStateSpawned
	PlayerStateSpectating
)

type PlayerStateChangeEvent

type PlayerStateChangeEvent struct {
	Player   *Player
	NewState PlayerState
	OldState PlayerState
}

type PlayerStreamInEvent

type PlayerStreamInEvent struct {
	Player    *Player
	ForPlayer *Player
}

type PlayerStreamOutEvent

type PlayerStreamOutEvent struct {
	Player    *Player
	ForPlayer *Player
}

type PlayerTakeDamageEvent

type PlayerTakeDamageEvent struct {
	Player *Player
	From   *Player
	Amount float32
	Weapon Weapon
	Part   BodyPart
}

type PlayerTextEvent

type PlayerTextEvent struct {
	Player  *Player
	Message string
}

type PlayerTextLabel

type PlayerTextLabel struct {
	// contains filtered or unexported fields
}

func NewPlayerTextLabel

func NewPlayerTextLabel(plr *Player, text string, clr uint, pos Vector3, drawDist float32, vw int, los bool) (*PlayerTextLabel, error)

func (*PlayerTextLabel) AttachToPlayer

func (tl *PlayerTextLabel) AttachToPlayer(plr *Player, offset Vector3)

func (*PlayerTextLabel) AttachToVehicle

func (tl *PlayerTextLabel) AttachToVehicle(veh *Vehicle, offset Vector3)

func (*PlayerTextLabel) Color

func (tl *PlayerTextLabel) Color() uint

func (*PlayerTextLabel) DetachFromPlayer

func (tl *PlayerTextLabel) DetachFromPlayer(pos Vector3)

func (*PlayerTextLabel) DetachFromVehicle

func (tl *PlayerTextLabel) DetachFromVehicle(pos Vector3)

func (*PlayerTextLabel) DisableLOSTest

func (tl *PlayerTextLabel) DisableLOSTest()

func (*PlayerTextLabel) DrawDistance

func (tl *PlayerTextLabel) DrawDistance() float32

func (*PlayerTextLabel) EnableLOSTest

func (tl *PlayerTextLabel) EnableLOSTest()

func (*PlayerTextLabel) IsLOSTestEnabled

func (tl *PlayerTextLabel) IsLOSTestEnabled() bool

func (*PlayerTextLabel) Player

func (tl *PlayerTextLabel) Player() *Player

func (*PlayerTextLabel) Position

func (tl *PlayerTextLabel) Position() Vector3

func (*PlayerTextLabel) SetColor

func (tl *PlayerTextLabel) SetColor(clr uint)

func (*PlayerTextLabel) SetDrawDistance

func (tl *PlayerTextLabel) SetDrawDistance(drawDist float32)

func (*PlayerTextLabel) SetPosition

func (tl *PlayerTextLabel) SetPosition(pos Vector3)

func (*PlayerTextLabel) SetText

func (tl *PlayerTextLabel) SetText(text string)

func (*PlayerTextLabel) SetVirtualWorld

func (tl *PlayerTextLabel) SetVirtualWorld(vw int)

func (*PlayerTextLabel) Text

func (tl *PlayerTextLabel) Text() string

func (*PlayerTextLabel) VirtualWorld

func (tl *PlayerTextLabel) VirtualWorld() int

type PlayerTextdraw

type PlayerTextdraw struct {
	// contains filtered or unexported fields
}

func NewPlayerTextdraw

func NewPlayerTextdraw(plr *Player, text string, pos Vector2) (*PlayerTextdraw, error)

func (*PlayerTextdraw) Alignment

func (td *PlayerTextdraw) Alignment() TextDrawAlignment

func (*PlayerTextdraw) BackgroundColor

func (td *PlayerTextdraw) BackgroundColor() uint

func (*PlayerTextdraw) BoxColor

func (td *PlayerTextdraw) BoxColor() uint

func (*PlayerTextdraw) Color

func (td *PlayerTextdraw) Color() uint

func (*PlayerTextdraw) DisableBox

func (td *PlayerTextdraw) DisableBox()

func (*PlayerTextdraw) DisableProportionality

func (td *PlayerTextdraw) DisableProportionality()

func (*PlayerTextdraw) DisableSelection

func (td *PlayerTextdraw) DisableSelection()

func (*PlayerTextdraw) EnableBox

func (td *PlayerTextdraw) EnableBox()

func (*PlayerTextdraw) EnableProportionality

func (td *PlayerTextdraw) EnableProportionality()

func (*PlayerTextdraw) EnableSelection

func (td *PlayerTextdraw) EnableSelection()

func (*PlayerTextdraw) Hide

func (td *PlayerTextdraw) Hide()

func (*PlayerTextdraw) ID

func (td *PlayerTextdraw) ID() int

func (*PlayerTextdraw) IsBoxEnabled

func (td *PlayerTextdraw) IsBoxEnabled() bool

func (*PlayerTextdraw) IsProportional

func (td *PlayerTextdraw) IsProportional() bool

func (*PlayerTextdraw) IsSelectable

func (td *PlayerTextdraw) IsSelectable() bool

func (*PlayerTextdraw) IsShown

func (td *PlayerTextdraw) IsShown() bool

func (*PlayerTextdraw) LetterSize

func (td *PlayerTextdraw) LetterSize() Vector2

func (*PlayerTextdraw) Outline

func (td *PlayerTextdraw) Outline() int

func (*PlayerTextdraw) Player

func (td *PlayerTextdraw) Player() *Player

func (*PlayerTextdraw) Position

func (td *PlayerTextdraw) Position() Vector2

func (*PlayerTextdraw) PreviewModel

func (td *PlayerTextdraw) PreviewModel() int

func (*PlayerTextdraw) PreviewRotation

func (td *PlayerTextdraw) PreviewRotation() Vector3

func (*PlayerTextdraw) PreviewVehicleColor

func (td *PlayerTextdraw) PreviewVehicleColor() VehicleColor

func (*PlayerTextdraw) PreviewZoom

func (td *PlayerTextdraw) PreviewZoom() float32

func (*PlayerTextdraw) SetAlignment

func (td *PlayerTextdraw) SetAlignment(alignment TextDrawAlignment)

func (*PlayerTextdraw) SetBackgroundColor

func (td *PlayerTextdraw) SetBackgroundColor(color uint)

func (*PlayerTextdraw) SetBoxColor

func (td *PlayerTextdraw) SetBoxColor(color uint)

func (*PlayerTextdraw) SetColor

func (td *PlayerTextdraw) SetColor(color uint)

func (*PlayerTextdraw) SetLetterSize

func (td *PlayerTextdraw) SetLetterSize(size Vector2)

func (*PlayerTextdraw) SetOutline

func (td *PlayerTextdraw) SetOutline(outline int)

func (*PlayerTextdraw) SetPosition

func (td *PlayerTextdraw) SetPosition(pos Vector2)

func (*PlayerTextdraw) SetPreviewModel

func (td *PlayerTextdraw) SetPreviewModel(model int)

func (*PlayerTextdraw) SetPreviewRotation

func (td *PlayerTextdraw) SetPreviewRotation(rot Vector3)

func (*PlayerTextdraw) SetPreviewVehicleColor

func (td *PlayerTextdraw) SetPreviewVehicleColor(color VehicleColor)

func (*PlayerTextdraw) SetPreviewZoom

func (td *PlayerTextdraw) SetPreviewZoom(zoom float32)

func (*PlayerTextdraw) SetShadow

func (td *PlayerTextdraw) SetShadow(shadow int)

func (*PlayerTextdraw) SetStyle

func (td *PlayerTextdraw) SetStyle(style TextdrawStyle)

func (*PlayerTextdraw) SetText

func (td *PlayerTextdraw) SetText(text string)

func (*PlayerTextdraw) SetTextSize

func (td *PlayerTextdraw) SetTextSize(size Vector2)

func (*PlayerTextdraw) Shadow

func (td *PlayerTextdraw) Shadow() int

func (*PlayerTextdraw) Show

func (td *PlayerTextdraw) Show()

func (*PlayerTextdraw) Style

func (td *PlayerTextdraw) Style() TextdrawStyle

func (*PlayerTextdraw) Text

func (td *PlayerTextdraw) Text() string

func (*PlayerTextdraw) TextSize

func (td *PlayerTextdraw) TextSize() Vector2

type PlayerTime

type PlayerTime struct {
	Hours   int
	Minutes int
}

type PlayerTurf

type PlayerTurf struct {
	// contains filtered or unexported fields
}

func NewPlayerTurf

func NewPlayerTurf(plr *Player, pos TurfPosition) (*PlayerTurf, error)

func (*PlayerTurf) Color

func (t *PlayerTurf) Color() uint

func (*PlayerTurf) Flash

func (t *PlayerTurf) Flash(clr uint)

func (*PlayerTurf) FlashingColor

func (t *PlayerTurf) FlashingColor() uint

func (*PlayerTurf) Hide

func (t *PlayerTurf) Hide()

func (*PlayerTurf) IsFlashing

func (t *PlayerTurf) IsFlashing() bool

func (*PlayerTurf) IsPlayerInside

func (t *PlayerTurf) IsPlayerInside() bool

func (*PlayerTurf) IsShown

func (t *PlayerTurf) IsShown() bool

func (*PlayerTurf) Player

func (t *PlayerTurf) Player() *Player

func (*PlayerTurf) Position

func (t *PlayerTurf) Position() TurfPosition

func (*PlayerTurf) SetPosition

func (t *PlayerTurf) SetPosition(pos TurfPosition)

func (*PlayerTurf) Show

func (t *PlayerTurf) Show(clr uint)

func (*PlayerTurf) StopFlash

func (t *PlayerTurf) StopFlash()

type PlayerUpdateEvent

type PlayerUpdateEvent struct {
	Player *Player
	Now    time.Time
}

type PlayerWeaponSkill

type PlayerWeaponSkill int

type PlayerWeaponState

type PlayerWeaponState int
const (
	PlayerWeaponStateUnknown     PlayerWeaponState = -1
	PlayerWeaponStateNoBullets   PlayerWeaponState = 0
	PlayerWeaponStateLastBullet  PlayerWeaponState = 1
	PlayerWeaponStateMoreBullets PlayerWeaponState = 2
	PlayerWeaponStateReloading   PlayerWeaponState = 3
)

type RaceCheckpoint

type RaceCheckpoint struct {
	// contains filtered or unexported fields
}

func (*RaceCheckpoint) Disable

func (c *RaceCheckpoint) Disable()

func (*RaceCheckpoint) Enable

func (c *RaceCheckpoint) Enable()

func (*RaceCheckpoint) IsEnabled

func (c *RaceCheckpoint) IsEnabled() bool

func (*RaceCheckpoint) IsPlayerInside

func (c *RaceCheckpoint) IsPlayerInside() bool

func (*RaceCheckpoint) NextPosition

func (c *RaceCheckpoint) NextPosition() Vector3

func (*RaceCheckpoint) Position

func (c *RaceCheckpoint) Position() Vector3

func (*RaceCheckpoint) Radius

func (c *RaceCheckpoint) Radius() float32

func (*RaceCheckpoint) SetNextPosition

func (c *RaceCheckpoint) SetNextPosition(pos Vector3)

func (*RaceCheckpoint) SetPosition

func (c *RaceCheckpoint) SetPosition(pos Vector3)

func (*RaceCheckpoint) SetRadius

func (c *RaceCheckpoint) SetRadius(radius float32)

func (*RaceCheckpoint) SetType

func (c *RaceCheckpoint) SetType(_type RaceCheckpointType)

func (*RaceCheckpoint) Type

type RaceCheckpointType

type RaceCheckpointType int
const (
	RaceCheckpointTypeNormal RaceCheckpointType = iota
	RaceCheckpointTypeFinish
	RaceCheckpointTypeNothing
	RaceCheckpointTypeAirNormal
	RaceCheckpointTypeAirFinish
	RaceCheckpointTypeAirOne
	RaceCheckpointTypeAirTwo
	RaceCheckpointTypeAirThree
	RaceCheckpointTypeAirFour
	RaceCheckpointTypeNone
)

type RconLoginAttemptEvent

type RconLoginAttemptEvent struct {
	Player   *Player
	Password string
	Success  bool
}

type Subscriber

type Subscriber interface {
	SubscribedEvents() any
}

type SubscriberFunc

type SubscriberFunc func() any

func (SubscriberFunc) SubscribedEvents

func (f SubscriberFunc) SubscribedEvents() any

type TabListDialog

type TabListDialog struct {
	Events                  *Dispatcher
	Title, Button1, Button2 string
	// contains filtered or unexported fields
}

func NewTabListDialog

func NewTabListDialog(title, button1, button2 string) *TabListDialog

func (*TabListDialog) Add

func (d *TabListDialog) Add(items ...TabListItem)

func (*TabListDialog) HideFor

func (d *TabListDialog) HideFor(player *Player)

func (*TabListDialog) SetHeader

func (d *TabListDialog) SetHeader(header TabListItem)

func (*TabListDialog) SetItems

func (d *TabListDialog) SetItems(items []TabListItem)

func (*TabListDialog) ShowFor

func (d *TabListDialog) ShowFor(player *Player)

type TabListDialogResponseEvent

type TabListDialogResponseEvent struct {
	Player     *Player
	Response   DialogResponse
	ItemNumber int
	Item       TabListItem
}

type TabListItem

type TabListItem []string

type TextDrawAlignment

type TextDrawAlignment int
const (
	TextdrawAlignmentDefault TextDrawAlignment = iota
	TextdrawAlignmentLeft
	TextdrawAlignmentCenter
	TextdrawAlignmentRight
)

type TextLabel

type TextLabel struct {
	// contains filtered or unexported fields
}

func NewTextLabel

func NewTextLabel(text string, clr uint, pos Vector3, drawDist float32, vw int, los bool) (*TextLabel, error)

func (*TextLabel) AttachToPlayer

func (tl *TextLabel) AttachToPlayer(plr *Player, offset Vector3)

func (*TextLabel) AttachToVehicle

func (tl *TextLabel) AttachToVehicle(veh *Vehicle, offset Vector3)

func (*TextLabel) Color

func (tl *TextLabel) Color() uint

func (*TextLabel) DetachFromPlayer

func (tl *TextLabel) DetachFromPlayer(pos Vector3)

func (*TextLabel) DetachFromVehicle

func (tl *TextLabel) DetachFromVehicle(pos Vector3)

func (*TextLabel) DisableLOSTest

func (tl *TextLabel) DisableLOSTest()

func (*TextLabel) DrawDistance

func (tl *TextLabel) DrawDistance() float32

func (*TextLabel) EnableLOSTest

func (tl *TextLabel) EnableLOSTest()

func (*TextLabel) IsLOSTestEnabled

func (tl *TextLabel) IsLOSTestEnabled() bool

func (*TextLabel) IsStreamedInFor

func (tl *TextLabel) IsStreamedInFor(plr *Player) bool

func (*TextLabel) Position

func (tl *TextLabel) Position() Vector3

func (*TextLabel) SetColor

func (tl *TextLabel) SetColor(clr uint)

func (*TextLabel) SetDrawDistance

func (tl *TextLabel) SetDrawDistance(drawDist float32)

func (*TextLabel) SetPosition

func (tl *TextLabel) SetPosition(pos Vector3)

func (*TextLabel) SetText

func (tl *TextLabel) SetText(text string)

func (*TextLabel) SetVirtualWorld

func (tl *TextLabel) SetVirtualWorld(vw int)

func (*TextLabel) Text

func (tl *TextLabel) Text() string

func (*TextLabel) VirtualWorld

func (tl *TextLabel) VirtualWorld() int

type TextLabelAttachmentData

type TextLabelAttachmentData[T TextLabelAttachmentTarget] struct {
	Target T
}

type TextLabelAttachmentTarget

type TextLabelAttachmentTarget interface {
	Vehicle | Player
}

type Textdraw

type Textdraw struct {
	// contains filtered or unexported fields
}

func NewTextdraw

func NewTextdraw(text string, pos Vector2) (*Textdraw, error)

func (*Textdraw) Alignment

func (td *Textdraw) Alignment() TextDrawAlignment

func (*Textdraw) BackgroundColor

func (td *Textdraw) BackgroundColor() uint

func (*Textdraw) BoxColor

func (td *Textdraw) BoxColor() uint

func (*Textdraw) Color

func (td *Textdraw) Color() uint

func (*Textdraw) DisableBox

func (td *Textdraw) DisableBox()

func (*Textdraw) DisableProportionality

func (td *Textdraw) DisableProportionality()

func (*Textdraw) DisableSelection

func (td *Textdraw) DisableSelection()

func (*Textdraw) EnableBox

func (td *Textdraw) EnableBox()

func (*Textdraw) EnableProportionality

func (td *Textdraw) EnableProportionality()

func (*Textdraw) EnableSelection

func (td *Textdraw) EnableSelection()

func (*Textdraw) HideFor

func (td *Textdraw) HideFor(plr *Player)

func (*Textdraw) ID

func (td *Textdraw) ID() int

func (*Textdraw) IsBoxEnabled

func (td *Textdraw) IsBoxEnabled() bool

func (*Textdraw) IsProportional

func (td *Textdraw) IsProportional() bool

func (*Textdraw) IsSelectable

func (td *Textdraw) IsSelectable() bool

func (*Textdraw) IsShownFor

func (td *Textdraw) IsShownFor(plr *Player) bool

func (*Textdraw) LetterSize

func (td *Textdraw) LetterSize() Vector2

func (*Textdraw) Outline

func (td *Textdraw) Outline() int

func (*Textdraw) Position

func (td *Textdraw) Position() Vector2

func (*Textdraw) PreviewModel

func (td *Textdraw) PreviewModel() int

func (*Textdraw) PreviewRotation

func (td *Textdraw) PreviewRotation() Vector3

func (*Textdraw) PreviewVehicleColor

func (td *Textdraw) PreviewVehicleColor() VehicleColor

func (*Textdraw) PreviewZoom

func (td *Textdraw) PreviewZoom() float32

func (*Textdraw) SetAlignment

func (td *Textdraw) SetAlignment(alignment TextDrawAlignment)

func (*Textdraw) SetBackgroundColor

func (td *Textdraw) SetBackgroundColor(color uint)

func (*Textdraw) SetBoxColor

func (td *Textdraw) SetBoxColor(color uint)

func (*Textdraw) SetColor

func (td *Textdraw) SetColor(color uint)

func (*Textdraw) SetLetterSize

func (td *Textdraw) SetLetterSize(size Vector2)

func (*Textdraw) SetOutline

func (td *Textdraw) SetOutline(outline int)

func (*Textdraw) SetPosition

func (td *Textdraw) SetPosition(pos Vector2)

func (*Textdraw) SetPreviewModel

func (td *Textdraw) SetPreviewModel(model int)

func (*Textdraw) SetPreviewRotation

func (td *Textdraw) SetPreviewRotation(rot Vector3)

func (*Textdraw) SetPreviewVehicleColor

func (td *Textdraw) SetPreviewVehicleColor(color VehicleColor)

func (*Textdraw) SetPreviewZoom

func (td *Textdraw) SetPreviewZoom(zoom float32)

func (*Textdraw) SetShadow

func (td *Textdraw) SetShadow(shadow int)

func (*Textdraw) SetStyle

func (td *Textdraw) SetStyle(style TextdrawStyle)

func (*Textdraw) SetText

func (td *Textdraw) SetText(text string)

func (*Textdraw) SetTextFor

func (td *Textdraw) SetTextFor(plr *Player, text string)

func (*Textdraw) SetTextSize

func (td *Textdraw) SetTextSize(size Vector2)

func (*Textdraw) Shadow

func (td *Textdraw) Shadow() int

func (*Textdraw) ShowFor

func (td *Textdraw) ShowFor(plr *Player)

func (*Textdraw) Style

func (td *Textdraw) Style() TextdrawStyle

func (*Textdraw) Text

func (td *Textdraw) Text() string

func (*Textdraw) TextSize

func (td *Textdraw) TextSize() Vector2

type TextdrawStyle

type TextdrawStyle int
const (
	TextdrawStyle0 TextdrawStyle = iota
	TextdrawStyle1
	TextdrawStyle2
	TextdrawStyle3
	TextdrawStyle4
	TextdrawStyle5
	TextdrawStyleFontBeckettRegular
	TextdrawStyleFontAharoniBold
	TextdrawStyleFontBankGothic
	TextdrawStylePricedown
	TextdrawStyleSprite
	TextdrawStylePreview
)

type TrailerUpdateEvent

type TrailerUpdateEvent struct {
	Player  *Player
	Vehicle *Vehicle
}

type Turf

type Turf struct {
	// contains filtered or unexported fields
}

func NewTurf

func NewTurf(pos TurfPosition) (*Turf, error)

func (*Turf) ColorFor

func (t *Turf) ColorFor(plr *Player) uint

func (*Turf) FlashFor

func (t *Turf) FlashFor(plr *Player, clr uint)

func (*Turf) FlashForAll

func (t *Turf) FlashForAll(clr uint)

func (*Turf) FlashingColorFor

func (t *Turf) FlashingColorFor(plr *Player) uint

func (*Turf) HideFor

func (t *Turf) HideFor(plr *Player)

func (*Turf) HideForAll

func (t *Turf) HideForAll()

func (*Turf) IsFlashingFor

func (t *Turf) IsFlashingFor(plr *Player) bool

func (*Turf) IsPlayerInside

func (t *Turf) IsPlayerInside(plr *Player) bool

func (*Turf) IsShownFor

func (t *Turf) IsShownFor(plr *Player) bool

func (*Turf) Position

func (t *Turf) Position() TurfPosition

func (*Turf) SetPosition

func (t *Turf) SetPosition(pos TurfPosition)

func (*Turf) ShowFor

func (t *Turf) ShowFor(plr *Player, clr uint)

func (*Turf) ShowForAll

func (t *Turf) ShowForAll(clr uint)

func (*Turf) StopFlashFor

func (t *Turf) StopFlashFor(plr *Player)

func (*Turf) StopFlashForAll

func (t *Turf) StopFlashForAll()

type TurfPosition

type TurfPosition struct {
	Min Vector2
	Max Vector2
}

type UnoccupiedVehicleUpdate

type UnoccupiedVehicleUpdate struct {
	Seat     int
	Position Vector3
	Velocity Vector3
}

type UnoccupiedVehicleUpdateEvent

type UnoccupiedVehicleUpdateEvent struct {
	Vehicle *Vehicle
	Player  *Player
	Update  UnoccupiedVehicleUpdate
}

type Vector2

type Vector2 struct {
	X, Y float32
}

type Vector3

type Vector3 struct {
	X, Y, Z float32
}

type Vector4

type Vector4 struct {
	X, Y, Z, W float32
}

type Vehicle

type Vehicle struct {
	// contains filtered or unexported fields
}

func NewStaticVehicle

func NewStaticVehicle(model VehicleModel, pos Vector3, angle float32) (*Vehicle, error)

func NewVehicle

func NewVehicle(model VehicleModel, pos Vector3, angle float32) (*Vehicle, error)

func Vehicles

func Vehicles() []*Vehicle

Gets an array variable of the IDs of the created vehicles on the server.

func (*Vehicle) AddComponent

func (v *Vehicle) AddComponent(componentID int)

Adds a 'component' (often referred to as a 'mod' (modification)) to a vehicle. Valid components can be found here: https://www.open.mp/docs/scripting/resources/carcomponentid

func (*Vehicle) AngularVelocity

func (v *Vehicle) AngularVelocity() Vector3

func (*Vehicle) AreDoorsLocked

func (v *Vehicle) AreDoorsLocked() bool

func (*Vehicle) AreLightsTurnedOn

func (v *Vehicle) AreLightsTurnedOn() bool

func (*Vehicle) AttachTrailer

func (v *Vehicle) AttachTrailer(trailer *Vehicle)

func (*Vehicle) Cab

func (v *Vehicle) Cab() *Vehicle

func (*Vehicle) CloseHood

func (v *Vehicle) CloseHood()

func (*Vehicle) CloseTrunk

func (v *Vehicle) CloseTrunk()

func (*Vehicle) Color

func (v *Vehicle) Color() VehicleColor

func (*Vehicle) ComponentInSlot

func (v *Vehicle) ComponentInSlot(slot int) int

func (*Vehicle) DamageStatus

func (v *Vehicle) DamageStatus() VehicleDamageStatus

func (*Vehicle) DetachTrailer

func (v *Vehicle) DetachTrailer()

func (*Vehicle) DisableObjective

func (v *Vehicle) DisableObjective()

func (*Vehicle) DisableObjectiveFor

func (v *Vehicle) DisableObjectiveFor(plr *Player)

func (*Vehicle) DisableSiren

func (v *Vehicle) DisableSiren()

Turn the siren for a vehicle off.

func (*Vehicle) DistanceFrom

func (v *Vehicle) DistanceFrom(point Vector3) float32

func (*Vehicle) DoorsState

func (v *Vehicle) DoorsState() VehicleDoorsState

Allows you to retrieve the current state of a vehicle's doors.

func (*Vehicle) Driver

func (v *Vehicle) Driver() (*Player, error)

Get the player driving the vehicle.

func (*Vehicle) EnableObjective

func (v *Vehicle) EnableObjective()

func (*Vehicle) EnableObjectiveFor

func (v *Vehicle) EnableObjectiveFor(plr *Player)

func (*Vehicle) EnableSiren

func (v *Vehicle) EnableSiren()

Turn the siren for a vehicle on.

func (*Vehicle) HasBeenOccupied

func (v *Vehicle) HasBeenOccupied() bool

Check if the vehicle was occupied since last spawn.

func (*Vehicle) Health

func (v *Vehicle) Health() float32

func (*Vehicle) Hide

func (v *Vehicle) Hide()

Hides a vehicle from the game.

func (*Vehicle) HydraThrustAngle

func (v *Vehicle) HydraThrustAngle() int

func (*Vehicle) Interior

func (v *Vehicle) Interior() int

func (*Vehicle) IsAlarmTurnedOn

func (v *Vehicle) IsAlarmTurnedOn() bool

func (*Vehicle) IsDead

func (v *Vehicle) IsDead() bool

Check if a vehicle is dead.

func (*Vehicle) IsEngineStarted

func (v *Vehicle) IsEngineStarted() bool

func (*Vehicle) IsHidden

func (v *Vehicle) IsHidden() bool

Checks if a vehicle is hidden.

func (*Vehicle) IsHoodOpen

func (v *Vehicle) IsHoodOpen() bool

func (*Vehicle) IsInRangeOf

func (v *Vehicle) IsInRangeOf(point Vector3, _range float32) bool

func (*Vehicle) IsObjectiveEnabled

func (v *Vehicle) IsObjectiveEnabled() bool

func (*Vehicle) IsOccupied

func (v *Vehicle) IsOccupied() bool

Check if vehicle is occupied.

func (*Vehicle) IsRespawning

func (v *Vehicle) IsRespawning() bool

func (*Vehicle) IsSirenEnabled

func (v *Vehicle) IsSirenEnabled() bool

func (*Vehicle) IsStreamedInFor

func (v *Vehicle) IsStreamedInFor(player *Player) bool

Checks if a vehicle is streamed in for a player. Only nearby vehicles are streamed in (visible) for a player.

func (*Vehicle) IsTrailer

func (v *Vehicle) IsTrailer() bool

func (*Vehicle) IsTrunkOpen

func (v *Vehicle) IsTrunkOpen() bool

func (*Vehicle) LandingGearState

func (v *Vehicle) LandingGearState() int

Gets the current vehicle landing gear state from the latest driver.

func (*Vehicle) LastDriver

func (v *Vehicle) LastDriver() (*Player, error)

Get the last driver of a vehicle.

func (*Vehicle) LastOccupiedAt

func (v *Vehicle) LastOccupiedAt() time.Time

func (*Vehicle) LastSpawnedAt

func (v *Vehicle) LastSpawnedAt() time.Time

func (*Vehicle) LockDoors

func (v *Vehicle) LockDoors()

func (*Vehicle) LockDoorsFor

func (v *Vehicle) LockDoorsFor(plr *Player)

func (*Vehicle) Matrix

func (v *Vehicle) Matrix()

func (*Vehicle) Model

func (v *Vehicle) Model() VehicleModel

Gets the model ID of a vehicle.

func (*Vehicle) NumberPlate

func (v *Vehicle) NumberPlate() string

func (*Vehicle) OpenHood

func (v *Vehicle) OpenHood()

func (*Vehicle) OpenTrunk

func (v *Vehicle) OpenTrunk()

func (*Vehicle) Paintjob

func (v *Vehicle) Paintjob() int

func (*Vehicle) Passengers

func (v *Vehicle) Passengers() []*Player

func (*Vehicle) Position

func (v *Vehicle) Position() Vector3

func (*Vehicle) PutPlayer

func (v *Vehicle) PutPlayer(plr *Player, seatID int)

func (*Vehicle) RemoveComponent

func (v *Vehicle) RemoveComponent(componentID int)

Remove a component from a vehicle.

func (*Vehicle) Repair

func (v *Vehicle) Repair()

Fully repairs a vehicle, including visual damage (bumps, dents, scratches, popped tires etc.).

func (*Vehicle) Respawn

func (v *Vehicle) Respawn()

func (*Vehicle) RespawnDelay

func (v *Vehicle) RespawnDelay() time.Duration

Get the respawn delay of a vehicle in seconds.

func (*Vehicle) Rotation

func (v *Vehicle) Rotation() Vector4

Returns a vehicle's rotation on all axes as a quaternion.

func (*Vehicle) SetAngularVelocity

func (v *Vehicle) SetAngularVelocity(vel Vector3)

Sets the angular X, Y and Z velocity of a vehicle.

func (*Vehicle) SetColor

func (v *Vehicle) SetColor(color VehicleColor)

func (*Vehicle) SetDamageStatus

func (v *Vehicle) SetDamageStatus(damageStatus VehicleDamageStatus)

Sets the various visual damage statuses of a vehicle, such as popped tires, broken lights and damaged panels.

func (*Vehicle) SetDead

func (v *Vehicle) SetDead(dead bool)

Sets the vehicle to dead.

func (*Vehicle) SetDoorsState

func (v *Vehicle) SetDoorsState(state VehicleDoorsState)

Allows you to open and close the doors of a vehicle.

func (*Vehicle) SetHealth

func (v *Vehicle) SetHealth(health float32)

Set a vehicle's health. When a vehicle's health decreases the engine will produce smoke, and finally fire when it decreases to less than 250 (25%).

func (*Vehicle) SetInterior

func (v *Vehicle) SetInterior(interior int)

func (*Vehicle) SetNumberPlate

func (v *Vehicle) SetNumberPlate(numberPlate string)

func (*Vehicle) SetPaintjob

func (v *Vehicle) SetPaintjob(paintjob int)

func (*Vehicle) SetPosition

func (v *Vehicle) SetPosition(pos Vector3)

Set a vehicle's position.

func (*Vehicle) SetRespawnDelay

func (v *Vehicle) SetRespawnDelay(respawnDelay time.Duration)

Set the respawn delay of a vehicle.

func (*Vehicle) SetVelocity

func (v *Vehicle) SetVelocity(vel Vector3)

Sets the X, Y and Z velocity of a vehicle.

func (*Vehicle) SetVirtualWorld

func (v *Vehicle) SetVirtualWorld(virtualWorld int)

Sets the 'virtual world' of a vehicle. Players will only be able to see vehicles in their own virtual world.

func (*Vehicle) SetWindowsState

func (v *Vehicle) SetWindowsState(state VehicleWindowsState)

Allows you to open and close the windows of a vehicle.

func (*Vehicle) SetZAngle

func (v *Vehicle) SetZAngle(zAngle float32)

Set the Z rotation (yaw) of a vehicle.

func (*Vehicle) Show

func (v *Vehicle) Show()

Shows the hidden vehicle.

func (*Vehicle) StartEngine

func (v *Vehicle) StartEngine()

func (*Vehicle) StopEngine

func (v *Vehicle) StopEngine()

func (*Vehicle) Trailer

func (v *Vehicle) Trailer() (*Vehicle, error)

func (*Vehicle) TrainSpeed

func (v *Vehicle) TrainSpeed() float32

func (*Vehicle) TurnOffAlarm

func (v *Vehicle) TurnOffAlarm()

func (*Vehicle) TurnOffLights

func (v *Vehicle) TurnOffLights()

func (*Vehicle) TurnOnAlarm

func (v *Vehicle) TurnOnAlarm()

func (*Vehicle) TurnOnLights

func (v *Vehicle) TurnOnLights()

func (*Vehicle) UnlockDoors

func (v *Vehicle) UnlockDoors()

func (*Vehicle) UnlockDoorsFor

func (v *Vehicle) UnlockDoorsFor(plr *Player)

func (*Vehicle) Velocity

func (v *Vehicle) Velocity() Vector3

Get the velocity of a vehicle on the X, Y and Z axes.

func (*Vehicle) VirtualWorld

func (v *Vehicle) VirtualWorld() int

Get the virtual world of a vehicle.

func (*Vehicle) WindowsState

func (v *Vehicle) WindowsState() VehicleWindowsState

Allows you to retrieve the current state of a vehicle's windows.

func (*Vehicle) ZAngle

func (v *Vehicle) ZAngle() float32

Get the rotation of a vehicle on the Z axis (yaw).

type VehicleColor

type VehicleColor struct {
	Primary   int
	Secondary int
}

func NewRandomVehicleColor

func NewRandomVehicleColor() *VehicleColor

type VehicleDamageStatus

type VehicleDamageStatus struct {
	Panels int
	Doors  int
	Lights int
	Tyres  int
}

type VehicleDamageStatusUpdateEvent

type VehicleDamageStatusUpdateEvent struct {
	Player  *Player
	Vehicle *Vehicle
}

type VehicleDeathEvent

type VehicleDeathEvent struct {
	Vehicle *Vehicle
	Killer  *Player
}

type VehicleDoorsState

type VehicleDoorsState struct {
	FrontLeft  bool
	FrontRight bool
	RearLeft   bool
	RearRight  bool
}

type VehicleModEvent

type VehicleModEvent struct {
	Player    *Player
	Vehicle   *Vehicle
	Component int
}

type VehicleModel

type VehicleModel int
const (
	VehicleModelLandstalker VehicleModel = iota + 400
	VehicleModelBravura
	VehicleModelBuffalo
	VehicleModelLinerunner
	VehicleModelPerrenial
	VehicleModelSentinel
	VehicleModelDumper
	VehicleModelFiretruck
	VehicleModelTrashmaster
	VehicleModelStretch
	VehicleModelManana
	VehicleModelInfernus
	VehicleModelVoodoo
	VehicleModelPony
	VehicleModelMule
	VehicleModelCheetah
	VehicleModelAmbulance
	VehicleModelLeviathan
	VehicleModelMoonbeam
	VehicleModelEsperanto
	VehicleModelTaxi
	VehicleModelWashington
	VehicleModelBobcat
	VehicleModelMrWhoopee
	VehicleModelBFInjection
	VehicleModelHunter
	VehicleModelPremier
	VehicleModelEnforcer
	VehicleModelSecuricar
	VehicleModelBanshee
	VehicleModelPredator
	VehicleModelBus
	VehicleModelRhino
	VehicleModelBarracks
	VehicleModelHotknife
	VehicleModelArticleTrailer1
	VehicleModelPrevion
	VehicleModelCoach
	VehicleModelCabbie
	VehicleModelStallion
	VehicleModelRumpo
	VehicleModelRCBandit
	VehicleModelRomero
	VehicleModelPacker
	VehicleModelMonster
	VehicleModelAdmiral
	VehicleModelSqualo
	VehicleModelSeasparrow
	VehicleModelPizzaBoy
	VehicleModelTram
	VehicleModelArticleTrailer2
	VehicleModelTurismo
	VehicleModelSpeeder
	VehicleModelReefer
	VehicleModelTropic
	VehicleModelFlatbed
	VehicleModelYankee
	VehicleModelCaddy
	VehicleModelSolair
	VehicleModelRCVan
	VehicleModelSkimmer
	VehicleModelPCJ600
	VehicleModelFaggio
	VehicleModelFreeway
	VehicleModelRCBaron
	VehicleModelRCRaider
	VehicleModelGlendale
	VehicleModelOceanic
	VehicleModelSanchez
	VehicleModelSparrow
	VehicleModelPatriot
	VehicleModelQuad
	VehicleModelCoastguard
	VehicleModelDinghy
	VehicleModelHermes
	VehicleModelSabre
	VehicleModelRustler
	VehicleModelZR350
	VehicleModelWalton
	VehicleModelRegina
	VehicleModelComet
	VehicleModelBMX
	VehicleModelBurrito
	VehicleModelCamper
	VehicleModelMarquis
	VehicleModelBaggage
	VehicleModelDozer
	VehicleModelMaverick
	VehicleModelNewsChopper
	VehicleModelRancher
	VehicleModelFBIRancher
	VehicleModelVirgo
	VehicleModelGreenwood
	VehicleModelJetmax
	VehicleModelHotringC
	VehicleModelSandking
	VehicleModelBlistaCompact
	VehicleModelPoliceMaverick
	VehicleModelBoxville
	VehicleModelBenson
	VehicleModelMesa
	VehicleModelRCGoblin
	VehicleModelHotringA
	VehicleModelHotringB
	VehicleModelBloodringBanger
	VehicleModelRancherLure
	VehicleModelSuperGT
	VehicleModelElegant
	VehicleModelJourney
	VehicleModelBike
	VehicleModelMountainBike
	VehicleModelBeagle
	VehicleModelCropdust
	VehicleModelStuntplane
	VehicleModelTanker
	VehicleModelRoadTrain
	VehicleModelNebula
	VehicleModelMajestic
	VehicleModelBuccaneer
	VehicleModelShamal
	VehicleModelHydra
	VehicleModelFCR900
	VehicleModelNRG500
	VehicleModelHPV1000
	VehicleModelCementTruck
	VehicleModelTowtruck
	VehicleModelFortune
	VehicleModelCadrona
	VehicleModelFBITruck
	VehicleModelWillard
	VehicleModelForklift
	VehicleModelTractor
	VehicleModelCombineHarvester
	VehicleModelFeltzer
	VehicleModelRemington
	VehicleModelSlamvan
	VehicleModelBlade
	VehicleModelFreight
	VehicleModelBrownstreak
	VehicleModelVortex
	VehicleModelVincent
	VehicleModelBullet
	VehicleModelClover
	VehicleModelSadler
	VehicleModelFiretruckLA
	VehicleModelHustler
	VehicleModelIntruder
	VehicleModelPrimo
	VehicleModelCargobob
	VehicleModelTampa
	VehicleModelSunrise
	VehicleModelMerit
	VehicleModelUtilityVan
	VehicleModelNevada
	VehicleModelYosemite
	VehicleModelWindsor
	VehicleModelMonsterA
	VehicleModelMonsterB
	VehicleModelUranus
	VehicleModelJester
	VehicleModelSultan
	VehicleModelStratum
	VehicleModelElegy
	VehicleModelRaindance
	VehicleModelRCTiger
	VehicleModelFlash
	VehicleModelTahoma
	VehicleModelSavanna
	VehicleModelBandito
	VehicleModelFreightTrailer
	VehicleModelStreakTrailer
	VehicleModelKart
	VehicleModelMower
	VehicleModelDuneride
	VehicleModelSweeper
	VehicleModelBroadway
	VehicleModelTornado
	VehicleModelAT400
	VehicleModelDFT30
	VehicleModelHuntley
	VehicleModelStafford
	VehicleModelBF400
	VehicleModelNewsvan
	VehicleModelTug
	VehicleModelPetrolTrailer
	VehicleModelEmperor
	VehicleModelWayfarer
	VehicleModelEuros
	VehicleModelHotdog
	VehicleModelClub
	VehicleModelFreightBoxTrailer
	VehicleModelArticleTrailer3
	VehicleModelAndromada
	VehicleModelDodo
	VehicleModelRCCam
	VehicleModelLaunch
	VehicleModelLSPDCar
	VehicleModelSFPDCar
	VehicleModelLVPDCar
	VehicleModelRanger
	VehicleModelPicador
	VehicleModelSWAT
	VehicleModelAlpha
	VehicleModelPhoenix
	VehicleModelGlendaleDamaged
	VehicleModelSadlerDamaged
	VehicleModelBaggageTrailerA
	VehicleModelBaggageTrailerB
	VehicleModelStairsTrailer
	VehicleModelBoxburg
	VehicleModelFarmTrailer
	VehicleModelUtilityTrailer
)

func (VehicleModel) FrontBumperZ

func (m VehicleModel) FrontBumperZ() float32

func (VehicleModel) FrontSeatPosition

func (m VehicleModel) FrontSeatPosition() Vector3

func (VehicleModel) FrontWheelsPosition

func (m VehicleModel) FrontWheelsPosition() Vector3

func (VehicleModel) MiddleWheelsPosition

func (m VehicleModel) MiddleWheelsPosition() Vector3

func (VehicleModel) PetrolCapPosition

func (m VehicleModel) PetrolCapPosition() Vector3

func (VehicleModel) RearBumperHeight

func (m VehicleModel) RearBumperHeight() float32

func (VehicleModel) RearSeatPosition

func (m VehicleModel) RearSeatPosition() Vector3

func (VehicleModel) RearWheelsPosition

func (m VehicleModel) RearWheelsPosition() Vector3

func (VehicleModel) Size

func (m VehicleModel) Size() Vector3

type VehiclePaintJobEvent

type VehiclePaintJobEvent struct {
	Player   *Player
	Vehicle  *Vehicle
	PaintJob int
}

type VehicleResprayEvent

type VehicleResprayEvent struct {
	Player  *Player
	Vehicle *Vehicle
	Color   VehicleColor
}

type VehicleSirenStateChangeEvent

type VehicleSirenStateChangeEvent struct {
	Player     *Player
	Vehicle    *Vehicle
	SirenState int
}

type VehicleSpawnEvent

type VehicleSpawnEvent struct {
	Vehicle *Vehicle
}

type VehicleStreamInEvent

type VehicleStreamInEvent struct {
	Vehicle   *Vehicle
	ForPlayer *Player
}

type VehicleStreamOutEvent

type VehicleStreamOutEvent struct {
	Vehicle   *Vehicle
	ForPlayer *Player
}

type VehicleWindowsState

type VehicleWindowsState struct {
	FrontLeft  bool
	FrontRight bool
	RearLeft   bool
	RearRight  bool
}

type Weapon

type Weapon int
const (
	WeaponFist Weapon = iota
	WeaponBrassKnuckle
	WeaponGolfClub
	WeaponNiteStick
	WeaponKnife
	WeaponBat
	WeaponShovel
	WeaponPoolStick
	WeaponKatana
	WeaponChainsaw
	WeaponDildo
	WeaponDildo2
	WeaponVibrator
	WeaponVibrator2
	WeaponFlower
	WeaponCane
	WeaponGrenade
	WeaponTeargas
	WeaponMoltov
)
const (
	WeaponColt45 Weapon = iota + 22
	WeaponSilenced
	WeaponDeagle
	WeaponShotgun
	WeaponSawedoff
	WeaponShotgspa
	WeaponUZI
	WeaponMP5
	WeaponAK47
	WeaponM4
	WeaponTEC9
	WeaponRifle
	WeaponSniper
	WeaponRocketLauncher
	WeaponHeatSeeker
	WeaponFlameThrower
	WeaponMinigun
	WeaponSatchel
	WeaponBomb
	WeaponSprayCan
	WeaponFireExtinguisher
	WeaponCamera
	WeaponNight_Vis_Goggles
	WeaponThermal_Goggles
	WeaponParachute
)
const (
	WeaponVehicle Weapon = iota + 49
	WeaponHeliblades
	WeaponExplosion
)
const (
	WeaponDrown Weapon = iota + 53
	WeaponCollision
	WeaponEnd
)

func (Weapon) SlotIndex

func (w Weapon) SlotIndex() WeaponSlotIndex

type WeaponSlot

type WeaponSlot struct {
	Weapon Weapon
	Ammo   int
}

type WeaponSlotIndex

type WeaponSlotIndex int
const (
	WeaponSlotIndexUnknown WeaponSlotIndex = iota - 1
	WeaponSlotIndexUnarmed
	WeaponSlotIndexMelee
	WeaponSlotIndexPistol
	WeaponSlotIndexShotgun
	WeaponSlotIndexMachineGun
	WeaponSlotIndexAssaultRifle
	WeaponSlotIndexLongRifle
	WeaponSlotIndexArtillery
	WeaponSlotIndexExplosives
	WeaponSlotIndexEquipment
	WeaponSlotIndexGift
	WeaponSlotIndexGadget
	WeaponSlotIndexDetonator
)

Directories

Path Synopsis
cmd
codegen command
grandlarc command
rivershell command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL