SA-MP Forums Archive
TextDrawSetString - 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: TextDrawSetString (/showthread.php?tid=315140)



TextDrawSetString - SchurmanCQC - 01.02.2012

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.


Re: TextDrawSetString - MP2 - 01.02.2012

Debug it.


Re: TextDrawSetString - SchurmanCQC - 01.02.2012

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.


Re: TextDrawSetString - MP2 - 01.02.2012

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.


Re: TextDrawSetString - SchurmanCQC - 01.02.2012

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?


Respuesta: TextDrawSetString - OPremium - 01.02.2012

AFAIK, OnPlayerKeyStateChange is NOT called when the movement keys change


Re: TextDrawSetString - ғαιιοцт - 01.02.2012

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.


Re: Respuesta: TextDrawSetString - SchurmanCQC - 01.02.2012

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.


Re: TextDrawSetString - MP2 - 01.02.2012

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


Re: Respuesta: TextDrawSetString - ғαιιοцт - 01.02.2012

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.