Setting skin for gender
#1

pawn Код:
else if (dialogid == 3)//Sex
    {
        if(!response) return ShowPlayerDialog(playerid, 3, DIALOG_STYLE_LIST, "Rigester", "Male \nFemale", "Ok", "Leave");

        new name[MAX_PLAYER_NAME], file[50];
        GetPlayerName(playerid, name, sizeof(name));
        format(file, sizeof(file), SERVER_USER_FILE, name);

        if (listitem == 0) dini_IntSet(file, "Gender",PlayerInfo[playerid][pGender] = 0);
        if (listitem == 0) SetPlayerSkin(playerid, 285);
        if (listitem == 0) PlayerInfo[playerid][pSkin] = 285;
        ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Where are you from?", "Los Santos \n San Fierro \n Las Venturas", "Ok", "Leave");
        if (listitem == 1) dini_IntSet(file, "Gender",PlayerInfo[playerid][pGender] = 1);
        if (listitem == 1) SetPlayerSkin(playerid, 55);
        if (listitem == 1) PlayerInfo[playerid][pSkin] = 55;
        ShowPlayerDialog(playerid, 4, DIALOG_STYLE_LIST, "Where are you from?", "Los Santos \n San Fierro \n Las Venturas", "Ok", "Leave");
    }

Please tell me how I can set skin for each gender...


Will rep+++++
Reply
#2

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(PlayerInfo[playerid][pGender] == 0) SetPlayerSkin(playerid,285);
    else if (PlayerInfo[playerid][pGender] == 1) SetPlayerSkin(playerid,55);
    return 1;
}
Reply
#3

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
pawn Код:
public OnPlayerSpawn(playerid)
{
    if(PlayerInfo[playerid][pGender] == 0) SetPlayerSkin(playerid,285);
    else if (PlayerInfo[playerid][pGender] == 1) SetPlayerSkin(playerid,55);
    return 1;
}
If I use this, They will spawn with that skin every time they join the game. I just want it for when they finish registration
Reply
#4

pawn Код:
if (dialogid == 3)
    {
        if(response)
        {
         
            if(listitem == 0)
            {
               dini_IntSet(file, "Gender",PlayerInfo[playerid][pGender] = 0) && SetPlayerSkin(playerid, 285) && PlayerInfo[playerid][pSkin] = 285;
            }
            if(listitem == 1)
            {
               dini_IntSet(file, "Gender",PlayerInfo[playerid][pGender] = 1) && SetPlayerSkin(playerid, 55) && PlayerInfo[playerid][pSkin] = 55;
            }
        }
        return 1;
    }
Reply
#5

Now I am getting an error

pawn Код:
error 022: must be lvalue (non-constant)
Error is on both lines in between the if statement
Reply
#6

Could someone help please
Reply
#7

@Alex make a .ini file where the skin id is saved as a variable, then make another function like
Код:
public OnPlayerSpawn(playerid)
{
    if(PlayerInfo[playerid][pGender] == 0) SetPlayerSkin(playerid,[Whatever Variable In the .ini file]);
    else if (PlayerInfo[playerid][pGender] == 1) SetPlayerSkin(playerid,[Whatever Variable In the .ini file]);
    return 1;
}
Also make sure to open all the dini files in a public code or else you will have to open it in all functions
Reply
#8

I didn't copy from other gamemode or someother guys script but i ain't use dini before.
Reply
#9

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
I didn't copy from other gamemode or someother guys script but i ain't use dini before.
Sorry I didn't read the full code read my edit
Reply
#10

Do you want these skins to be random every time?

EDIT: I will be able to make an array with female and male skins if you need random skins. Then you can just save them to a playerfile to have them load the next time the login, rather than them getting a new random skin.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)