TextDrawSetString
#1

I haven't posted here in ages, but here's the problem:

I can't get the text draw string or skin to change!

Code:
pawn Код:
if( PRESSED( KEY_LEFT ) )
    {
        new stringSkinPicker[20];
        if(userRegStep[playerid] == REG_STEP_SKIN || inSkinSelection[playerid] == 1)
        {
            userSkinPickerSkin[playerid]++;
            if(userSkinPickerSkin[playerid] == 299)
            {
                userSkinPickerSkin[playerid] = 0;
            }
            SetPlayerSkin(playerid, userSkinPickerSkin[playerid]);
            format(stringSkinPicker, 20, "~<~ %d ~>~", GetPlayerSkin(playerid));
            TextDrawSetString(SkinPicker3[playerid], stringSkinPicker);
        }
    }

    if( PRESSED( KEY_RIGHT ) )
    {
        new stringSkinPicker[20];
        if(userRegStep[playerid] == REG_STEP_SKIN || inSkinSelection[playerid] == 1)
        {
            userSkinPickerSkin[playerid]--;
            if(userSkinPickerSkin[playerid] == 0)
            {
                userSkinPickerSkin[playerid] = 299;
            }
            SetPlayerSkin(playerid, userSkinPickerSkin[playerid]);
            format(stringSkinPicker, 20, "~<~ %d ~>~", GetPlayerSkin(playerid));
            TextDrawSetString(SkinPicker3[playerid], stringSkinPicker);
        }
    }
Thanks a lot, guys.
Reply
#2

Debug it.
Reply
#3

Quote:
Originally Posted by MP2
Посмотреть сообщение
Debug it.
I was thinking of doing that, but I thought I'd rather post this first.

Thanks for the reply, MP2.
Reply
#4

That doesn't really make sense. If you put a print() on the line before the function you can see if the previous condition was met or not.
Reply
#5

Quote:
Originally Posted by MP2
Посмотреть сообщение
That doesn't really make sense. If you put a print() on the line before the function you can see if the previous condition was met or not.
What doesn't make sense?

EDIT: OnPlayerKeyStateChange isn't even calling (cause that's the callback it's in)

I use TogglePlayerControllable(playerid, false); before I use OnPlayerKeyStateChange. Could that be the cause of this?
Reply
#6

AFAIK, OnPlayerKeyStateChange is NOT called when the movement keys change
Reply
#7

Try adding Text:
Before the name of your textdraw in TextdrawSetString

Edit: it seems like this wasn't the problem. I didn't see the previous two replies yet.
Reply
#8

Quote:
Originally Posted by OPremium
Посмотреть сообщение
AFAIK, OnPlayerKeyStateChange is NOT called when the movement keys change
Oh, thanks for that. I might just have to run a getplayerkeys loop.

EDIT:

@Fallout
That has nothing to do with my problem.
Reply
#9

It's called on my server when my players are frozen.
Reply
#10

Quote:
Originally Posted by Schurman
Посмотреть сообщение
That has nothing to do with my problem.
The title of this topic was a little misleading in that case.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)