Textdraw crashing the game.
#1

I have this textdraw (under a loop), when it's executed then the game crashes.

pawn Код:
// STATUS
            if (GetPVarInt(i, "Work") > 0)
            {
                format(szString, 40, "Status:~w~ Work");
                TextDrawSetString(TD_7[i], szString);
            }
            if (GetPVarInt(i, "Flight") == 1)
            {
                format(szString, 40, "~Status:~w~ On Route");
                TextDrawSetString(TD_7[i], szString);
            }
           
            if (GetPVarInt(i, "Flight") == 0)
            {
                if (GetPVarInt(i, "Work") == 0)
                {
                    if (IsAirVehicle(GetPlayerVehicleID(i)))
                    {
                        format(szString, 40, "Status:~w~ Flying");
                        TextDrawSetString(TD_7[i], szString);
                    }
                    else
                    {
                        format(szString, 40, "Status:~w~ None");
                        TextDrawSetString(TD_7[i], szString);
                    }
                }
            }
This one is crashing as well.
pawn Код:
// DEST
            if (GetPVarInt(i, "Flight") > 0)
            {
                format(szString, 40, "DEST:~w~ %s", GetDestination(i));
            }
            else if (GetPVarInt(i, "Flight") == 0)
            {
                format(szString, 40, "DEST:~w~ %s", "None");
            }

            if (GetPVarInt(i, "Work") > 0)
            {
                format(szString, 40, "DEST:~w~ %s", GetDestination(i));
            }
            else if (GetPVarInt(i, "Work") == 0)
            {
                format(szString, 40, "DEST:~w~ %s", "None");
            }
            TextDrawSetString(TD_2[i], szString);
Thanks to whoever helped me!
Reply
#2

pawn Код:
format(szString, 40, "~Status:~w~ On Route");
look at that code again

for the second one.. well... don't know right now

Edit: can i see GetDestination?
Reply
#3

Quote:
Originally Posted by Donya
Посмотреть сообщение
pawn Код:
format(szString, 40, "~Status:~w~ On Route");
look at that code again

for the second one.. well... don't know right now

Edit: can i see GetDestination?
Oh my god how I couldn't notice that, I will try it now.
Reply
#4

its ok, i get it alot to.. to actually test my a script, i will need about 5 players.. if i go by myself.. i fine NO bugs.. if i go with 5 ppl.. i find 500 bugs S:
Reply
#5

Also, why are you even formatting the string into the textdraw? There's no need to!

pawn Код:
//format(szString, 40, "~Status:~w~ On Route");
TextDrawSetString(TD_7[i], "Status:~w~ On Route");
Reply
#6

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
Also, why are you even formatting the string into the textdraw? There's no need to!

pawn Код:
//format(szString, 40, "~Status:~w~ On Route");
TextDrawSetString(TD_7[i], "Status:~w~ On Route");
Yeah well that's what basically Donya told me, I fixed it now, thanks both for the help

p.s: Donya if you have problems with textdraw with multiple players you should try using per-player textdraws.
Reply
#7

i do, i also have a problem im gonna ask for help soon, my textdraws sometimes disappear.. i have a system to make textdraws then destroy when finished or clicked LMB.. sometimes the box may disappear... other times it wont just show...

Note: NOT Hijacking - he already found his problem... just saying something
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)