[Help] Textdraws
#1

Hey can someone help me, I want to know how I can make a textdraw first of all. After that I only want it to appear to players if they are in range of a certain point and press "Y" then also Y again to destroy it. thanks alot
Reply
#2

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if (newkeys == 65536)
    {
        if(IsPlayerInRangeOfPoint(playerid,8,2332.6611,2445.7136,5.2626))
		{
		    TextDrawShowForPlayer(playerid,YourTextDrawNameHere);
  		}
	}
	// This is if player Pressed LMB Then Textdraw will get hide
	if (newkeys == KEY_FIRE)
	{
	    TextDrawHideForPlayer(playerid,YourTextDrawNameHere);
 	}
 	return 1;
}
Reply
#3

Yeah, I have a question too,
I've made 3 textdraws and related them to eachother with an array Text:BVMTD[3]

now how can I show this to a player?
Reply
#4

simply use this line

Код:
TextDrawShowForPlayer(playerid, PutYourTextdrawNameHere);
Reply
#5

First of all, you can't use the [3], you must give them one variable each.

new Text:BVMTD, Text:BVMTD1, Text:BVMTD2;

and to show them;

TextDrawShowForPlayer(playerid, BVMTD);
TextDrawShowForPlayer(playerid, BVMTD1);
TextDrawShowForPlayer(playerid, BVMTD2);
Reply
#6

Thanks so much, but is it not possible to close with Y as well.
Reply
#7

Quote:
Originally Posted by Luicy.
Посмотреть сообщение
First of all, you can't use the [3], you must give them one variable each.
No, you don't:
PHP код:
new Text:BVMTD[3];
// Show all of them:
for(new isizeof(BVMTD); ji++) {
    
TextDrawShowForPlayer(playeridBVMTD[i]);
}
// Show only textdraw X to Y (Y being within the array's bounds):
for(new XYi++) {
    
TextDrawShowForPlayer(playeridBVMTD[X]);

Reply
#8

Hey when i compile i get error how do i fix I used TDE

Quote:

C:\Users\***\Desktop\****\filterscripts\bots.pwn(1 4) : error 010: invalid function or declaration

new Text:TDEditor_TD[1];

TDEditor_TD[0] = TextDrawCreate(24.399976, 195.646636, "Hey_guys_nubs_welcome_to_a_random_roleplay_server );
TextDrawLetterSize(TDEditor_TD[0], 0.400000, 1.600000);
TextDrawTextSize(TDEditor_TD[0], 639.000000, 0.000000);
TextDrawAlignment(TDEditor_TD[0], 1);
TextDrawColor(TDEditor_TD[0], -1);
TextDrawUseBox(TDEditor_TD[0], 1);
TextDrawBoxColor(TDEditor_TD[0], 255);
TextDrawSetShadow(TDEditor_TD[0], 0);
TextDrawSetOutline(TDEditor_TD[0], 0);
TextDrawBackgroundColor(TDEditor_TD[0], 255);
TextDrawFont(TDEditor_TD[0], 1);
TextDrawSetProportional(TDEditor_TD[0], 1);
TextDrawSetShadow(TDEditor_TD[0], 0);[/QUOTE]
Reply
#9

Quote:
Originally Posted by Nightmares
Посмотреть сообщение
Hey when i compile i get error how do i fix I used TDE



new Text:TDEditor_TD[1];

TDEditor_TD[0] = TextDrawCreate(24.399976, 195.646636, "Hey_guys_nubs_welcome_to_a_random_roleplay_server );
TextDrawLetterSize(TDEditor_TD[0], 0.400000, 1.600000);
TextDrawTextSize(TDEditor_TD[0], 639.000000, 0.000000);
TextDrawAlignment(TDEditor_TD[0], 1);
TextDrawColor(TDEditor_TD[0], -1);
TextDrawUseBox(TDEditor_TD[0], 1);
TextDrawBoxColor(TDEditor_TD[0], 255);
TextDrawSetShadow(TDEditor_TD[0], 0);
TextDrawSetOutline(TDEditor_TD[0], 0);
TextDrawBackgroundColor(TDEditor_TD[0], 255);
TextDrawFont(TDEditor_TD[0], 1);
TextDrawSetProportional(TDEditor_TD[0], 1);
TextDrawSetShadow(TDEditor_TD[0], 0);
[/QUOTE]

Код:
TDEditor_TD[0] = TextDrawCreate(24.399976, 195.646636, "Hey_guys_nubs_welcome_to_a_random_roleplay_server");
TextDrawLetterSize(TDEditor_TD[0], 0.400000, 1.600000);
TextDrawTextSize(TDEditor_TD[0], 639.000000, 0.000000);
TextDrawAlignment(TDEditor_TD[0], 1);
TextDrawColor(TDEditor_TD[0], -1);
TextDrawUseBox(TDEditor_TD[0], 1);
TextDrawBoxColor(TDEditor_TD[0], 255);
TextDrawSetShadow(TDEditor_TD[0], 0);
TextDrawSetOutline(TDEditor_TD[0], 0);
TextDrawBackgroundColor(TDEditor_TD[0], 255);
TextDrawFont(TDEditor_TD[0], 1);
TextDrawSetProportional(TDEditor_TD[0], 1);
TextDrawSetShadow(TDEditor_TD[0], 0);
Reply
#10

Well the first issue is you didn't close the string, as shown above.
Quote:

TDEditor_TD[0] = TextDrawCreate(24.399976, 195.646636, "Hey_guys_nubs_welcome_to_a_random_roleplay_server ");

Second issue, you're probably not putting these into a callback like OnGameModeInit.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)