GameTextForAll question
#1

hey guys,

i'm kinda new to scripting. I want to add to my server in one of the screen corners my forum's URL. I read some topics but none of them satisfied me. So I want this URL to show up for unlimited time and I found out out that TextDrawCreate can't be set for unlimited time at all, but GameTextForAll can be set.
My questions are:
- is there any way to set the unlimited time in other way than inserting "9999999999.....99999999" at the timer?
- how can i set the text position under the minimap?
- is there any way to set the size of the text?
- are there any other scripting function that i can use?

thanks in advance.
Reply
#2

Quote:
Originally Posted by andrei23_yoo
Посмотреть сообщение
hey guys,

i'm kinda new to scripting. I want to add to my server in one of the screen corners my forum's URL. I read some topics but none of them satisfied me. So I want this URL to show up for unlimited time and I found out out that TextDrawCreate can't be set for unlimited time at all, but GameTextForAll can be set.
My questions are:
- is there any way to set the unlimited time in other way than inserting "9999999999.....99999999" at the timer?
- how can i set the text position under the minimap?
- is there any way to set the size of the text?
- are there any other scripting function that i can use?

thanks in advance.
1)
pawn Код:
#define Time 999999 // change it to whatever time you want :) ( the numbers!(99))
SetTimer("Timer", Time, 0);
2) use TextDraw Editor (search for that in te FS release's section
3) Yes :
with this :
pawn Код:
TextDrawLetterSize(Text:text, Float:X, Float:Y);
and this:
pawn Код:
TextDrawTextSize(Text:text, Float:X, Float:Y);
4) Yes alot, just look for [include] 's in the "Filter Scripts and Includes" section, look like that:
[include] NameOfInclude
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
For reference, the largest time you can have is 2147483647 due to the way numbers are stored on PCs (you could also try -1).

What do you want the additional scripting functions to do? An idea of that will help people direct your search.
well i just wanned the URL of my forum to show up permanently on the screen. but it seems i figured out how it can be done.
Reply
#4

Why not using textdraws?
Reply
#5

Quote:
Originally Posted by Kingunit
Посмотреть сообщение
Why not using textdraws?
well at the beginning I didn't knew that textdraws will last forever on the screen, but finally managed to make it
This is what i came up with and thanks alot for helping me
Код:
new Text:forum

public OnGameModeInit()
{
forum = TextDrawCreate(13.0,430.0,"www.******.net");
TextDrawAlignment(forum,0);
TextDrawFont(forum,1);
TextDrawLetterSize(forum,0.4,1.1);
TextDrawSetOutline(forum,1);
TextDrawColor(forum,0x00BBFFFF);
TextDrawSetProportional(forum,1);
return 1;
}

public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, forum);
return 1;
}
Reply
#6

Quote:
Originally Posted by andrei23_yoo
Посмотреть сообщение
well at the beginning I didn't knew that textdraws will last forever on the screen, but finally managed to make it
This is what i came up with and thanks alot for helping me
Код:
new Text:forum

public OnGameModeInit()
{
forum = TextDrawCreate(13.0,430.0,"www.******.net");
TextDrawAlignment(forum,0);
TextDrawFont(forum,1);
TextDrawLetterSize(forum,0.4,1.1);
TextDrawSetOutline(forum,1);
TextDrawColor(forum,0x00BBFFFF);
TextDrawSetProportional(forum,1);
return 1;
}

public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, forum);
return 1;
}
lol here:
pawn Код:
public OnGameModeInit()
{
forum = TextDrawCreate(13.0,430.0,"www.******.net");
TextDrawAlignment(forum,0);
TextDrawFont(forum,1);
TextDrawLetterSize(forum,0.4,1.1);
TextDrawSetOutline(forum,1);
TextDrawColor(forum,0x00BBFFFF);
TextDrawSetProportional(forum,1);
//you forgot this
    for(new i; i < MAX_PLAYERS; i ++) {
        if(IsPlayerConnected(i)) {
            TextDrawShowForPlayer(i, forum);
        }
    }
return 1;
}

public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, forum);
return 1;
}
Reply
#7

can you explain me what does this do? it sounds like making the script work if there are players on the server...am i right?
Quote:
Originally Posted by xkirill
Посмотреть сообщение
pawn Код:
//you forgot this
    for(new i; i < MAX_PLAYERS; i ++)
       {
             if(IsPlayerConnected(i))
             {
                   TextDrawShowForPlayer(i, forum);
             }
       }
Reply
#8

Quote:
Originally Posted by ******
Посмотреть сообщение
Your code is entirely redundant.
ho's code?mine? o.0



Quote:
Originally Posted by andrei23_yoo
Посмотреть сообщение
can you explain me what does this do? it sounds like making the script work if there are players on the server...am i right?
its showing all in the server the textdraw
Reply
#9

Quote:
Originally Posted by xkirill
Посмотреть сообщение
lol here:
pawn Код:
public OnGameModeInit()
{
forum = TextDrawCreate(13.0,430.0,"www.******.net");
TextDrawAlignment(forum,0);
TextDrawFont(forum,1);
TextDrawLetterSize(forum,0.4,1.1);
TextDrawSetOutline(forum,1);
TextDrawColor(forum,0x00BBFFFF);
TextDrawSetProportional(forum,1);
//you forgot this
    for(new i; i < MAX_PLAYERS; i ++) {
        if(IsPlayerConnected(i)) {
            TextDrawShowForPlayer(i, forum);
        }
    }
return 1;
}

public OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, forum);
return 1;
}
are you crazy?

for(new i; i < MAX_PLAYERS; i ++) {
if(IsPlayerConnected(i)) {
TextDrawShowForPlayer(i, forum);
}
}

under ongamemodeinit? wtf?!

Show TextDraw(s) after player spawn or connect..

public OnPlayerSpawn(playerid) or OnPlayerConnect(playerid)
{
TextDrawShowForPlayer(playerid, forum);
.
.

exemple:

Код:
// On top of script:
new Text:Textdraw1;
Код:
// In OnGameModeInit
Textdraw1 = TextDrawCreate(0 ,0 , "Textdraw String");
TextDrawFont(Textdraw1 , 1);
TextDrawLetterSize(Textdraw1 , 1, 7);
TextDrawColor(Textdraw1 , 0x664040FF);
TextDrawSetOutline(Textdraw1 , false);
TextDrawSetProportional(Textdraw1 , true);
TextDrawSetShadow(Textdraw1 , 1);
Код:
// In OnPlayerSpawn
TextDrawShowForPlayer(playerid, Textdraw1);
Код:
// In OnPlayerDeath
TextDrawHideForPlayer(playerid, Textdraw1);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)