Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.

New to the forum? Say hello in this topic! Also make sure to read the rules.

I need a script for get player's profile info

Share questions and tutorials related to the map editor. Share you maps in the Superfighters Deluxe Custom Maps section.
Forum rules
By using the forum you agree to the following rules.
Post Reply
User avatar
Elhombreserio
Meatbag
Posts: 4
Joined: Mon Apr 27, 2020 5:41 pm
Title: JoJo
SFD Account: ELHOMBRESERIOYT
SFD Alias: Jotaro
Started SFD: February 2017
Location: Peru
Gender:

I need a script for get player's profile info

Post by Elhombreserio » Wed May 13, 2020 7:46 pm

I'm noob in C#, if anybody has an script for get profile(refer to clothes, accessory) please share!!
Thanks in advance :D 8-)
0 x
You can't control the non--existent :idea:
Image

User avatar
Odex64
Superfighter
Superfighter
Posts: 72
Joined: Sat Jul 29, 2017 12:39 pm
Title: Content Creator
SFD Account: Odex64
SFD Alias: Il Duce
Started SFD: Alpha
Location: Italy
Gender:
Age: 18

Post by Odex64 » Wed May 13, 2020 10:26 pm

JakSparro98 wrote:
Sat Jul 07, 2018 9:41 pm
MrWheatley wrote:
Wed Jul 04, 2018 8:44 pm
JakSparro98 wrote:
Wed Jul 04, 2018 5:59 pm

The Skin attribute in the IProfile class can change the skin color, you need to copy the current player profile, change the copy and then re-assing the latter to the player with SetProfile. You will only get the skin color changed keeping the clothings.

Provide your current code if you need help about implementing this function.
So I have to get they player's profile or the custom one, and what exactly do I have to change?
This is what I came up with but it only changes the skin to the default color.

Code: Select all

        public void ButtonPressed (TriggerArgs args)
        {
            foreach (IPlayer ply in Game.GetPlayers ())
            {
                if (args.Sender is IPlayer)
                {
                    IObject a = Game.CreateObject ("PlayerProfileInfo", new Vector2 (0, 0));
                    a.CustomId = "a";
                    ply.SetProfile (((IObjectPlayerProfileInfo) Game.GetSingleObjectByCustomId ("a")).GetProfile ());
                    IProfile ScoutProfile = new IProfile ();
                    ScoutProfile.Accesory = new IProfileClothingItem ("DogTag", "ClothingGray");
                    ScoutProfile.Head = new IProfileClothingItem ("Cap", "ClothingGray");
                    ScoutProfile.ChestUnder = new IProfileClothingItem ("TShirt", "ClothingRed");
                    ScoutProfile.Hands = new IProfileClothingItem ("FingerlessGloves", "ClothingLightGray");
                    ScoutProfile.Legs = new IProfileClothingItem ("Pants", "ClothingGray");
                    ScoutProfile.Feet = new IProfileClothingItem ("ShoesBlack", "ClothingLightGray");
                    ply.SetProfile (ScoutProfile);
                }
            }
        }
Since you're changing the entire player profile with a costum one you only need to add ScoutProfile.Skin=new IProfileClothingItem("Normal","Skin4"); before ply.SetProfile (ScoutProfile);

You can choose the skin type from Skin0 to Skin4.

With just a brief research on forums you can find some scripts about clothes and Skins, however since you're a newbie I'll slightly edit the code so you can use it almost anywhere.

Code: Select all

public void ButtonPressed(TriggerArgs args)
{
    foreach(IPlayer ply in Game.GetPlayers())
        if(args.Sender is IPlayer)
            ply.SetProfile(((IObjectPlayerProfileInfo) Game.GetSingleObjectByCustomId("myskin")).GetProfile());
}
Just open map editor, place a button and type "ButtonPressed" in ScriptMethod box; then create a (Player Profile Info) and name it "myskin" in "CustomID" box.

From now on, whenever you press that button you will get your custom profile.
1 x
Join our Special discord server forMap Makers & Scripters:
Hidden Content
This board requires you to be registered and logged-in to view hidden content.

User avatar
Elhombreserio
Meatbag
Posts: 4
Joined: Mon Apr 27, 2020 5:41 pm
Title: JoJo
SFD Account: ELHOMBRESERIOYT
SFD Alias: Jotaro
Started SFD: February 2017
Location: Peru
Gender:

Post by Elhombreserio » Fri May 15, 2020 2:39 am

Thanks man!!, but I need the same but with multiple player spawn (For example 4 players :D )
0 x
You can't control the non--existent :idea:
Image

User avatar
Odex64
Superfighter
Superfighter
Posts: 72
Joined: Sat Jul 29, 2017 12:39 pm
Title: Content Creator
SFD Account: Odex64
SFD Alias: Il Duce
Started SFD: Alpha
Location: Italy
Gender:
Age: 18

Post by Odex64 » Fri May 15, 2020 1:47 pm

Here's a very simple script for 4 players

Code: Select all

public void Button1(TriggerArgs args)
{
    IPlayer ply = (IPlayer) args.Sender;
    ply.SetProfile(((IObjectPlayerProfileInfo) Game.GetSingleObjectByCustomId("skin1")).GetProfile());
}
public void Button2(TriggerArgs args)
{
    IPlayer ply = (IPlayer) args.Sender;
    ply.SetProfile(((IObjectPlayerProfileInfo) Game.GetSingleObjectByCustomId("skin2")).GetProfile());
}
public void Button3(TriggerArgs args)
{
    IPlayer ply = (IPlayer) args.Sender;
    ply.SetProfile(((IObjectPlayerProfileInfo) Game.GetSingleObjectByCustomId("skin3")).GetProfile());
}
public void Button4(TriggerArgs args)
{
    IPlayer ply = (IPlayer) args.Sender;
    ply.SetProfile(((IObjectPlayerProfileInfo) Game.GetSingleObjectByCustomId("skin4")).GetProfile());
}
Just type "Button1" in Script Method for the first button, then "Button2" for the second and so on...
Remember to place 4 Profile Infos and assign them "skin1", "skin2" CustomID etc..

If you want to add more skins copy and paste the first piece of code and change its number, ex: Copy the Button1 code and change it to Button5 and skin5
0 x
Join our Special discord server forMap Makers & Scripters:
Hidden Content
This board requires you to be registered and logged-in to view hidden content.

User avatar
Elhombreserio
Meatbag
Posts: 4
Joined: Mon Apr 27, 2020 5:41 pm
Title: JoJo
SFD Account: ELHOMBRESERIOYT
SFD Alias: Jotaro
Started SFD: February 2017
Location: Peru
Gender:

Post by Elhombreserio » Mon May 18, 2020 9:27 pm

:), the script gives me an error
look https://i.imgur.com/S2dVmBA.png :roll:
0 x
You can't control the non--existent :idea:
Image

User avatar
Odex64
Superfighter
Superfighter
Posts: 72
Joined: Sat Jul 29, 2017 12:39 pm
Title: Content Creator
SFD Account: Odex64
SFD Alias: Il Duce
Started SFD: Alpha
Location: Italy
Gender:
Age: 18

Post by Odex64 » Mon May 18, 2020 10:12 pm

Use the following code:

Code: Select all

public void ButtonPressed(TriggerArgs args)
{
    IPlayer ply = (IPlayer) args.Sender;
    switch (((IObject) args.Caller).CustomId)
    {
        case "1":
            ply.SetProfile(((IObjectPlayerProfileInfo) Game.GetSingleObjectByCustomId("Skin1")).GetProfile());
            break;

        case "2":
            ply.SetProfile(((IObjectPlayerProfileInfo) Game.GetSingleObjectByCustomId("Skin2")).GetProfile());
            break;

        case "3":
            ply.SetProfile(((IObjectPlayerProfileInfo) Game.GetSingleObjectByCustomId("Skin3")).GetProfile());
            break;

        case "4":
            ply.SetProfile(((IObjectPlayerProfileInfo) Game.GetSingleObjectByCustomId("Skin4")).GetProfile());
            break;

        default:
            Game.ShowChatMessage("Error", Color.Cyan);
            break;
    }
}
Paste this code in your map, then place 4 Buttons and type "ButtonPressed" in Script Method for all the buttons; then type "1" in Object ID for the first button, "2" in Object ID for the second button, and so on..

and place 4 PlayerProfileInfo and type "Skin1" in Object ID (for the first ProfileInfo); type "Skin2" in Object ID for the second ProfileInfo, etc..

Now you're finally done. I hope..
0 x
Join our Special discord server forMap Makers & Scripters:
Hidden Content
This board requires you to be registered and logged-in to view hidden content.

User avatar
Elhombreserio
Meatbag
Posts: 4
Joined: Mon Apr 27, 2020 5:41 pm
Title: JoJo
SFD Account: ELHOMBRESERIOYT
SFD Alias: Jotaro
Started SFD: February 2017
Location: Peru
Gender:

Post by Elhombreserio » Mon May 18, 2020 10:45 pm

Don't work For my Map But Thanks Anyway
0 x
You can't control the non--existent :idea:
Image

User avatar
Odex64
Superfighter
Superfighter
Posts: 72
Joined: Sat Jul 29, 2017 12:39 pm
Title: Content Creator
SFD Account: Odex64
SFD Alias: Il Duce
Started SFD: Alpha
Location: Italy
Gender:
Age: 18

Post by Odex64 » Mon May 18, 2020 10:46 pm

Elhombreserio wrote:
Mon May 18, 2020 10:45 pm
Don't work For my Map But Thanks Anyway
Add me on discord:
Hidden Content
This board requires you to be registered and logged-in to view hidden content.
0 x
Join our Special discord server forMap Makers & Scripters:
Hidden Content
This board requires you to be registered and logged-in to view hidden content.

Post Reply