Textdraw MySQL doubt/help
#1

Hello there, I am using iTD or iPLEOMAX/s textdraw...the thing is that if I create a dialog/textdraw for the things:-
A dialog which allows the user to be teleported somewhere
A dialog which gives health + armour to the player
A dialog which gives the player weapons

But the thing is that, I design the textdraws and copy everything to my script...but how will the dialogue actually teleport player, give health+armour+ weapons ? Do I have to write something extra to it ? If so, can you tell me what ?
Reply
#2

Hello!

Yes, you have to do the textdraws clickable.
https://sampwiki.blast.hk/wiki/TextDrawSetSelectable
(Player => https://sampwiki.blast.hk/wiki/PlayerTextDrawSetSelectable)

Well, you have to go in this callback:
https://sampwiki.blast.hk/wiki/OnPlayerClickTextDraw
(Player => https://sampwiki.blast.hk/wiki/OnPlayerClickPlayerTextDraw)

So. Now you have to check wheather you click on the right textdraw.
PHP код:
if(clickedid == TEXTDRAW_NAME
(Player =>
PHP код:
if(playertextid == TEXTDRAW_NAME
)

Well. Now you can give this player the health, armour, and so on.

- Mencent
Reply
#3

Quote:
Originally Posted by Mencent
Посмотреть сообщение
Hello!

Yes, you have to do the textdraws clickable.
https://sampwiki.blast.hk/wiki/TextDrawSetSelectable
(Player => https://sampwiki.blast.hk/wiki/PlayerTextDrawSetSelectable)

Well, you have to go in this callback:
https://sampwiki.blast.hk/wiki/OnPlayerClickTextDraw
(Player => https://sampwiki.blast.hk/wiki/OnPlayerClickPlayerTextDraw)

So. Now you have to check wheather you click on the right textdraw.
PHP код:
if(clickedid == TEXTDRAW_NAME
(Player =>
PHP код:
if(playertextid == TEXTDRAW_NAME
)

Well. Now you can give this player the health, armour, and so on.

- Mencent
Well, as you see I use iTD..it has a function in which it makes the texts selectable.
If I have made the texts selectable, then is it all good ? Will it automatically give the player the weapons, or TP the player ?
Reply
#4

Then is good.

No! The player doesn't get weapons automatically. You have to script this with the callback which is send you.
If the player click on the textdraw you have to give him/her the weapon with GivePlayerWeapon.

- Mencent
Reply
#5

Like can you show the script for example ? After the textdraw code, do I have to use givePlayerWeapon ?
Reply
#6

So. If you click on the textdraw for the weapons you are going to get certain weapons?
If so, can you send me the code of the textdraw for weapons?

- Mencent
Reply
#7

I will send it as soon as possible....alright..
Reply
#8

Here the textdraw for Admin Teleport system is :-
Код:
//Global Textdraws:

new Text:Textdraw0;
new Text:Textdraw1;
new Text:Textdraw2;
new Text:Textdraw3;
new Text:Textdraw4;
new Text:Textdraw5;
new Text:Textdraw6;
new Text:Textdraw7;
new Text:Textdraw8;
new Text:Textdraw9;
new Text:Textdraw10;


Textdraw0 = TextDrawCreate(492.399902, 168.753356, "usebox");
TextDrawLetterSize(Textdraw0, 0.000000, 27.641849);
TextDrawTextSize(Textdraw0, 142.000015, 0.000000);
TextDrawAlignment(Textdraw0, 1);
TextDrawColor(Textdraw0, 0);
TextDrawUseBox(Textdraw0, true);
TextDrawBoxColor(Textdraw0, 102);
TextDrawSetShadow(Textdraw0, -64);
TextDrawSetOutline(Textdraw0, 0);
TextDrawFont(Textdraw0, 0);

Textdraw1 = TextDrawCreate(156.000000, 179.946609, "-----------------------------------------------");
TextDrawLetterSize(Textdraw1, 0.449999, 1.600000);
TextDrawAlignment(Textdraw1, 1);
TextDrawColor(Textdraw1, -65281);
TextDrawSetShadow(Textdraw1, 0);
TextDrawSetOutline(Textdraw1, 1);
TextDrawBackgroundColor(Textdraw1, 51);
TextDrawFont(Textdraw1, 1);
TextDrawSetProportional(Textdraw1, 1);

Textdraw2 = TextDrawCreate(206.400115, 191.893310, "Admin Teleport Menu");
TextDrawLetterSize(Textdraw2, 0.449999, 1.600000);
TextDrawAlignment(Textdraw2, 1);
TextDrawColor(Textdraw2, -1);
TextDrawSetShadow(Textdraw2, 0);
TextDrawSetOutline(Textdraw2, 1);
TextDrawBackgroundColor(Textdraw2, 51);
TextDrawFont(Textdraw2, 2);
TextDrawSetProportional(Textdraw2, 1);

Textdraw3 = TextDrawCreate(162.000000, 226.993331, "usebox");
TextDrawLetterSize(Textdraw3, 0.000000, 0.429998);
TextDrawTextSize(Textdraw3, 154.000000, 0.000000);
TextDrawAlignment(Textdraw3, 1);
TextDrawColor(Textdraw3, 0);
TextDrawUseBox(Textdraw3, true);
TextDrawBoxColor(Textdraw3, 102);
TextDrawSetShadow(Textdraw3, 0);
TextDrawSetOutline(Textdraw3, 0);
TextDrawFont(Textdraw3, 0);

Textdraw4 = TextDrawCreate(162.399978, 237.440048, "LD_SPAC:white");
TextDrawLetterSize(Textdraw4, 0.000000, 0.000000);
TextDrawTextSize(Textdraw4, 220.800125, 23.146646);
TextDrawAlignment(Textdraw4, 1);
TextDrawColor(Textdraw4, -1);
TextDrawSetShadow(Textdraw4, 0);
TextDrawSetOutline(Textdraw4, 0);
TextDrawFont(Textdraw4, 4);
TextDrawSetSelectable(Textdraw4, true);

Textdraw5 = TextDrawCreate(163.199966, 219.519912, "Enter Player's name or ID");
TextDrawLetterSize(Textdraw5, 0.449999, 1.600000);
TextDrawAlignment(Textdraw5, 1);
TextDrawColor(Textdraw5, -1);
TextDrawSetShadow(Textdraw5, 0);
TextDrawSetOutline(Textdraw5, 1);
TextDrawBackgroundColor(Textdraw5, 51);
TextDrawFont(Textdraw5, 1);
TextDrawSetProportional(Textdraw5, 1);

Textdraw6 = TextDrawCreate(163.200027, 269.546630, "Enter location in x,y,z coordinates");
TextDrawLetterSize(Textdraw6, 0.449999, 1.600000);
TextDrawAlignment(Textdraw6, 1);
TextDrawColor(Textdraw6, -1);
TextDrawSetShadow(Textdraw6, 0);
TextDrawSetOutline(Textdraw6, 1);
TextDrawBackgroundColor(Textdraw6, 51);
TextDrawFont(Textdraw6, 1);
TextDrawSetProportional(Textdraw6, 1);

Textdraw7 = TextDrawCreate(162.399993, 289.706665, "LD_SPAC:white");
TextDrawLetterSize(Textdraw7, 0.000000, 0.000000);
TextDrawTextSize(Textdraw7, 220.000030, 21.653320);
TextDrawAlignment(Textdraw7, 1);
TextDrawColor(Textdraw7, -1);
TextDrawSetShadow(Textdraw7, 0);
TextDrawSetOutline(Textdraw7, 0);
TextDrawFont(Textdraw7, 4);
TextDrawSetSelectable(Textdraw7, true);

Textdraw8 = TextDrawCreate(171.999954, 293.439971, "Enter in x,y,z only!");
TextDrawLetterSize(Textdraw8, 0.449999, 1.600000);
TextDrawAlignment(Textdraw8, 1);
TextDrawColor(Textdraw8, 41215);
TextDrawSetShadow(Textdraw8, 0);
TextDrawSetOutline(Textdraw8, 1);
TextDrawBackgroundColor(Textdraw8, 51);
TextDrawFont(Textdraw8, 1);
TextDrawSetProportional(Textdraw8, 1);

Textdraw9 = TextDrawCreate(170.399932, 239.679962, "Enter name or ID only!");
TextDrawLetterSize(Textdraw9, 0.449999, 1.600000);
TextDrawAlignment(Textdraw9, 1);
TextDrawColor(Textdraw9, 41215);
TextDrawSetShadow(Textdraw9, 0);
TextDrawSetOutline(Textdraw9, 1);
TextDrawBackgroundColor(Textdraw9, 51);
TextDrawFont(Textdraw9, 1);
TextDrawSetProportional(Textdraw9, 1);

Textdraw10 = TextDrawCreate(231.200012, 344.959960, "Continue ---->");
TextDrawLetterSize(Textdraw10, 0.794000, 3.115730);
TextDrawAlignment(Textdraw10, 1);
TextDrawColor(Textdraw10, -16776961);
TextDrawSetShadow(Textdraw10, 0);
TextDrawSetOutline(Textdraw10, 1);
TextDrawBackgroundColor(Textdraw10, 51);
TextDrawFont(Textdraw10, 0);
TextDrawSetProportional(Textdraw10, 1);
TextDrawSetSelectable(Textdraw10, true);


//Player Textdraws:

new PlayerText:Textdraw0[MAX_PLAYERS];


Textdraw0[playerid] = CreatePlayerTextDraw(playerid, 150.400039, 168.746566, "Welcome to CODE5 Administration system!");
PlayerTextDrawLetterSize(playerid, Textdraw0[playerid], 0.449999, 1.600000);
PlayerTextDrawAlignment(playerid, Textdraw0[playerid], 1);
PlayerTextDrawColor(playerid, Textdraw0[playerid], -1);
PlayerTextDrawSetShadow(playerid, Textdraw0[playerid], -1);
PlayerTextDrawSetOutline(playerid, Textdraw0[playerid], 0);
PlayerTextDrawBackgroundColor(playerid, Textdraw0[playerid], 65535);
PlayerTextDrawFont(playerid, Textdraw0[playerid], 3);
PlayerTextDrawSetProportional(playerid, Textdraw0[playerid], 1);
Now, the thing is...which textdraws should I set for global and which for players only ? And yeah, the system should be visible to admins only...
The most important thing is how will the player be TP'ed directly to his location ? Can you tell me what to do ?
Also, likeways, how can I give the player a weapon using the same system as above, instead the textdraws will show give player weapons ?
Reply
#9

Help.
Reply
#10

Textdraw 0 => global
Textdraw 1 => global
Textdraw 2 => global
Textdraw 3 => global
Textdraw 4 => global
Textdraw 5 => player
Textdraw 6 => player
Textdraw 7 => global
Textdraw 8 => player
Textdraw 9 => player
Textdraw 10 => global

Well. Which textdraws have to fill the player with names or numbers?
Textdraw 5 and Textdraw 6 are important for us, aren't they?
The other Textdraws (number 8 and 9) are only notices, aren't they?


- Mencent
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)