Skip to content

Have implicit conversion for int -> CString #37

Open
citizenfx/fivem
#2822
@AvarianKnight

Description

@AvarianKnight

Goal

There are quite a lot of natives server-side that expect a char* over an actual integer, but using the default Player class, Handle is an int so in order to use player.Handle you constantly have to do player.Handle.ToString().

It might be more intuitive (and less verbose) for CString to handle this itself.

Importancy

Quality of Life (QoL)

API and/or potential implementation

public static implicit operator CString(int integer)
{
	return Create(int.ToString());
}

Extra

It might be better to add these to some of these native calls to the Player class itself, but being able to manually use these natives is also useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriageThis issue needs to be triaged

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions