SA-MP Forums Archive
PreviewModel don't update ? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PreviewModel don't update ? (/showthread.php?tid=656294)



PreviewModel don't update ? - Inuro - 12.07.2018

Hi,
I need you guys because I have a problem. I've created a register script in textdraw and when the player select his sex (female/man) the previewmodel skin should be automaticly changed by a default skin but nothing happen :/

There is my dialog response when the player select female or male

Quote:

if(dialogid == DIALOG_SEXE)
{
if(response)
{
if(listitem == 0)
{
PlayerInfo[playerid][pSex]=1;SetPlayerSkin(playerid, 26);PlayerInfo[playerid][pChar] = 26;
format(MessageInscri, sizeof(MessageInscri), "Sexe: Homme");
PlayerTextDrawSetString(playerid, Creationperso[playerid][12], MessageInscri);
PlayerTextDrawSetPreviewModel(playerid, Creationperso[playerid][7], 26);
PlayerTextDrawShow(playerid, Creationperso[playerid][12]);
SelectTextDraw(playerid, 0x0080FF);
}
else if(listitem == 1)
{
PlayerInfo[playerid][pSex]=2;SetPlayerSkin(playerid, 29;PlayerInfo[playerid][pChar] = 298;
format(MessageInscri, sizeof(MessageInscri), "Sexe: Femme");
PlayerTextDrawSetString(playerid, Creationperso[playerid][12], MessageInscri);
PlayerTextDrawSetPreviewModel(playerid, Creationperso[playerid][7], 29;
PlayerTextDrawShow(playerid, Creationperso[playerid][12]);
SelectTextDraw(playerid, 0x0080FF);
}
}
}

Here is my textdraw code :

Quote:

Creationperso[i][7] = CreatePlayerTextDraw(i, 186.333297, 139.568893, "");
PlayerTextDrawTextSize(i, Creationperso[i][7], 93.000000, 115.000000);
PlayerTextDrawAlignment(i, Creationperso[i][7], 1);
PlayerTextDrawColor(i, Creationperso[i][7], -1);
PlayerTextDrawSetShadow(i, Creationperso[i][7], 0);
PlayerTextDrawBackgroundColor(i, Creationperso[i][7], 1090519040);
PlayerTextDrawFont(i, Creationperso[i][7], 5);
PlayerTextDrawSetProportional(i, Creationperso[i][7], 0);
PlayerTextDrawSetSelectable(i, Creationperso[i][7], true);
PlayerTextDrawSetPreviewModel(i, Creationperso[i][7], 189);
PlayerTextDrawSetPreviewRot(i, Creationperso[i][7], 0.000000, 0.000000, 0.000000, 1.000000);




Re: PreviewModel don't update ? - Florin48 - 12.07.2018

have you tried to do that when you hit the skin to set it for you?


Re: PreviewModel don't update ? - Vennox - 12.07.2018

Try to re-show the textdraw to the player.
PHP код:
if(dialogid == DIALOG_SEXE)
{
    if(
response)
    {
        if(
listitem == 0)
        {
            
PlayerInfo[playerid][pSex]=1;SetPlayerSkin(playerid26);PlayerInfo[playerid][pChar] = 26;
            
format(MessageInscrisizeof(MessageInscri), "Sexe: Homme");
            
PlayerTextDrawSetString(playeridCreationperso[playerid][12], MessageInscri);
            
PlayerTextDrawSetPreviewModel(playeridCreationperso[playerid][7], 26);
            
PlayerTextDrawShow(playeridCreationperso[playerid][7]);
            
PlayerTextDrawShow(playeridCreationperso[playerid][12]);
            
SelectTextDraw(playerid0x0080FF);
        }
        else if(
listitem == 1)
        {
            
PlayerInfo[playerid][pSex]=2;SetPlayerSkin(playerid29;PlayerInfo[playerid][pChar] = 298;
            
format(MessageInscrisizeof(MessageInscri), "Sexe: Femme");
            
PlayerTextDrawSetString(playeridCreationperso[playerid][12], MessageInscri);
            
PlayerTextDrawSetPreviewModel(playeridCreationperso[playerid][7], 29;
            
PlayerTextDrawShow(playeridCreationperso[playerid][7]);
            
PlayerTextDrawShow(playeridCreationperso[playerid][12]);
            
SelectTextDraw(playerid0x0080FF);
        }
    }