Comments (10)
Or do I have to wait for you to install Windows?
my bad dude, i once made a modification to samp-cef changing some code to make it simpler and i realized at https://github.com/pycckue-bnepeg/samp-cef/blob/master/cef-interface/src/lib.rs#L78-L87 in my case i have changed it more simple so use it just like
cef.on('game:data:playerStats', (data: DataTypes) => {
//
})
in the source cef it gives index like this
[0] health
[1] max_health
[2] armour
[3] breath
[4] wanted
[5] weapon
[6] ammo
[7] max_ammo
[8] money
[9] velocity
so u should use it like this
cef.on('game:data:playerStats', (
health, // Index 0
max_health, // Index 1
armour, // Index 2
breath, // Index 3
wanted, // Index 4
weapon, // Index 5
ammo, // Index 6
max_ammo, // Index 7
money, // Index 8
velocity, // Index 9
) => {
//
})
problem solved guys, this is why whoever you are reading this should read documentation
from samp-cef-types.
Is it working now?
from samp-cef-types.
I can't use it, it works differently from the previous version. how
try this, it's not a release version so you can't add it using npm / yarn / pnpm, add in devDependencies
"samp-cef-types": "github:valenttegar/samp-cef-types#1a1d1a1",
from samp-cef-types.
Am I using it in the cef-template right way in the picture? I can't get the value from game:data:playerStats.
from samp-cef-types.
sorry, it looks like it was my mistake in documentation because the event in samp-cef can't give a result object as a json so we have to give it the object we took
- you don't need a template; you can use other frameworks like react, solid, etc. simply store
samp-cef-types
in yourdevdependencies
, and it won't cause an error. errors can occur in typescript if functions or data types are not defined.
from samp-cef-types.
from samp-cef-types.
`window.cef.emit('game:data:pollPlayerStats', true, 50);
const HandlePlayerData = (data: PlayerData) => {
console.log('Health: ', data.health);
}
window.cef.on('game:data:playerStats', HandlePlayerData);`
Not Working
from samp-cef-types.
wait I'll try it, wait a sec
from samp-cef-types.
i can't try for now, because samp-cef can't run on linux (by using proton) sorry for this time, ey but it worked because the initial time i contributed it worked make sure you call the function/file
- wait till i installed windows think.. i hate windows 3 times got bluescreen 2 times my code not saved because of that
from samp-cef-types.
Or do I have to wait for you to install Windows?
from samp-cef-types.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from samp-cef-types.