Skip to content

normalM/citizenfx-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

citizenfx-go

Golang wrapper for the FiveM natives API

package main

import (
	"fmt"
	"syscall/js"

	cfx "github.com/normalM/citizenfx-go"
)

var (
	c  = make(chan bool)
	fn = js.FuncOf
)

func init() {
	cfx.Print(fmt.Sprintf("wasm %s loaded.", cfx.Server.GetCurrentResourceName()))
}
func main() {

	cfx.Server.RegisterCommand("test", fn(func(this js.Value, inputs []js.Value) interface{} {

		cfx.TriggerClientEvent(
			"chat:addMessage",
			-1,
			"TEST!!",
		)
		cfx.Print("DO IT!!!!!!!")

		return nil
	}), false)

	<-c
}

XVer.cloud

Releases

No releases published

Packages

No packages published

Languages