Model Preview
#1

So i have a problem, basically, it's selectable td, and now it should be working like if you press on NEXT td it will change your skin (forward), and back it will return, but it's not working:

pawn Код:
if(clickedid == RegTD[15][playerid])
    {
        ChoosingSkin[playerid]++;
        if(PInfo[playerid][Spol] == 1)
        {
            if(ChoosingSkin[playerid] == 1) TextDrawSetPreviewModel(RegTD[16][playerid], 1);
            else if(ChoosingSkin[playerid] == 2) TextDrawSetPreviewModel(RegTD[16][playerid], 2);
            else if(ChoosingSkin[playerid] == 3) TextDrawSetPreviewModel(RegTD[16][playerid], 4);
            else if(ChoosingSkin[playerid] == 4) TextDrawSetPreviewModel(RegTD[16][playerid], 26);
            else if(ChoosingSkin[playerid] == 5) TextDrawSetPreviewModel(RegTD[16][playerid], 27);
        }
        else if(PInfo[playerid][Spol] == 2)
        {
            if(ChoosingSkin[playerid] == 1) TextDrawSetPreviewModel(RegTD[16][playerid], 11);
            else if(ChoosingSkin[playerid] == 2) TextDrawSetPreviewModel(RegTD[16][playerid], 13);
            else if(ChoosingSkin[playerid] == 3) TextDrawSetPreviewModel(RegTD[16][playerid], 41);
            else if(ChoosingSkin[playerid] == 4) TextDrawSetPreviewModel(RegTD[16][playerid], 55);
            else if(ChoosingSkin[playerid] == 5) TextDrawSetPreviewModel(RegTD[16][playerid], 69);
        }
    }

    if(clickedid == RegTD[14][playerid])
    {
        ChoosingSkin[playerid]--;

        if(PInfo[playerid][Spol] == 1)
        {
            if(ChoosingSkin[playerid] == 5) TextDrawSetPreviewModel(RegTD[16][playerid], 27);
            else if(ChoosingSkin[playerid] == 4) TextDrawSetPreviewModel(RegTD[16][playerid], 26);
            else if(ChoosingSkin[playerid] == 3) TextDrawSetPreviewModel(RegTD[16][playerid], 4);
            else if(ChoosingSkin[playerid] == 2) TextDrawSetPreviewModel(RegTD[16][playerid], 2);
            else if(ChoosingSkin[playerid] == 1) TextDrawSetPreviewModel(RegTD[16][playerid], 1);
            else if(ChoosingSkin[playerid] == 0) { ChoosingSkin[playerid] = 5; TextDrawSetPreviewModel(RegTD[16][playerid], 27); }
        }
        else if(PInfo[playerid][Spol] == 2)
        {
            if(ChoosingSkin[playerid] == 5) TextDrawSetPreviewModel(RegTD[16][playerid], 69);
            else if(ChoosingSkin[playerid] == 4) TextDrawSetPreviewModel(RegTD[16][playerid], 55);
            else if(ChoosingSkin[playerid] == 3) TextDrawSetPreviewModel(RegTD[16][playerid], 41);
            else if(ChoosingSkin[playerid] == 2) TextDrawSetPreviewModel(RegTD[16][playerid], 13);
            else if(ChoosingSkin[playerid] == 1) TextDrawSetPreviewModel(RegTD[16][playerid], 11);
            else if(ChoosingSkin[playerid] == 0) { ChoosingSkin[playerid] = 5; TextDrawSetPreviewModel(RegTD[16][playerid], 69); }
        }
    }
Reply
#2

anyone ?
Reply
#3

You were supposed to use the SetPlayerSkin(playerid,skinid) function.
Add a variable for the skins ID depending on your preview model, and use it into the function above.
Reply
#4

I don't want to set skin, but models, thats why im using TextDrawSetPreviewModel(RegTD[16][playerid], ID);

but that is not working
Reply
#5

Quote:
Originally Posted by ShoortyFl
Посмотреть сообщение
So i have a problem, basically, it's selectable td, and now it should be working like if you press on NEXT td it will change your skin (forward)
Sorry, I understood that the selectable textdraw do not change the player skin.

I'm quite a beginner in Pawn, but I would recommend you to replace:
PHP код:
else if(ChoosingSkin[playerid] == 2TextDrawSetPreviewModel(RegTD[16][playerid], 2); 
with
PHP код:
else if(ChoosingSkin[playerid] == 2TextDrawSetPreviewModel(RegTD[16], 2); 
Reply
#6

That would not work, because it's player textdraw, and text variable is not defined like that.
Reply
#7

Anyone ?
Reply
#8

try this,add TextDrawShowForPlayer under TextDrawSetPreviewModel

Код:
if(ChoosingSkin[playerid] == 1) 
{
TextDrawSetPreviewModel(RegTD[16][playerid], 1);
TextDrawShowForPlayer(playerid, RegTD[16][playerid]);
}
Reply
#9

Try adding prints after your "if(clickedid == td_id)" checks, see if it even gets called, if it doesn't then you have a clickable area problem. Otherwise, we can't possibly know where the problem is as the code seems fine.
However, one thing that comes to mind is, did you use "TextDrawShowForPlayer" ?

Edit: yeah, TonyVk was a little faster than me on that.
Reply
#10

This is buggin me, can't set text size for it

pawn Код:
RegTD[14][playerid] = TextDrawCreate(244.500000, 292.812500, "<<");
    TextDrawLetterSize(RegTD[14][playerid], 0.400000, 1.600000);
    TextDrawAlignment(RegTD[14][playerid], 1);
    TextDrawColor(RegTD[14][playerid], -1);
    TextDrawSetShadow(RegTD[14][playerid], 0);
    TextDrawSetOutline(RegTD[14][playerid], 0);
    TextDrawBackgroundColor(RegTD[14][playerid], 255);
    TextDrawFont(RegTD[14][playerid], 3);
    TextDrawSetProportional(RegTD[14][playerid], 1);
    TextDrawSetShadow(RegTD[14][playerid], 0);
    TextDrawSetSelectable(RegTD[14][playerid], true);
    TextDrawTextSize(RegTD[14][playerid], 2.500000, 20.000000);

    RegTD[15][playerid] = TextDrawCreate(360.907104, 292.812500, ">>");
    TextDrawLetterSize(RegTD[15][playerid], 0.400000, 1.600000);
    TextDrawAlignment(RegTD[15][playerid], 1);
    TextDrawColor(RegTD[15][playerid], -1);
    TextDrawSetShadow(RegTD[15][playerid], 0);
    TextDrawSetOutline(RegTD[15][playerid], 0);
    TextDrawBackgroundColor(RegTD[15][playerid], 255);
    TextDrawFont(RegTD[15][playerid], 3);
    TextDrawSetProportional(RegTD[15][playerid], 1);
    TextDrawSetShadow(RegTD[15][playerid], 0);
    TextDrawSetSelectable(RegTD[15][playerid], true);
    TextDrawTextSize(RegTD[15][playerid], 2.907104, 20.000000);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)