SA-MP Forums Archive
Textdraw crashing the player - 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: Textdraw crashing the player (/showthread.php?tid=435860)



Textdraw crashing the player - L.Hudson - 08.05.2013

Timer:

pawn Код:
forward TutTimer(playerid);
public TutTimer(playerid)
{
    new string[800];
    Player[playerid][pTut] = 1;
    SetPlayerCameraLookAt(playerid, 1553.1650,-1675.6091,16.1953);
    SetPlayerCameraPos(playerid, 1530.1918,-1665.5634,21.3828);
    SetPlayerPos(playerid, 1553.1650,-1675.6091, 16.1953 - 2);
    TextDrawShowForPlayer(playerid, Textdraw0[playerid]);
    TextDrawShowForPlayer(playerid, Textdraw1[playerid]);
    TextDrawSetString(Textdraw1[playerid], "~w~Welcome to ~y~Everous Roleplay~w~. We hope we can cover what you need in this tutorial.~n~There are various jobs such as Trucker, Weapon Dealer etc. A full list of jobs can be found by typing ~g~/jobhelp~w~.~n~As a newbie it's recommended to work as a Trucker or a Street Sweeper, since it provides a fairly enough amount of cash.~n~The cash you earn goes to your bank.");
    SetTimerEx("TutTimer2", 20000, false, "i", playerid);
    return 1;
}
Every time the textdraw attempts to show up the player crashes. Any reply is appriciated.


Re: Textdraw crashing the player - IceCube! - 08.05.2013

TutTimer 1 or 2? Which doesnt show?


Re: Textdraw crashing the player - L.Hudson - 08.05.2013

Ignore the line
pawn Код:
SetTimerEx("TutTimer2", 20000, false, "i", playerid);
The problem is above, every time the TD attempts to show up it crashes the player.


Re: Textdraw crashing the player - IceCube! - 08.05.2013

Okay, comment out 'TextDrawSetString' and run it again...

Or check your CreateTextdraw I have a feeling you have set it to "", which it must be " " or "_" at the least.


Re: Textdraw crashing the player - L.Hudson - 09.05.2013

It was set as a "New Textdraw" and changed it to ""


Respuesta: Textdraw crashing the player - Loox - 09.05.2013

Maybe this line is too long..

pawn Код:
TextDrawSetString(Textdraw1[playerid], "~w~Welcome to ~y~Everous Roleplay~w~. We hope we can cover what you need in this tutorial.~n~There are various jobs such as Trucker, Weapon Dealer etc. A full list of jobs can be found by typing ~g~/jobhelp~w~.~n~As a newbie it's recommended to work as a Trucker or a Street Sweeper, since it provides a fairly enough amount of cash.~n~The cash you earn goes to your bank.");
Use strcat then.


Re: Textdraw crashing the player - Basssiiie - 09.05.2013

You can't have any ~ codes after the 255th character of the textdraw, as this will crash your client. It's even stated on the wiki! (here)

Quote:

If you use color codes (such as ~R~ ~G~) beyond 255th character the client will crash trying to display the textdraw.




Re: Textdraw crashing the player - L.Hudson - 09.05.2013

Thank you for your replies!