[Include] Textdraw Flags - Over 30 country flags
#1

Textdraw Country Flags

Overview

This include gives you access to textdraw flags of over 30 countries, for instance USA, Canada, Brazil, Germany, Sweden and many others. They can be created with one simple function.



Creating/Showing a flag

pawn Код:
native TextDrawFlagShowForPlayer(playerid, flagtype, Float:X, Float:Y, clickable);

//Example
TextDrawFlagShowForPlayer(playerid, FLAG_TYPE_GERMANY, 320.0, 240.0, 1);
playerid - The ID of the player to show the flag to
flagtype - The flag type to show to the player
Float:X - The X coordinate of the flag on the player's screen
Float:Y - The Y coordinate of the flag on the player's screen
clickable - Determines whether the flag can be clicked or not



Checking for a flag being clicked

If a certain flag is shown to the player and the clickable parameter has been set to 1, OnPlayerSelectPlayerTextDraw() gets called:
pawn Код:
public OnPlayerClickPlayerTextDraw(playerid, PlayerText:playertextid)
{
    if(playertextid == FLAG_GERMANY[playerid])
    {
        SendClientMessage(playerid, -1, "You have clicked on the flag of Germany!");
    }
    return 1;
}
(To select textdraws use SelectTextDraw.)



Deleting/Hiding a flag

To delete a flag shown on a player's screen, simply use

pawn Код:
native TextDrawFlagHideForPlayer(playerid, flagtype);

//Example
TextDrawFlagHideForPlayer(playerid, FLAG_TYPE_GERMANY);
playerid - The ID of the player of whom you want to delete the shown flag
flagtype - The flagtyp to delete

NOTE: You can only create one flag of the same flagtype at a time. Means if there is already a German flag on the player's screen, you can not create another German flag for the same player. This is to prevent a mixing up of the textdraw IDs.



Placing a flag

All flags have the same size. To place a flag, I suggest you to use Zamaroth's Textdraw Editor. Create a new textdraw with "_" as the text. Set the font size to X 0.50 and Y 3.90. Enable the box and set the box size to X 33.0 and Y 54.5. Then set the alignment to 2. You now have a box with the exact same size of all the flags, which allows you to get exact positions.



Available countries

pawn Код:
#define FLAG_TYPE_GERMANY           0
#define FLAG_TYPE_NETHERLANDS       1
#define FLAG_TYPE_RUSSIA            2
#define FLAG_TYPE_AUSTRIA           3
#define FLAG_TYPE_BULGARIA          4
#define FLAG_TYPE_LITHUANIA         5  
#define FLAG_TYPE_ESTONIA           6
#define FLAG_TYPE_LUXEMBOURG        7
#define FLAG_TYPE_HUNGARY           8
#define FLAG_TYPE_ARMENIA           9
#define FLAG_TYPE_POLAND            10
#define FLAG_TYPE_CZECH_REPUBLIC    11
#define FLAG_TYPE_UKRAINE           12
#define FLAG_TYPE_ITALY             13
#define FLAG_TYPE_FRANCE            14
#define FLAG_TYPE_IRELAND           15
#define FLAG_TYPE_ROMANIA           16
#define FLAG_TYPE_BELGIUM           17
#define FLAG_TYPE_SWEDEN            18
#define FLAG_TYPE_FINLAND           19
#define FLAG_TYPE_DENMARK           20
#define FLAG_TYPE_NORWAY            21
#define FLAG_TYPE_ICELAND           22
#define FLAG_TYPE_SPAIN             23
#define FLAG_TYPE_USA               24
#define FLAG_TYPE_SWITZERLAND       25
#define FLAG_TYPE_ENGLAND           26
#define FLAG_TYPE_CANADA            27
#define FLAG_TYPE_BRAZIL            28
#define FLAG_TYPE_TURKEY            29
#define FLAG_TYPE_JAPAN             30
#define FLAG_TYPE_CHINA             31
#define FLAG_TYPE_ARGENTINIA        32
#define FLAG_TYPE_PORTUGAL          33


Download

Solidfiles
Pastebin



Notes

Due to the textdraw limitations it was not possible for me to create the flag of the United Kingdom. Therefore I created the flag of England instead. Thereby this include also doesn't contain the flags of Australia and New Zealand.
If you find a way to create the flag of the UK, feel free to send me a PM.
Reply
#2

Why do you have a separate function for EVERY SINGLE FLAG..?

Also, no Union Jack? :/

Reply
#3

can you make Estonia flag to?:

BLUE
BLACK
WHITE
Reply
#4

Quote:
Originally Posted by MP2
Посмотреть сообщение
Also, no Union Jack? :/
No because I found no way to create the diagonals. If you found a way feel free to tell me.


Quote:
Originally Posted by James Coral
Посмотреть сообщение
can you make Estonia flag to?:

BLUE
BLACK
WHITE
Already included.
Reply
#5

You finally (was pretty quick lol) released it! W-O-W!
Good job, man... good job!

Oh come on, where is the Israel flag?
Reply
#6

Can you make Slovakia flage? Thanks!
I know its's hardcore but there's a lot of scripters from Slovakia and they will be happy!



Sorry bro for my English
Reply
#7

Very nice !
Reply
#8

A-A-A-A-A-A-AWESOME !
Gonna use it, thanks
Reply
#9

You know, this would work quite well on a multilangual server - it would make for a much more awesome language choice menu.
Reply
#10

Quote:
Originally Posted by TheBetaFox
Посмотреть сообщение
You know, this would work quite well on a multilangual server - it would make for a much more awesome language choice menu.
True..

OT: Awesome work, this would really work best with a multilang server... Especially when you are given the choice to choose which language using td's!
Reply
#11

can you make Korea flage?

please

Reply
#12

Nice!, good job.
Reply
#13

What about Israel Flag ?
Reply
#14

Very Good.
Reply
#15

Very nice job,can you add Croatian flag?
Reply
#16

Colombia
. XD
Reply
#17

DreBin, can you please include India's flag?

Orange
White
Green


(IF you know what I mean)
Reply
#18

Can you please tell me how many TEXTDRAW's (not flags) does this include use in total?
Reply
#19

Hehe, very nice idea man
Reply
#20

wish there were iran's flag included without that sign in the center in your include ^^that would be great :P
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)