TextDrawShow - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: TextDrawShow (
/showthread.php?tid=259126)
TextDrawShow -
Admigo - 03.06.2011
Heey all,
I made a test command for a playerfoodshop with you can set a own price of every slot. But how can i show the textdraw with the textdrawstring because if i do the command my samp crash.
Here is code:
Код:
TextDrawShowForPlayer(ID,TextDraw4);
TextDrawShowForPlayer(ID,TextDraw7);
//TextDrawShowForPlayer(ID,TextDraw5);
format(str1,sizeof(str1),"~n~~n~~n~~n~ ~n~~b~500 ammo $%d~n~~b~500 ammo $%d~n~~b~500 ammo $%d~n~~b~500 ammo $%d~n~~y~~b~500 ammo $%d",WeaponPrices[ID][1],WeaponPrices[ID][2],WeaponPrices[ID][3],WeaponPrices[ID][4],WeaponPrices[ID][5]);
format(str2,sizeof(str2)," ~b~500 ammo $%d~n~~b~500 ammo $%d~n~~b~500 ammo $%d~n~~b~500 ammo $%d~n~~y~~b~500 ammo $%d~n~~y~~b~500 ammo $%d~n~~y~~b~500 ammo $%d~n~",WeaponPrices[ID][6],WeaponPrices[ID][7],WeaponPrices[ID][8],WeaponPrices[ID][9],WeaponPrices[ID][10],WeaponPrices[ID][11],WeaponPrices[ID][12]);
format(Total,sizeof(Total),"%s %s",str1,str2);
TextDrawSetString(TextDraw5,Total);
TextDrawShowForPlayer(ID,TextDraw5);
format(str3,sizeof(str3),"~g~%s's Weaponshop",PlayerName(ID));
TextDrawSetString(TextDraw6,str3);
TextDrawShowForPlayer(ID,TextDraw6);
armshop[ID]=1;
SetPVarInt(ID, "arm1", playerid);if(IsPlayerConnected(playerid)==1)
Pls help.
Thanks Admigo
Re: TextDrawShow -
Vince - 03.06.2011
https://sampwiki.blast.hk/wiki/TextDrawCreate
Read the first important note.
Re: TextDrawShow -
Admigo - 03.06.2011
I dont understand whats wrong.
Re: TextDrawShow -
Wesley221 - 03.06.2011
Код:
Important Note: If you use color codes (such as ~R~ ~G~) beyond 255th character the client will crash trying to display the textdraw.
Its probably because your textdraw is over 255 char's
Re: TextDrawShow -
Admigo - 03.06.2011
I have this:
Код:
format(str1,sizeof(str1),"~n~~n~~n~~n~ ~n~~b~500 ammo $%d~n~~b~500 ammo $%d~n~~b~500 ammo $%d~n~~b~500 ammo $%d~n~~y~~b~500 ammo $%d",WeaponPrices[ID][1],WeaponPrices[ID][2],WeaponPrices[ID][3],WeaponPrices[ID][4],WeaponPrices[ID][5]);
format(str2,sizeof(str2)," ~b~500 ammo $%d~n~~b~500 ammo $%d~n~~b~500 ammo $%d~n~~b~500 ammo $%d~n~~y~~b~500 ammo $%d~n~~y~~b~500 ammo $%d~n~~y~~b~500 ammo $%d~n~",WeaponPrices[ID][6],WeaponPrices[ID][7],WeaponPrices[ID][8],WeaponPrices[ID][9],WeaponPrices[ID][10],WeaponPrices[ID][11],WeaponPrices[ID][12]);
format(Total,sizeof(Total),"%s %s",str1,str2);
I made onplayerspawn this:
Код:
WeaponPrices[playerid][slot] = price2;
WeaponPrices[playerid][1]=5000;
WeaponPrices[playerid][2]=10000;
WeaponPrices[playerid][3]=10000;
WeaponPrices[playerid][4]=13000;
WeaponPrices[playerid][5]=8000;
WeaponPrices[playerid][6]=12000;
WeaponPrices[playerid][7]=15000;
WeaponPrices[playerid][8]=15000;
WeaponPrices[playerid][9]=14000;
WeaponPrices[playerid][10]=14000;
WeaponPrices[playerid][11]=15000;
WeaponPrices[playerid][12]=1000;*/