SA-MP Forums Archive
Textdraw string help - 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: Textdraw string help (/showthread.php?tid=92408)



Textdraw string help - [mad]MLK - 19.08.2009

Hey im trying to make it so when a player types a cmd of a stunt location e.g /stunt it says at the top of the screen "playername has gone to /stuntareahere" but i get errors with this:
Код:
	{
	new pname[24], string[128];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(string, sizeof(string), "%s has gone to", cmdtext, pname);
	Textdraw0 = TextDrawCreate(202.000000,4.000000, string);
	TextDrawAlignment(Textdraw10,0);
	TextDrawBackgroundColor(Textdraw10,0x000000ff);
	TextDrawFont(Textdraw10,3);
	TextDrawLetterSize(Textdraw10,0.399999,1.300000);
	TextDrawColor(Textdraw10,0xff0000ff);
	TextDrawSetOutline(Textdraw10,1);
	TextDrawSetProportional(Textdraw10,1);
	TextDrawSetShadow(Textdraw10,1);
	}



Re: Textdraw string help - [mad]MLK - 19.08.2009

these are the errors too:
Код:
C:\Documents and Settings\Christopher\Desktop\SA-MP Server\SA-MP Server Unreal Stuntages\Stunt City\gamemodes\UnrealStunages.pwn(1628) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Warning.



Re: Textdraw string help - pliva_sb - 19.08.2009

Код:
format(string, sizeof(string), "%s has gone to %s", cmdtext, pname);
@ Error
Код:
new string[128]
should not


Re: Textdraw string help - [mad]MLK - 19.08.2009

?


Re: Textdraw string help - pliva_sb - 19.08.2009

Quote:
Originally Posted by [mad
MLK (sampx-hosting.co.cc) ]
?
Код:
new pname[24];
  GetPlayerName(playerid, pname, sizeof(pname));
  format(string, sizeof(string), "%s has gone to %s", cmdtext, pname);
	Textdraw0 = TextDrawCreate(202.000000,4.000000, string);
	TextDrawAlignment(Textdraw10,0);
	TextDrawBackgroundColor(Textdraw10,0x000000ff);
	TextDrawFont(Textdraw10,3);
	TextDrawLetterSize(Textdraw10,0.399999,1.300000);
	TextDrawColor(Textdraw10,0xff0000ff);
	TextDrawSetOutline(Textdraw10,1);
	TextDrawSetProportional(Textdraw10,1);
	TextDrawSetShadow(Textdraw10,1);



Re: Textdraw string help - [mad]MLK - 19.08.2009

it dosent show up nothings there ; /


Re: Textdraw string help - pliva_sb - 19.08.2009

Quote:
Originally Posted by [mad
MLK (sampx-hosting.co.cc) ]
it dosent show up nothings there ; /
Maybe you condition is not fulfilled
like
Код:
if(PlayerInfo[playerid][pLevel]>3)
{



Re: Textdraw string help - [mad]MLK - 19.08.2009

wtf? that would mean it would only work if they were admin


Re: Textdraw string help - [mad]MLK - 20.08.2009

bump


Re: Textdraw string help - RyDeR` - 20.08.2009

Use TextDrawShowForAll(Text:Textdraw10);