Opening TextDraw bug
#1

Hey guys, I have a small bug
When I enter the server, I am getting a textdraw:
"Welcome to MILITARY VS REBELS (MyName)"
Now I noticed a bug, if someone else enters the server while I am in the class selection, I am getting HIS name on the textdraw (it changes from myname to his name) for me

Codes:
PHP код:
public OnPlayerConnect(playerid)
{
    
ClearChar(playerid);
    
SetPlayerColor(playerid0x6F6F6FFF);
    new 
string[128];
    
format(stringsizeof(string), "~y~Welcome to~n~~b~MILLITARY ~w~VS ~r~REBELS~n~~w~%s"RPN(playerid));
    
TextDrawSetString(OP[4], string);
    
ToggleOpeningTD(playerid1);
    
PlayerInfo[playerid][pLoggedIn] = 0;
    new 
query[248];
    
mysql_format(mysqlquerysizeof(query), "SELECT `BannedBy`, `BanReason`, `BannedDate`, `Username`, `IP` FROM `BanList` WHERE `Banned`=1 AND (`IP`='%e' OR `Username`='%e')"RPIP(playerid), RPN(playerid));
    
mysql_tquery(mysqlquery"CheckBan""i"playerid);
    
mysql_format(mysqlquerysizeof(query), "SELECT * FROM `Users` WHERE `Username`='%e' LIMIT 1"RPN(playerid));
    
mysql_tquery(mysqlquery"LoadChar""i"playerid);
    return 
1;

ToggleOpeningTD
PHP код:
stock ToggleOpeningTD(playeridtoggle)
{
    if(
toggle)
    {
        for(new 
05i++) TextDrawShowForPlayer(playeridOP[i]);
        
TextDrawShowForPlayer(playeridVers);
    }
    else
    {
        for(new 
05i++) TextDrawHideForPlayer(playeridOP[i]);
        
TextDrawHideForPlayer(playeridVers);
    }

TextDraw creation
PHP код:
    OP[4] = TextDrawCreate(312.66668729.037025"Welcome to MILLITARY VS REBELS");
    
TextDrawLetterSize(OP[4], 0.4499991.600000);
    
TextDrawAlignment(OP[4], 2);
    
TextDrawColor(OP[4], 0xFFF000FF);
    
TextDrawSetShadow(OP[4], 0);
    
TextDrawSetOutline(OP[4], 0);
    
TextDrawBackgroundColor(OP[4], 51);
    
TextDrawFont(OP[4], 2);
    
TextDrawSetProportional(OP[4], 1); 
Reply
#2

Try using Per Player Textdraws instead.
Reply
#3

Quote:
Originally Posted by ISmokezU
Посмотреть сообщение
Try using Per Player Textdraws instead.
Is there a different way?
Reply
#4

Use PlayerTextDraw :3 :3
Reply
#5

Information

You will need to use Player Textdraws instead, the way your using textdraws is globally, which means there is one Textdraw shared amongst all the players on your server, and when you change the textdraws text, your changing it for the entire server.

This is where Player Textdraws come in, as they allow you to have one textdraw per player, and if you change the text of that textdraw it will only apply to the player of the textdraw you have changed.

You can see more here: CreatePlayerTextDraw
Reply
#6

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

You will need to use Player Textdraws instead, the way your using textdraws is globally, which means there is one Textdraw shared amongst all the players on your server, and when you change the textdraws text, your changing it for the entire server.

This is where Player Textdraws come in, as they allow you to have one textdraw per player, and if you change the text of that textdraw it will only apply to the player of the textdraw you have changed.

You can see more here: CreatePlayerTextDraw
Shouldn't I re-show it to the player to change the text of a global textdraw ?
Reply
#7

No. Create textdraw per player, no other way.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)