[SOLVED]A way to get a variable value from other players?

Hi,

For now, I just thinking of a solution to send any value from client to another client, by using the server, who use table to record this value. Each client send there own value and server send all value to all client.

But, I looking for a solution to do something like SetPlayerWantedLevel() and GetPlayerWantedLevel() but with what I want: SetSomething() and GetSomething() where this “Something” is a value of a choosen variable.

There is a way to do that? Or the client/server solution is the only/best way?

Thanks

Decorators on the ped? The server won’t be able to read them but if that’s fine this’ll work.

That look to be exactely what i’m looking for! Thank you!

I’ll perform some test and if that work, I’ll change the topic to solved

EDIT: Work very well, thanks you again @thallium !

I have a little problem:

if i do that:

DecorRegister("status",  3)
if DecorGetInt(GetPlayerPed(v), "status") == 1 then

That work, but, if I do that:

DecorRegister("score",  3)
AddTextComponentString( DecorGetInt(GetPlayerPed(v), "score") )

I don’t see the integer (I see nothing at all (but if a replace DecorGetInt(GetPlayerPed(v), "score") by GetPlayerName( v ) I see the name :confused: )

Any idea why?

thanks

EDIT: if i use tostring(DecorGetInt(GetPlayerPed(v), "score")) I got “false”

EDIT2: I have found a solution:

AddTextComponentString( tostring( Score(v) ) )

function Score(ply)
    if not DecorGetInt(GetPlayerPed(ply), "score") then
        return 0
    elseif DecorGetInt(GetPlayerPed(ply), "score") then
        return DecorGetInt(GetPlayerPed(ply), "score")
    end
end

that look working :wink:

I can see that decoration just set/get number, no string, there is something to set/get a string from player?

Thanks