SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 12/07/2018, 11:43 AM   #1
Inuro
Huge Clucker
 
Inuro's Avatar
 
Join Date: Dec 2013
Posts: 456
Reputation: 11
Default PreviewModel don't update ?

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);
Inuro is offline   Reply With Quote
Old 12/07/2018, 12:19 PM   #2
Florin48
Huge Clucker
 
Join Date: Nov 2015
Location: Romania
Posts: 228
Reputation: 4
Default Re: PreviewModel don't update ?

have you tried to do that when you hit the skin to set it for you?
Florin48 is offline   Reply With Quote
Old 12/07/2018, 12:36 PM   #3
Vennox
Little Clucker
 
Vennox's Avatar
 
Join Date: Apr 2018
Location: Romania
Posts: 30
Reputation: 7
Default Re: PreviewModel don't update ?

Try to re-show the textdraw to the player.
PHP Code:
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);
        }
    }

Vennox is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
PreviewModel IchNar Scripting Help 3 27/08/2017 08:05 AM
PreviewModel Hunud Scripting Help 2 19/06/2017 06:00 PM
[Ajuda] PreviewModel !! Felipe1241421 PortuguÍs/Portuguese 3 16/01/2017 09:40 PM
ID this previewmodel JoDe Scripting Help 0 29/06/2015 01:53 PM
[Pedido] PreviewModel arma D3sconn3ct PortuguÍs/Portuguese 2 28/02/2015 07:33 PM


All times are GMT. The time now is 03:20 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.