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. |
#define Time 999999 // change it to whatever time you want :) ( the numbers!(99))
SetTimer("Timer", Time, 0);
TextDrawLetterSize(Text:text, Float:X, Float:Y);
TextDrawTextSize(Text:text, Float:X, Float:Y);
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. |
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; }
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; } |
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;
}
pawn Код:
|
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?
![]() |
lol here:
![]() pawn Код:
|
// 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);