Where did I do wrong?
#1

Hello guys, well my textdraws seems not to work at all.

Код:
new Text:JoinArena;
new ArenaStarted;


//GameModeInit
JoinArena = TextDrawCreate(503.000000, 389.000000, "Join Arena");
	TextDrawBackgroundColor(JoinArena, 255);
	TextDrawFont(JoinArena, 1);
	TextDrawLetterSize(JoinArena, 0.519999, 1.600000);
	TextDrawColor(JoinArena, -1);
	TextDrawSetOutline(JoinArena, 0);
	TextDrawSetProportional(JoinArena, 1);
	TextDrawSetShadow(JoinArena, 1);
    TextDrawTextSize(JoinArena, 15.0, 75.0);

public OnPlayerClickTextDraw(playerid, Text:clickedid)
{
    if(_:clickedid != INVALID_TEXT_DRAW) 
    {
        if(clickedid == JoinArena)
        {
	        if(ArenaStarted == 1)
	        {
	         	SendClientMessage(playerid, COLOR_RED, "Arena already started. Putting you in queue!");
					TextDrawHideForPlayer(playerid, JoinArena);
	         	return 1;
			}
			else
			{
			    SendClientMessage(playerid, COLOR_YELLOW, "<!>Bla!");
    			CancelSelectTextDraw(playerid);
			}
		}
		return 1;
    }

    return 1;
}

public OnPlayerConnect(playerid)
{

    TextDrawSetSelectable(JoinArena, true);
    SelectTextDraw(playerid, 0x00FF00FF);
	PlayerTextDrawSetSelectable(playerid, PlayerText:JoinArena, 1);
    
    TextDrawShowForPlayer(playerid, JoinArena);
	 return 1;
}

forward ArenaStarts();
public ArenaStarts() //Starts the ArenaStarts timer, which is the queue timer. If the player is in queue he will get Tp-ed into the arena
{
	foreach (new i : Player)
	{
        ArenaStarted = 0;
        SendClientMessageToAll(COLOR_YELLOW, "ARENA IS FINISHED! Enter the queue in order to join arena!");
        SetTimer("ArenaJoin", 30000, false);
        SetTimerEx("count1", 1000, false, "i", i);
        //SetArenaPos - being worked.
	}
	return 1;
}

forward ArenaStart();
public ArenaStart() //Starts the actual arena, also sets the arenastarted to 1 so players cannot join it. They can only join the queue
{
    foreach (new i : Player)
	{
	    ArenaStarted = 1;
	    SetTimer("ArenaStarts", 90000, false);
	}
	return 1;
}
You see the textdraw, you are set into the Textdraw selection but you cannot click it. Once you click it nothing happens.
Reply
#2

TextDrawTextSize.
I didn't knew about this function too, but realcop told me :
Quote:
Originally Posted by RealCop228
Посмотреть сообщение
Take this as an example:
pawn Код:
PlayerTextDrawTextSize(playerid,Textdraw0, 130.000000, 0.000000);
If I just had that code, you wouldn't be able to select the TD. For some reason, most editors don't seem to account for this automatically, so we as programmers have to go in and do it ourselves. If you're not lazy, it's no big deal! However, I used TD's like crazy in my mode, so it is a pain in the ass...

Anyways!

pawn Код:
PlayerTextDrawTextSize(playerid,Textdraw0, 130.000000, 10.000000);
I changed the 0.00000000 to 10.00000000- the TD should become "selectable" now.
Reply
#3

Ahhhh, I got it now

I also added
TextDrawTextSize(JoinArena, 505.000000, 391.000000)
and it works perfectly. Thanks for the tips. +Rep
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)