Git Product home page Git Product logo

Comments (10)

valenttegar avatar valenttegar commented on August 31, 2024 2

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

Screenshot from 2024-06-19 23-40-31

from samp-cef-types.

Hold404 avatar Hold404 commented on August 31, 2024 1

Is it working now?

from samp-cef-types.

valenttegar avatar valenttegar commented on August 31, 2024

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.

GimmickPlus avatar GimmickPlus commented on August 31, 2024

Am I using it in the cef-template right way in the picture? I can't get the value from game:data:playerStats.
image

from samp-cef-types.

valenttegar avatar valenttegar commented on August 31, 2024

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 your devdependencies, and it won't cause an error. errors can occur in typescript if functions or data types are not defined.

Screenshot from 2024-06-19 14-49-00

from samp-cef-types.

GimmickPlus avatar GimmickPlus commented on August 31, 2024

It doesn't work.
image

from samp-cef-types.

GimmickPlus avatar GimmickPlus commented on August 31, 2024

`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

image
image

from samp-cef-types.

valenttegar avatar valenttegar commented on August 31, 2024

wait I'll try it, wait a sec

from samp-cef-types.

valenttegar avatar valenttegar commented on August 31, 2024

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.

GimmickPlus avatar GimmickPlus commented on August 31, 2024

Or do I have to wait for you to install Windows?

from samp-cef-types.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.