Textdraw string help
#1

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);
	}
Reply
#2

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.
Reply
#3

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

?
Reply
#5

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);
Reply
#6

it dosent show up nothings there ; /
Reply
#7

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)
{
Reply
#8

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

bump
Reply
#10

Use TextDrawShowForAll(Text:Textdraw10);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)