TextDraw Positioning help?
#1

I'm trying to make a TextDraw for connection and disconnection alerts.
However the textdraw cuts itself off and goes on the next line.
Does anyone have any suggestions? I don't get any errors or anything. I'll post the textdraw itself code and a picture.



The textdraw is the bottom right that isn't working properly.

PHP код:
    if (JoinText == Text:-1) {
        
JoinText TextDrawCreate(622.0389.0name);
        
TextDrawLetterSize(JoinText0.351.0);
        
TextDrawSetShadow(JoinText1);
        
TextDrawAlignment(JoinText3);
    } 
Another problem that I'm having is with my Speedo. On the OnPlayerSpawn callback I'm trying to display a speedo Textdraw however I get three warnings.

Код:
(673) : warning 213: tag mismatch
(674) : warning 213: tag mismatch
(675) : warning 213: tag mismatch
Here is my Textdraw code.

PHP код:
    TextDrawShowForPlayer(playerid,SpeedoText[playerid]);
     
SpeedoText[playerid] = TextDrawCreate(530.0340.5"");
    
PlayerTextDrawLetterSize(playeridSpeedoText[playerid], 0.51.6);
    
PlayerTextDrawSetProportional(playeridSpeedoText[playerid], 1);
    
PlayerTextDrawSetOutline(playeridSpeedoText[playerid], 1); 
Warnings are on 673, 674, 675
PHP код:
    PlayerTextDrawLetterSize(playeridSpeedoText[playerid], 0.51.6);
    
PlayerTextDrawSetProportional(playeridSpeedoText[playerid], 1);
    
PlayerTextDrawSetOutline(playeridSpeedoText[playerid], 1); 
Thanks for your time.

PS Sorry for the huge picture
Reply
#2

replace this
PHP код:
    TextDrawShowForPlayer(playerid,SpeedoText[playerid]);
     
SpeedoText[playerid] = TextDrawCreate(530.0340.5"");
    
PlayerTextDrawLetterSize(playeridSpeedoText[playerid], 0.51.6);
    
PlayerTextDrawSetProportional(playeridSpeedoText[playerid], 1);
    
PlayerTextDrawSetOutline(playeridSpeedoText[playerid], 1); 
To this
PHP код:
    TextDrawShowForPlayer(playerid,SpeedoText[playerid]);
    
Text:SpeedoText[playerid] = TextDrawCreate(530.0340.5"");
    
PlayerTextDrawLetterSize(playeridSpeedoText[playerid], 0.51.6);
    
PlayerTextDrawSetProportional(playeridSpeedoText[playerid], 1);
    
PlayerTextDrawSetOutline(playeridSpeedoText[playerid], 1); 
and for the postitioning help u have to show us OnPlayerConnect.
Reply
#3

Quote:
Originally Posted by FuNkYTheGreat
Посмотреть сообщение
replace this
PHP код:
    TextDrawShowForPlayer(playerid,SpeedoText[playerid]);
     
SpeedoText[playerid] = TextDrawCreate(530.0340.5"");
    
PlayerTextDrawLetterSize(playeridSpeedoText[playerid], 0.51.6);
    
PlayerTextDrawSetProportional(playeridSpeedoText[playerid], 1);
    
PlayerTextDrawSetOutline(playeridSpeedoText[playerid], 1); 
To this
PHP код:
    TextDrawShowForPlayer(playerid,SpeedoText[playerid]);
    
Text:SpeedoText[playerid] = TextDrawCreate(530.0340.5"");
    
PlayerTextDrawLetterSize(playeridSpeedoText[playerid], 0.51.6);
    
PlayerTextDrawSetProportional(playeridSpeedoText[playerid], 1);
    
PlayerTextDrawSetOutline(playeridSpeedoText[playerid], 1); 
and for the postitioning help u have to show us OnPlayerConnect.
Hi thanks for your time.

I added that however when I created the variable SpeedoText I made it like new Text:SpeedoText[MAX_PLAYERS]; so that then gave me errors.

For my connection messages I'm using a stock. However this is very experimental and I'm having problems with it. But here is the stock.

PHP код:
SendConnectionMessage(playeridreason)
{
    new 
name[336];
    
GetPlayerName(playeridnameMAX_PLAYER_NAME);
    for (new 
0sizeof(cLines)-1c++)
    {
        
cLines[c] = cLines[c+1];
    }
    if (
reason == 1format(cLines[sizeof(cLines)-1], 64"~w~%s~n~ has ~g~~h~<~w~Joined~g~~h~>"name);
    else if (
reason == 2format(cLines[sizeof(cLines)-1], 64"~w~%s~n~ has ~r~~h~<~w~Timed Out/Crashed~r~~h~>"name);
    else if (
reason == 3format(cLines[sizeof(cLines)-1], 64"~w~%s~n~ has ~r~~h~<~w~Left~r~~h~>"name);
    else 
format(cLines[sizeof(cLines)-1], 64,"~w~%s~n~ has been~r~~h~<~w~Banned/Kicked~r~~h~>"name);
    
format(namesizeof(name), "%s%s%s%s%s"cLines[0], cLines[1], cLines[2], cLines[3], cLines[4]);
    if (
JoinText == Text:-1) {
        
JoinText TextDrawCreate(622.0389.0name);
        
TextDrawLetterSize(JoinText0.351.0);
        
TextDrawSetShadow(JoinText1);
        
TextDrawAlignment(JoinText3);
    }
    else 
TextDrawSetString(JoinTextname);

Reply
#4

try this stock
PHP код:
SendConnectionMessage(playeridreason)
{
    new 
name[336];
    
GetPlayerName(playeridnameMAX_PLAYER_NAME);
    for (new 
0sizeof(cLines)-1c++)
    {
        
cLines[c] = cLines[c+1];
    }
    if (
reason == 1format(cLines[sizeof(cLines)-1], 64"~w~%s has ~g~~h~<~w~Joined~g~~h~>"name);
    else if (
reason == 2format(cLines[sizeof(cLines)-1], 64"~w~%s has ~r~~h~<~w~Timed Out/Crashed~r~~h~>"name);
    else if (
reason == 3format(cLines[sizeof(cLines)-1], 64"~w~%s has ~r~~h~<~w~Left~r~~h~>"name);
    else 
format(cLines[sizeof(cLines)-1], 64,"~w~%s has been~r~~h~<~w~Banned/Kicked~r~~h~>"name);
    
format(namesizeof(name), "%s%s%s%s%s"cLines[0], cLines[1], cLines[2], cLines[3], cLines[4]);
    if (
JoinText == Text:-1) {
        
JoinText TextDrawCreate(622.0389.0name);
        
TextDrawLetterSize(JoinText0.351.0);
        
TextDrawSetShadow(JoinText1);
        
TextDrawAlignment(JoinText3);
    }
    else 
TextDrawSetString(JoinTextname);

and tell me which errors it is giving ?
Reply
#5

Код:
(701) : warning 221: label name "Text" shadows tag name
(702) : warning 213: tag mismatch
(703) : warning 213: tag mismatch
(704) : warning 213: tag mismatch
(701) : warning 203: symbol is never used: "Text"
That works. The Connection, however it only displays Join. Nothing about Leaving, Timing out, or Kick/ban. Any ideas?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)