SA-MP Forums Archive
Text draw - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Text draw (/showthread.php?tid=305261)



Text draw - SnG.Scot_MisCuDI - 21.12.2011

I have a text draw code:
pawn Код:
// On top of script:
new Text:joinmsg;

// In OnGameModeInit
joinmsg = TextDrawCreate(506 ,330 , "Join:");
TextDrawFont(joinmsg , 3);
TextDrawLetterSize(joinmsg , .4, 2.8000000000000003);
TextDrawColor(joinmsg , 0x187836FF);
TextDrawSetOutline(joinmsg , false);
TextDrawSetProportional(joinmsg , true);
TextDrawSetShadow(joinmsg , 1);
And it is for when some one joins it say in the lower right JOIN:
But the problem is idk how i would make it so it says the JOIN: (name) ? Any help


Re: Text draw - Tee - 21.12.2011

pawn Код:
public OnPlayerConnect(playerid)
{
    new rope[128];
    GetPlayerName(playerid,nAme,sizeof(nAme));
    format(rope,sizeof(rope),"Join: %s",nAme);
    TextDrawSetString(joinmsg,String);
    TextDrawShowForAll(joinmsg);
    return 1;
}



Re: Text draw - Jakku - 21.12.2011

Failed.

pawn Код:
public OnPlayerConnect(playerid)
{
new string[30],name[24];
GetPlayerName(playerid, name,sizeof(name));
format(string,sizeof(string),"Join: %s", name);
TextDrawSetString(joinmsg,string);
TextDrawShowForAll(joinmsg);
}



Re: Text draw - Tee - 21.12.2011

Fail?

pawn Код:
public OnPlayerConnect(playerid)
{
    new rope[30],nAme[24];//There's a chance he already has "string" and or "name"; So he'll get errors...
    GetPlayerName(playerid,nAme,sizeof(nAme));
    format(rope,sizeof(rope),"Join: %s",nAme);
    TextDrawSetString(joinmsg,rope);
    TextDrawShowForAll(joinmsg);
    return 1;
}



Re: Text draw - Jakku - 21.12.2011

Quote:
Originally Posted by Tee
Посмотреть сообщение
Fail?
Yes, tried to compile your previous post?

Quote:
Originally Posted by Tee
Посмотреть сообщение
There's a chance he already has "string" and or "name"; So he'll get errors...
That's true, but I think he is able to fix those errors himself.


Re: Text draw - Tee - 21.12.2011

No you're code is okay, except for the fact that he might have those variables already defined .


Re: Text draw - SnG.Scot_MisCuDI - 21.12.2011

Im getting errors; not with ur code but with the text draw
pawn Код:
(254) : error 001: expected token: "-identifier-", but found "-integer value-"
(254) : warning 215: expression has no effect
(254) : warning 215: expression has no effect
(254) : error 001: expected token: ";", but found ")"
(254) : error 029: invalid expression, assumed zero
(254) : fatal error 107: too many error messages on one line
254
pawn Код:
TextDrawLetterSize(joinmsg , .4, 2.8000000000000003);



Re: Text draw - Tee - 21.12.2011

pawn Код:
TextDrawLetterSize(joinmsg , .4, 2.8000000000000003);
That's your code. There should be something infront of ".4". Maybe 4.0 or a float.

pawn Код:
TextDrawLetterSize(Text:text, Float: x, Float:y);



Re: Text draw - SnG.Scot_MisCuDI - 21.12.2011

my TD interferes with my Speedometer. Is there a way to make them not? The TD isnt showing because of it.


Re: Text draw - MadSkillz - 26.12.2011

Код:
TextDrawLetterSize(joinmsg , .4, 2.8000000000000003);
To

Код:
TextDrawLetterSize(joinmsg , 0.4, 2.8000000000000003);