Textdraw problem v2
#1

Код:
TextDrawShowForPlayer(playerid, Textdraw0);
		new newtext[41], name[MAX_PLAYER_NAME];
    	GetPlayerName(playerid, name, sizeof(name));
    	format(newtext, sizeof(newtext), "%s", name);
    	TextDrawSetString(Textdraw0, newtext);
This is the code when i am alone on server shows me my name but when someone else connect it shows me his name what can be the problem?
Reply
#2

At what callback are you using this? Give me little more code please.
Reply
#3

You are shoving textdraw first, and only than updating its info. Just move TextDrawShowForPlayer to the end of the code.
Reply
#4

Код:
Textdraw0 = TextDrawCreate(62.400012, 424.479980, "Alex");
	TextDrawLetterSize(Textdraw0, 0.487600, 2.040533);
	TextDrawTextSize(Textdraw0, 45.600002, -148.959991);
	TextDrawAlignment(Textdraw0, 1);
	TextDrawSetShadow(Textdraw0, 0);
	TextDrawSetOutline(Textdraw0, 1);
	TextDrawBackgroundColor(Textdraw0, 51);
	TextDrawFont(Textdraw0, 0);
	TextDrawSetProportional(Textdraw0, 1);
Ain't working to move it in front look a picture

Reply
#5

Up
Reply
#6

Where is this code located? Which callback?
Reply
#7

OnPlayerConnect ,
Код:
new newtext[41], name[MAX_PLAYER_NAME];
    	GetPlayerName(playerid, name, sizeof(name));
    	format(newtext, sizeof(newtext), "%s", name);
    	TextDrawSetString(Textdraw0, newtext);
    	TextDrawShowForPlayer(playerid, Textdraw0);
Reply
#8

That's your issue.
Every time a player connects it'll overwrite all the textdraws with the connected players username.

Try making per-player textdraws and setting it under spawn (or connect).

Something like
PHP код:
new PlayerText:NameTD[MAX_PLAYERS];
NameTD[playerid] = CreatePlayerTextDraw(playerid62.400012424.479980" ");
PlayerTextDrawLetterSize(playeridNameTD[playerid], 0.4876002.040533);
PlayerTextDrawTextSize(playeridNameTD[playerid], 45.600002, -148.959991);
PlayerTextDrawAlignment(playeridNameTD[playerid], 1);
PlayerTextDrawSetShadow(playeridNameTD[playerid], 0);
PlayerTextDrawSetOutline(playeridNameTD[playerid], 1);
PlayerTextDrawBackgroundColor(playeridNameTD[playerid], 51);
PlayerTextDrawFont(playeridNameTD[playerid], 0);
PlayerTextDrawSetProportional(playeridNameTD[playerid], 1);
// formatting and setting the string.
new newtext[41], name[MAX_PLAYER_NAME];
GetPlayerName(playeridnamesizeof(name));
format(newtextsizeof(newtext), "%s"name);
PlayerTextDrawSetString(playeridNameTD[playerid], newtext);
PlayerTextDrawShow(playeridNameTD[playerid]); 
Reply
#9

Код:
E:\NewSV\pawno\include\SpikeStrip.inc(27) : warning 219: local variable "lights" shadows a variable at a preceding level
E:\NewSV\gamemodes\gf.pwn(4919) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4923) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4925) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4928) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4930) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4933) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4935) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4938) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4940) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4943) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4945) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4948) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4950) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4953) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4955) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4958) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4960) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4963) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4965) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4968) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4970) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4973) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(4975) : warning 213: tag mismatch
E:\NewSV\gamemodes\gf.pwn(14204) : error 017: undefined symbol "playerid"
E:\NewSV\gamemodes\gf.pwn(14205) : error 017: undefined symbol "playerid"
E:\NewSV\gamemodes\gf.pwn(14206) : error 017: undefined symbol "playerid"
E:\NewSV\gamemodes\gf.pwn(14207) : error 017: undefined symbol "playerid"
E:\NewSV\gamemodes\gf.pwn(14208) : error 017: undefined symbol "playerid"
E:\NewSV\gamemodes\gf.pwn(14209) : error 017: undefined symbol "playerid"
E:\NewSV\gamemodes\gf.pwn(14210) : error 017: undefined symbol "playerid"
E:\NewSV\gamemodes\gf.pwn(14211) : error 017: undefined symbol "playerid"
E:\NewSV\gamemodes\gf.pwn(14212) : error 017: undefined symbol "playerid"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
... the errors are on your NameTD[playerid] CreatePlayerTextDraw
Reply
#10

Up can someone help
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)