Textdraws Problem
#1

I have a strange problem when trying creating textdraws in files. For example:

pawn Код:
#include "../include/textdraws/character_selection.td"
This won't work, but if I copy&paste the file content into the gamemode, it does. Why ?
Reply
#2

As I am thinking you can't #include a .td file?
Reply
#3

You can only include .txt, .log, .ini files etc....
Reply
#4

Happens with any extension, it doesn't matter.
Reply
#5

no... as far as i know... a textdraw CANNOT be added into orignal script thru #include..

but a .inc .txt. .ini file can be included (as far as i know)

good luck
Reply
#6

Quote:
Originally Posted by DopeX
Посмотреть сообщение
no... as far as i know... a textdraw CANNOT be added into orignal script thru #include..

but a .inc .txt. .ini file can be included (as far as i know)

good luck
Can anyone else confirm that ?
Reply
#7

Sorry for bumping the thread. I found out that only one include file will work, others won't work. If I try including 2 files one after the other it won't work. Is there any workaround for this ?
Reply
#8

#include expands the file that is specified inside the < > or " " before the compiler gets to work, i.e. it replaces the #include <file.txt> line in your source code with the content of file.txt. My guess is that .td files are not text files, so they can't be expanded like a .txt file for example.
Reply
#9

What do you mean by "won't work"? And can you show us your include lines?
Reply
#10

Hazardous: I tried with .txt, .inc, .pwn extensions - doesn't work.
CalvinC:
character_creation.inc
pawn Код:
Text_CreateCharacter[0] = TextDrawCreate(240.222259, 130.266632, "box");
    TextDrawLetterSize(Text_CreateCharacter[0], 0.000000, 21.288894);
    TextDrawTextSize(Text_CreateCharacter[0], 397.555664, 0.000000);
    TextDrawAlignment(Text_CreateCharacter[0], 1);
    TextDrawColor(Text_CreateCharacter[0], -1);
    TextDrawUseBox(Text_CreateCharacter[0], 1);
    TextDrawBoxColor(Text_CreateCharacter[0], 150);
    TextDrawSetShadow(Text_CreateCharacter[0], 0);
    TextDrawSetOutline(Text_CreateCharacter[0], 0);
    TextDrawBackgroundColor(Text_CreateCharacter[0], 150);
    TextDrawFont(Text_CreateCharacter[0], 1);
    TextDrawSetProportional(Text_CreateCharacter[0], 1);

    Text_CreateCharacter[1] = TextDrawCreate(245.555557, 131.262237, "Character_Selection");
    TextDrawLetterSize(Text_CreateCharacter[1], 0.314666, 1.326222);
    TextDrawAlignment(Text_CreateCharacter[1], 1);
    TextDrawColor(Text_CreateCharacter[1], -1);
    TextDrawSetShadow(Text_CreateCharacter[1], 0);
    TextDrawSetOutline(Text_CreateCharacter[1], 0);
    TextDrawBackgroundColor(Text_CreateCharacter[1], 255);
    TextDrawFont(Text_CreateCharacter[1], 2);
    TextDrawSetProportional(Text_CreateCharacter[1], 1);

    Text_CreateCharacter[2] = TextDrawCreate(319.777954, 171.084442, "Looks like you did_not_create~n~any_character.~n~Click_on_the_button_below~n~in_order_to_create_a~n~new_character.");
    TextDrawLetterSize(Text_CreateCharacter[2], 0.231111, 1.415821);
    TextDrawAlignment(Text_CreateCharacter[2], 2);
    TextDrawColor(Text_CreateCharacter[2], -1);
    TextDrawSetShadow(Text_CreateCharacter[2], 0);
    TextDrawSetOutline(Text_CreateCharacter[2], 0);
    TextDrawBackgroundColor(Text_CreateCharacter[2], 255);
    TextDrawFont(Text_CreateCharacter[2], 1);
    TextDrawSetProportional(Text_CreateCharacter[2], 1);

    Text_CreateCharacter[3] = TextDrawCreate(289.555725, 272.631317, "Create");
    TextDrawLetterSize(Text_CreateCharacter[3], 0.400000, 1.600000);
    TextDrawTextSize(Text_CreateCharacter[3], 345.0, 16.0);
    TextDrawAlignment(Text_CreateCharacter[3], 1);
    TextDrawColor(Text_CreateCharacter[3], -1);
    TextDrawSetShadow(Text_CreateCharacter[3], 0);
    TextDrawSetOutline(Text_CreateCharacter[3], 0);
    TextDrawBackgroundColor(Text_CreateCharacter[3], 255);
    TextDrawFont(Text_CreateCharacter[3], 2);
    TextDrawSetProportional(Text_CreateCharacter[3], 1);
    TextDrawSetShadow(Text_CreateCharacter[3], 0);
    TextDrawSetSelectable(Text_CreateCharacter[3], true);
character_selection.inc
pawn Код:
Text_CharacterSelection[0] = TextDrawCreate(225.555603, 115.333290, "box");
    TextDrawLetterSize(Text_CharacterSelection[0], 0.000000, 31.377794);
    TextDrawTextSize(Text_CharacterSelection[0], 411.777496, 0.000000);
    TextDrawAlignment(Text_CharacterSelection[0], 1);
    TextDrawColor(Text_CharacterSelection[0], -1);
    TextDrawUseBox(Text_CharacterSelection[0], 1);
    TextDrawBoxColor(Text_CharacterSelection[0], 100);
    TextDrawSetShadow(Text_CharacterSelection[0], 0);
    TextDrawSetOutline(Text_CharacterSelection[0], 0);
    TextDrawBackgroundColor(Text_CharacterSelection[0], 255);
    TextDrawFont(Text_CharacterSelection[0], 1);
    TextDrawSetProportional(Text_CharacterSelection[0], 1);
    TextDrawSetShadow(Text_CharacterSelection[0], 0);

    Text_CharacterSelection[1] = TextDrawCreate(228.666656, 144.702255, "box");
    TextDrawLetterSize(Text_CharacterSelection[1], 0.000000, 8.666666);
    TextDrawTextSize(Text_CharacterSelection[1], 408.666870, 0.000000);
    TextDrawAlignment(Text_CharacterSelection[1], 1);
    TextDrawColor(Text_CharacterSelection[1], -1);
    TextDrawUseBox(Text_CharacterSelection[1], 1);
    TextDrawBoxColor(Text_CharacterSelection[1], 255);
    TextDrawSetShadow(Text_CharacterSelection[1], 0);
    TextDrawSetOutline(Text_CharacterSelection[1], 0);
    TextDrawBackgroundColor(Text_CharacterSelection[1], 255);
    TextDrawFont(Text_CharacterSelection[1], 1);
    TextDrawSetProportional(Text_CharacterSelection[1], 1);
    TextDrawSetShadow(Text_CharacterSelection[1], 0);

    Text_CharacterSelection[2] = TextDrawCreate(228.666671, 229.822250, "box");
    TextDrawLetterSize(Text_CharacterSelection[2], 0.000000, 8.666666);
    TextDrawTextSize(Text_CharacterSelection[2], 408.666870, 0.000000);
    TextDrawAlignment(Text_CharacterSelection[2], 1);
    TextDrawColor(Text_CharacterSelection[2], -1);
    TextDrawUseBox(Text_CharacterSelection[2], 1);
    TextDrawBoxColor(Text_CharacterSelection[2], 255);
    TextDrawSetShadow(Text_CharacterSelection[2], 0);
    TextDrawSetOutline(Text_CharacterSelection[2], 0);
    TextDrawBackgroundColor(Text_CharacterSelection[2], 255);
    TextDrawFont(Text_CharacterSelection[2], 1);
    TextDrawSetProportional(Text_CharacterSelection[2], 1);
    TextDrawSetShadow(Text_CharacterSelection[2], 0);

    Text_CharacterSelection[3] = TextDrawCreate(228.666671, 314.942352, "box");
    TextDrawLetterSize(Text_CharacterSelection[3], 0.000000, 8.666666);
    TextDrawTextSize(Text_CharacterSelection[3], 408.666839, 0.000000);
    TextDrawAlignment(Text_CharacterSelection[3], 1);
    TextDrawColor(Text_CharacterSelection[3], -1);
    TextDrawUseBox(Text_CharacterSelection[3], 1);
    TextDrawBoxColor(Text_CharacterSelection[3], 255);
    TextDrawSetShadow(Text_CharacterSelection[3], 0);
    TextDrawSetOutline(Text_CharacterSelection[3], 0);
    TextDrawBackgroundColor(Text_CharacterSelection[3], 255);
    TextDrawFont(Text_CharacterSelection[3], 1);
    TextDrawSetProportional(Text_CharacterSelection[3], 1);
    TextDrawSetShadow(Text_CharacterSelection[3], 0);

    Text_CharacterSelection[4] = TextDrawCreate(242.888900, 120.808898, "Your Characters");
    TextDrawLetterSize(Text_CharacterSelection[4], 0.400000, 1.600000);
    TextDrawAlignment(Text_CharacterSelection[4], 1);
    TextDrawColor(Text_CharacterSelection[4], -1);
    TextDrawSetShadow(Text_CharacterSelection[4], 0);
    TextDrawSetOutline(Text_CharacterSelection[4], 0);
    TextDrawBackgroundColor(Text_CharacterSelection[4], 255);
    TextDrawFont(Text_CharacterSelection[4], 2);
    TextDrawSetProportional(Text_CharacterSelection[4], 1);
    TextDrawSetShadow(Text_CharacterSelection[4], 0);

    Text_CharacterSelection[5] = TextDrawCreate(379.333312, 207.422225, "play");
    TextDrawLetterSize(Text_CharacterSelection[5], 0.400000, 1.595022);
    TextDrawAlignment(Text_CharacterSelection[5], 1);
    TextDrawColor(Text_CharacterSelection[5], -1);
    TextDrawSetShadow(Text_CharacterSelection[5], 0);
    TextDrawSetOutline(Text_CharacterSelection[5], 0);
    TextDrawBackgroundColor(Text_CharacterSelection[5], 255);
    TextDrawFont(Text_CharacterSelection[5], 1);
    TextDrawSetProportional(Text_CharacterSelection[5], 1);
    TextDrawSetShadow(Text_CharacterSelection[5], 0);
    TextDrawSetSelectable(Text_CharacterSelection[5], true);

    Text_CharacterSelection[6] = TextDrawCreate(380.222167, 292.542236, "play");
    TextDrawLetterSize(Text_CharacterSelection[6], 0.400000, 1.595022);
    TextDrawAlignment(Text_CharacterSelection[6], 1);
    TextDrawColor(Text_CharacterSelection[6], -1);
    TextDrawSetShadow(Text_CharacterSelection[6], 0);
    TextDrawSetOutline(Text_CharacterSelection[6], 0);
    TextDrawBackgroundColor(Text_CharacterSelection[6], 255);
    TextDrawFont(Text_CharacterSelection[6], 1);
    TextDrawSetProportional(Text_CharacterSelection[6], 1);
    TextDrawSetShadow(Text_CharacterSelection[6], 0);
    TextDrawSetSelectable(Text_CharacterSelection[6], true);

    Text_CharacterSelection[7] = TextDrawCreate(380.000000, 378.098663, "play");
    TextDrawLetterSize(Text_CharacterSelection[7], 0.400000, 1.595022);
    TextDrawAlignment(Text_CharacterSelection[7], 1);
    TextDrawColor(Text_CharacterSelection[7], -1);
    TextDrawSetShadow(Text_CharacterSelection[7], 0);
    TextDrawSetOutline(Text_CharacterSelection[7], 0);
    TextDrawBackgroundColor(Text_CharacterSelection[7], 255);
    TextDrawFont(Text_CharacterSelection[7], 1);
    TextDrawSetProportional(Text_CharacterSelection[7], 1);
    TextDrawSetShadow(Text_CharacterSelection[7], 0);
    TextDrawSetSelectable(Text_CharacterSelection[7], true);
   
    Text_CharacterSelection[8] = TextDrawCreate(258.888854, 258.195648, "No Character");
    TextDrawLetterSize(Text_CharacterSelection[8], 0.400000, 1.600000);
    TextDrawAlignment(Text_CharacterSelection[8], 1);
    TextDrawColor(Text_CharacterSelection[8], -1);
    TextDrawSetShadow(Text_CharacterSelection[8], 0);
    TextDrawSetOutline(Text_CharacterSelection[8], 0);
    TextDrawBackgroundColor(Text_CharacterSelection[8], 255);
    TextDrawFont(Text_CharacterSelection[8], 2);
    TextDrawSetProportional(Text_CharacterSelection[8], 1);
    TextDrawSetShadow(Text_CharacterSelection[8], 0);

    Text_CharacterSelection[9] = TextDrawCreate(258.444458, 347.795654, "No Character");
    TextDrawLetterSize(Text_CharacterSelection[9], 0.400000, 1.600000);
    TextDrawAlignment(Text_CharacterSelection[9], 1);
    TextDrawColor(Text_CharacterSelection[9], -1);
    TextDrawSetShadow(Text_CharacterSelection[9], 0);
    TextDrawSetOutline(Text_CharacterSelection[9], 0);
    TextDrawBackgroundColor(Text_CharacterSelection[9], 255);
    TextDrawFont(Text_CharacterSelection[9], 2);
    TextDrawSetProportional(Text_CharacterSelection[9], 1);
    TextDrawSetShadow(Text_CharacterSelection[9], 0);
Those are 2 inc files. If I include them like this:
pawn Код:
#include "../include/textdraws/character_creation.inc"
#include "../include/textdraws/character_selection.inc"
Only the first file content will work in game.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)