Textdraw
#1

Код:
		NimiTextdraw[i] = TextDrawCreate(26.000000, 318.000000, "----------");
		TextDrawBackgroundColor(NimiTextdraw[i], 255);
		TextDrawFont(NimiTextdraw[i], 1);
		TextDrawLetterSize(NimiTextdraw[i], 0.500000, 2.100000);
		TextDrawColor(NimiTextdraw[i], -1);
		TextDrawSetOutline(NimiTextdraw[i], 1);
		TextDrawSetProportional(NimiTextdraw[i], 1);
		//----------------------------------------------------------------------
		new name[128];
		new string[128];
		GetPlayerName(i, name, sizeof(name));
		if (name[i] == '_')
    	        name[i] = ' ';
		format(string, sizeof(string), "%s", name);
		TextDrawSetString(NimiTextdraw[i], string);
But ingame show's it empty. Must be show that textdraw. (Another textdraw work's)

That is only textdraw, what it doens't show ingame.

Anyknow what problem is?
Reply
#2

is it ina filterscript? also do you have

pawn Код:
TextDrawShowForPlayer(playerid,NimiTextdraw[playerid]);

//OR

TextDrawShowForPlayer(i,NimiTextdraw[i]);
somewhere?
Reply
#3

Quote:
Originally Posted by Kar
Посмотреть сообщение
is it ina filterscript? also do you have

pawn Код:
TextDrawShowForPlayer(playerid,NimiTextdraw[playerid]);

//OR

TextDrawShowForPlayer(i,NimiTextdraw[i]);
somewhere?
Yes i have. Gamemode, not filterscript.
Reply
#4

Anyone no know what problem is?

Код:
TextDrawShowForPlayer(playerid, FraksTextdraw[playerid]);
TextDrawShowForPlayer(playerid, NimiTextdraw[playerid]);
It's in OnPlayerSpawn.

Textdraw(); is at OnGameModeInit.

Код:
public Textdraw()
{
    for (new i = 0; i < MAX_PLAYER_NAME; i++)
    {
        //----------------------------------------------------------------------
	    FraksTextdraw[i] = TextDrawCreate(53.000000, 298.000000, "Tsivliik");
		TextDrawBackgroundColor(FraksTextdraw[i], 255);
		TextDrawFont(FraksTextdraw[i], 1);
		TextDrawLetterSize(FraksTextdraw[i], 0.509999, 2.000000);
		TextDrawColor(FraksTextdraw[i], -1);
		TextDrawSetOutline(FraksTextdraw[i], 1);
		TextDrawSetProportional(FraksTextdraw[i], 1);
		//----------------------------------------------------------------------
		NimiTextdraw[i] = TextDrawCreate(26.000000, 318.000000, "----------");
		TextDrawBackgroundColor(NimiTextdraw[i], 255);
		TextDrawFont(NimiTextdraw[i], 1);
		TextDrawLetterSize(NimiTextdraw[i], 0.500000, 2.100000);
		TextDrawColor(NimiTextdraw[i], -1);
		TextDrawSetOutline(NimiTextdraw[i], 1);
		TextDrawSetProportional(NimiTextdraw[i], 1);
		//----------------------------------------------------------------------
		new name[128];
		new string[128];
		GetPlayerName(i, name, sizeof(name));
		if (name[i] == '_')
    	name[i] = ' ';
		format(string, sizeof(string), "%s", name);
		TextDrawSetString(NimiTextdraw[i], string);
		//----------------------------------------------------------------------
	}
	return 1;
}
Reply
#5

its

Код:
TextDrawShowForPlayer(playerid, FraksTextdraw);
TextDrawShowForPlayer(playerid, NimiTextdraw);
not

Код:
TextDrawShowForPlayer(playerid, FraksTextdraw[playerid]);
TextDrawShowForPlayer(playerid, NimiTextdraw[playerid]);
Reply
#6

Quote:
Originally Posted by billiout
Посмотреть сообщение
its

Код:
TextDrawShowForPlayer(playerid, FraksTextdraw);
TextDrawShowForPlayer(playerid, NimiTextdraw);
not

Код:
TextDrawShowForPlayer(playerid, FraksTextdraw[playerid]);
TextDrawShowForPlayer(playerid, NimiTextdraw[playerid]);
Really?

new Text:FraksTextdraw[MAX_PLAYERS];

Is just needed:

TextDrawShowForPlayer(playerid, FraksTextdraw[playerid]);

When i do, then error:

Код:
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(444) : error 035: argument type mismatch (argument 2)
C:\Program Files\SAMP Server\gamemodes\estprojekt.pwn(445) : error 035: argument type mismatch (argument 2)
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#7

Because it's
pawn Код:
new Text:FraksTextdraw;
Reply
#8

Quote:
Originally Posted by ikarus
Посмотреть сообщение
Because it's
pawn Код:
new Text:FraksTextdraw;
No, it's needed for textdraw per player.

But that name. Or you it's correct?
Reply
#9

Then try as Kar said,
pawn Код:
TextDrawShowForPlayer(playerid, FraksTextdraw[i]);
TextDrawShowForPlayer(playerid, NimiTextdraw[i]);
Reply
#10

Quote:
Originally Posted by ikarus
Посмотреть сообщение
Then try as Kar said,
pawn Код:
TextDrawShowForPlayer(playerid, FraksTextdraw[i]);
TextDrawShowForPlayer(playerid, NimiTextdraw[i]);
Oh ....

public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid, FraksTextdraw[i]);
TextDrawShowForPlayer(playerid, NimiTextdraw[i]);
}

Its incorrect.

public OnPlayerSpawn(playerid)
{
TextDrawShowForPlayer(playerid, FraksTextdraw[playerid]);
TextDrawShowForPlayer(playerid, NimiTextdraw[playerid]);
}


That is correct.

And that FraksTextdraw work's succesfully, but NimiTextdraw not work's. (It's doens't show)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)