Textdraw crashing the game. -
admantis - 24.05.2011
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!
Re: Textdraw crashing the game. -
Donya - 24.05.2011
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?
Respuesta: Re: Textdraw crashing the game. -
admantis - 24.05.2011
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.
Re: Textdraw crashing the game. -
Donya - 24.05.2011
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:
Re: Textdraw crashing the game. - [L3th4l] - 24.05.2011
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");
Respuesta: Re: Textdraw crashing the game. -
admantis - 24.05.2011
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.
Re: Textdraw crashing the game. -
Donya - 24.05.2011
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