Jump to content

Saving player customisation server-side/client-side


Recommended Posts

Hey all,

First of all, I'm fairly new to C# which does not make this any easier to me. 😅

Currently I'm running into the issue of saving player customisation. I have tried a bunch of stuff to save the headblend for an example, but no luck... :(

At the moment I tried to do it server-side(C#), which is a big hassle as I can't get the HeadBlend element to a string. This always ends up with "GTANetworkAPI.HeadBlend" in the database.
Due to a lack of information on the Wiki, generating an array on the client-side(js) does not work either.


Currently what I have, server-side, is the code below.

            string[] playerOverlay = new string[] {};
            string[] playerClothes = new string[] {};
            string[] playerFeatures = new string[] {};
            for(int i = 0; i < 12; i++){
                string overlay = Convert.ToString(NAPI.Player.GetPlayerHeadOverlay(player, i));
            for(int i = 0; i < 11; i++){
                string clothes = Convert.ToString(NAPI.Player.GetPlayerClothes(player, i));
            for(int i = 0; i < 19; i++){
                string features = Convert.ToString(NAPI.Player.GetPlayerFaceFeature(player, i));

As I said, I tried multiple ways to convert it into a string and save it as an array. The 'convert.ToString()' is the result of many desperate attempts.

I'm aware that getting it client-side is better, but I lack the knowledge to get this working.


Hope one of you all can be my saving angel in this!

Edited by IblackhawkI
Link to comment
Share on other sites

Hey all,

Does anyone have an answer for me?
Tried some more things to translate the HeadOverlay to something readable, but no luck so far.

I kind of need to know how to translate the unit HeadOverlay to a string or int, something to put into a database in an array form.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...