Textdraw not working [Rep]
#1

Hey, not sure how to add another textdraw to the login screen of my script. So far I have this code under OnGameModeInIt
pawn Код:
new Text:LoginDraw1;
    for(new i = 0; i < MAX_PLAYERS; i++)
    TextDrawShowForPlayer(i, LoginDraw1);
    LoginDraw1 = TextDrawCreate(660.125000, 459.416717, "usebox");
    TextDrawLetterSize(LoginDraw1, 0.000000, -13.643054);
    TextDrawTextSize(LoginDraw1, -3.875000, 0.000000);
    TextDrawAlignment(LoginDraw1, 1);
    TextDrawColor(LoginDraw1, 0);
    TextDrawUseBox(LoginDraw1, true);
    TextDrawBoxColor(LoginDraw1, 180);
    TextDrawSetShadow(LoginDraw1, 0);
    TextDrawSetOutline(LoginDraw1, 0);
    TextDrawBackgroundColor(LoginDraw1, -2139062017);
    TextDrawFont(LoginDraw1, 0);
Now, the above code only adds the black box under the login screen. I want to add my textdraw (saying "Exclusive Gaming v3.0" etc inside the box, and I've got the code (All co-ordinates are correct).

pawn Код:
new Text:Textdraw1;
    TextDrawShowForPlayer(i, Textdraw1); // here
    Textdraw1 = TextDrawCreate(86.875000, 347.666503, "Exclusive Gaming v3.0");
    TextDrawLetterSize(Textdraw1, 0.926875, 3.513334);
    TextDrawAlignment(Textdraw1, 1);
    TextDrawColor(Textdraw1, 16777215);
    TextDrawSetShadow(Textdraw1, 0);
    TextDrawSetOutline(Textdraw1, 1);
    TextDrawBackgroundColor(Textdraw1, 51);
    TextDrawFont(Textdraw1, 2);
    TextDrawSetProportional(Textdraw1, 1);
Can someone please tell me how I post this under the above textbox? If I paste it underneath, it says "undefined symbol "playerid" " and when I change the playerid to an "i" using "for(new i = 0; i < MAX_PLAYERS; i++)" again, it compiles fine, but no text comes up whatsoever inside the textdrawbox I created above it for the login screen. Could someone please show me how I can put the codes together so they both show, without "playerid" being undefined?

Any help would be appreciated! Thank you
Reply
#2

OnGameModeInit that goes, see if it works for you

pawn Код:
new Text:Textdraw1[MAX_PLAYERS];

new Text:LoginDraw1[MAX_PLAYERS];
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    TextDrawShowForPlayer(i, LoginDraw1); // that can not be this O.o
    LoginDraw1[i] = TextDrawCreate(660.125000, 459.416717, "usebox");
    TextDrawLetterSize(LoginDraw1[i], 0.000000, -13.643054);
    TextDrawTextSize(LoginDraw1[i],  -3.875000, 0.000000);
    TextDrawAlignment(LoginDraw1[i], 1);
    TextDrawColor(LoginDraw1[i], 0);
    TextDrawUseBox(LoginDraw1[i], true);
    TextDrawBoxColor(LoginDraw1[i], 180);
    TextDrawSetShadow(LoginDraw1[i], 0);
    TextDrawSetOutline(LoginDraw1[i], 0);
    TextDrawBackgroundColor(LoginDraw1[i], -2139062017);
    TextDrawFont(LoginDraw1[i], 0);

    TextDrawShowForPlayer(i, Textdraw1); // that can not be this O.o
    Textdraw1[i] = TextDrawCreate(86.875000, 347.666503, "Exclusive Gaming v3.0");
    TextDrawLetterSize(Textdraw1[i], 0.926875, 3.513334);
    TextDrawAlignment(Textdraw1[i], 1);
    TextDrawColor(Textdraw1[i], 16777215);
    TextDrawSetShadow(Textdraw1[i], 0);
    TextDrawSetOutline(Textdraw1[i], 1);
    TextDrawBackgroundColor(Textdraw1[i], 51);
    TextDrawFont(Textdraw1[i], 2);
    TextDrawSetProportional(Textdraw1[i], 1);
}
EDIT: OnPlayerConnect this goes for the player to connect textdraw see below and in OnPlayerSpawn so that you are clear the TextDraw to reappear

pawn Код:
TextDrawShowForPlayer(playerid, Textdraw1[i]);
TextDrawShowForPlayer(playerid, LoginDraw1[i]);
in OnPlayerSpawn

pawn Код:
TextDrawHideForPlayer(playerid, Textdraw1[i]);
TextDrawHideForPlayer(playerid, LoginDraw1[i]);
Reply
#3

Quote:
Originally Posted by !R1Ch@rD!
Посмотреть сообщение
pawn Код:
new Text:Textdraw1[MAX_PLAYERS];

new Text:LoginDraw1[MAX_PLAYERS];
pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
{
    TextDrawShowForPlayer(i, LoginDraw1); // that can not be this O.o
    LoginDraw1[i] = TextDrawCreate(660.125000, 459.416717, "usebox");
    TextDrawLetterSize(LoginDraw1[i], 0.000000, -13.643054);
    TextDrawTextSize(LoginDraw1[i],  -3.875000, 0.000000);
    TextDrawAlignment(LoginDraw1[i], 1);
    TextDrawColor(LoginDraw1[i], 0);
    TextDrawUseBox(LoginDraw1[i], true);
    TextDrawBoxColor(LoginDraw1[i], 180);
    TextDrawSetShadow(LoginDraw1[i], 0);
    TextDrawSetOutline(LoginDraw1[i], 0);
    TextDrawBackgroundColor(LoginDraw1[i], -2139062017);
    TextDrawFont(LoginDraw1[i], 0);

    TextDrawShowForPlayer(i, Textdraw1); // that can not be this O.o
    Textdraw1[i] = TextDrawCreate(86.875000, 347.666503, "Exclusive Gaming v3.0");
    TextDrawLetterSize(Textdraw1[i], 0.926875, 3.513334);
    TextDrawAlignment(Textdraw1[i], 1);
    TextDrawColor(Textdraw1[i], 16777215);
    TextDrawSetShadow(Textdraw1[i], 0);
    TextDrawSetOutline(Textdraw1[i], 1);
    TextDrawBackgroundColor(Textdraw1[i], 51);
    TextDrawFont(Textdraw1[i], 2);
    TextDrawSetProportional(Textdraw1[i], 1);
}
if you want to put it when the player is connected OnPlayerConnect put it in the callback and if I put it where it belongs in OnGameModeInit eh though I never put a TextDraw in OnPlayerConnect you will work ?? so do you want it?
Sure, will the code you posted work?
Reply
#4

Quote:
Originally Posted by Josh_Main
Посмотреть сообщение
Sure, will the code you posted work?
as you get there you edit!
Reply
#5

Quote:
Originally Posted by !R1Ch@rD!
Посмотреть сообщение
as you get there you edit!
I put
pawn Код:
TextDrawShowForPlayer(playerid, LoginTextDraw[i]);
    TextDrawShowForPlayer(playerid, LoginTextDraw2[i]);
under on player connect and now

Код:
C:\Users\cbrickell\Desktop\ExRp\gamemodes\EGRP.pwn(1483) : error 017: undefined symbol "LoginTextDraw"
C:\Users\cbrickell\Desktop\ExRp\gamemodes\EGRP.pwn(1484) : error 017: undefined symbol "LoginTextDraw2"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Reply
#6

Quote:
Originally Posted by Josh_Main
Посмотреть сообщение
I put
pawn Код:
TextDrawShowForPlayer(playerid, LoginTextDraw);
    TextDrawShowForPlayer(playerid, LoginTextDraw2);
under on player connect and now

Код:
C:\Users\cbrickell\Desktop\ExRp\gamemodes\EGRP.pwn(1483) : error 017: undefined symbol "LoginTextDraw"
C:\Users\cbrickell\Desktop\ExRp\gamemodes\EGRP.pwn(1484) : error 017: undefined symbol "LoginTextDraw2"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
pawn Код:
new Text:LoginTextDraw[MAX_PLAYERS];
new Text:LoginTextDraw2[MAX_PLAYERS];
explain how you put it?
Reply
#7

pawn Код:
new Text:LoginTextDraw[MAX_PLAYERS];
    new Text:LoginTextDraw2[MAX_PLAYERS];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
     // TextDrawShowForPlayer(i, LoginTextDraw); // this goes under onplayerconnect
        LoginTextDraw[i] = TextDrawCreate(660.125000, 459.416717, "usebox");
        TextDrawLetterSize(LoginTextDraw[i], 0.000000, -13.643054);
        TextDrawTextSize(LoginTextDraw[i], -3.875000, 0.000000);
        TextDrawAlignment(LoginTextDraw[i], 1);
        TextDrawColor(LoginTextDraw[i], 0);
        TextDrawUseBox(LoginTextDraw[i], true);
        TextDrawBoxColor(LoginTextDraw[i], 180);
        TextDrawSetShadow(LoginTextDraw[i], 0);
        TextDrawSetOutline(LoginTextDraw[i], 0);
        TextDrawBackgroundColor(LoginTextDraw[i], -2139062017);
        TextDrawFont(LoginTextDraw[i], 0);

     // TextDrawShowForPlayer(i, LoginTextDraw2); // this goes under onplayerconnect
        LoginTextDraw2[i] = TextDrawCreate(86.875000, 347.666503, "Exclusive Gaming v3.0");
        TextDrawLetterSize(LoginTextDraw2[i], 0.926875, 3.513334);
        TextDrawAlignment(LoginTextDraw2[i], 1);
        TextDrawColor(LoginTextDraw2[i], 16777215);
        TextDrawSetShadow(LoginTextDraw2[i], 0);
        TextDrawSetOutline(LoginTextDraw2[i], 1);
        TextDrawBackgroundColor(LoginTextDraw2[i], 51);
        TextDrawFont(LoginTextDraw2[i], 2);
        TextDrawSetProportional(LoginTextDraw2[i], 1);
    }
under OnGameModeInit

pawn Код:
TextDrawShowForPlayer(playerid, LoginTextDraw[i]);
    TextDrawShowForPlayer(playerid, LoginTextDraw2[i]);
under OnPlayerConnect


EDIT: Sorry, I decided to change the variable names
Reply
#8

top of your gamemode

pawn Код:
new Text:LoginTextDraw[MAX_PLAYERS];
   new Text:LoginTextDraw2[MAX_PLAYERS];
under OnGameModeInit

pawn Код:
for(new i = 0; i < MAX_PLAYERS; i++)
    {
     // TextDrawShowForPlayer(i, LoginTextDraw); // this goes under onplayerconnect
        LoginTextDraw[i] = TextDrawCreate(660.125000, 459.416717, "usebox");
        TextDrawLetterSize(LoginTextDraw[i], 0.000000, -13.643054);
        TextDrawTextSize(LoginTextDraw[i], -3.875000, 0.000000);
        TextDrawAlignment(LoginTextDraw[i], 1);
        TextDrawColor(LoginTextDraw[i], 0);
        TextDrawUseBox(LoginTextDraw[i], true);
        TextDrawBoxColor(LoginTextDraw[i], 180);
        TextDrawSetShadow(LoginTextDraw[i], 0);
        TextDrawSetOutline(LoginTextDraw[i], 0);
        TextDrawBackgroundColor(LoginTextDraw[i], -2139062017);
        TextDrawFont(LoginTextDraw[i], 0);

     // TextDrawShowForPlayer(i, LoginTextDraw2); // this goes under onplayerconnect
        LoginTextDraw2[i] = TextDrawCreate(86.875000, 347.666503, "Exclusive Gaming v3.0");
        TextDrawLetterSize(LoginTextDraw2[i], 0.926875, 3.513334);
        TextDrawAlignment(LoginTextDraw2[i], 1);
        TextDrawColor(LoginTextDraw2[i], 16777215);
        TextDrawSetShadow(LoginTextDraw2[i], 0);
        TextDrawSetOutline(LoginTextDraw2[i], 1);
        TextDrawBackgroundColor(LoginTextDraw2[i], 51);
        TextDrawFont(LoginTextDraw2[i], 2);
        TextDrawSetProportional(LoginTextDraw2[i], 1);
    }
under OnPlayerConnect

pawn Код:
TextDrawShowForPlayer(playerid, LoginTextDraw[i]);
    TextDrawShowForPlayer(playerid, LoginTextDraw2[i]);
unde OnPlayerSpawn
pawn Код:
TextDrawHideForPlayer(playerid, LoginTextDraw[i]);
   TextDrawHideForPlayer(playerid, LoginTextDraw2[i]);

you should copilar perfect friend

TextDrawShowForPlayer about but that will not look here

https://sampwiki.blast.hk/wiki/TextDrawShowForPlayer
Reply
#9

Never ever ever do this!

pawn Код:
new Text:LoginTextDraw[MAX_PLAYERS];
new Text:LoginTextDraw2[MAX_PLAYERS];
Use player textdraws!

https://sampwiki.blast.hk/wiki/CreatePlayerTextDraw
Reply
#10

That's A Global Textdraw, isn't? Try to do player textdraws...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)