Changing the line of a text in a textdraw?
#1

Hey everybody!

I've got the following under "OnGameModeInit":

pawn Код:
Groveweapons = TextDrawCreate(10.0, 10.0, "Weapon1/nWeapon2/nWeapon3");
These symbols ( /n ) should return to a new line, but they want, they're all in the same line! Which function I gotta use for returning a word to a new line? Just like in "GameTextForPlayer"....
Reply
#2

What the hell...? LOL!

Well, I suggest to go into the section of your own language, I can't speak Spanish, and I don't wanna know anything about 3D-Labels! -_-

I've got another question now, since I found out the new line problem:

I have the following skins under "OnPlayerRequestClass":

pawn Код:
switch(classid) {
   case 0..2: {
                SetPlayerTeamFromClass(playerid, classid);
                SetPlayerPos(playerid, 1992.1263,-1175.7640,20.1479);
                SetPlayerFacingAngle( playerid, 187.0574 );
                SetPlayerCameraPos(playerid, 1991.3074,-1179.9628,20.0234);
                SetPlayerCameraLookAt(playerid, 1992.1263,-1175.7640,20.1479);
                GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~p~Ballas", 3000, 3);
                TextDrawShowForPlayer(playerid, Ballasweapons1);

                //ApplyAnimation(playerid,"SMOKING", "M_smk_tap",4.0,1,1,1,1,1);
            } case 3..7: {
                SetPlayerPos(playerid, 2486.7598,-1647.5186,14.0703);
                SetPlayerFacingAngle( playerid, 187.5500 );
                SetPlayerCameraPos(playerid, 2486.4346,-1646.0953-5,14.0703);
                SetPlayerCameraLookAt(playerid, 2486.7598,-1647.5186,14.0703);
                GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~Grove Street Families", 3000, 3);
                ApplyAnimation(playerid,"RAPPING", "RAP_A_OUT ",4.0,1,1,1,1,1);
            } case 8..10: {
                SetPlayerPos(playerid, 2571.8352,-1091.2091,66.9639);
                SetPlayerFacingAngle(playerid, 48.7203 );
                SetPlayerCameraPos(playerid, 2570.1152,-1089.5372,66.8601);
                SetPlayerCameraLookAt(playerid, 2571.8352,-1091.2091,66.9639);
                GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Los Santos Vagos", 3000, 3);
                //ApplyAnimation(playerid, "SMOKING", "F_smklean_loop", 4.1, 0, 1, 1, 1, 0, 1);
            } case 11 .. 14: {
                SetPlayerPos(playerid, 1793.2360,-2122.8770,13.5469);
                SetPlayerFacingAngle(playerid, 8.3180 );
                SetPlayerCameraPos(playerid, 1793.3226,-2119.6809,13.5543);
                SetPlayerCameraLookAt(playerid, 1793.2360,-2122.8770,13.5469);
                GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~b~~h~~h~~h~Los Varrios Aztecas", 3000, 3);
            } case 15 .. 23: {
                SetPlayerPos(playerid, 1546.7958,-1674.9213,13.5630);
                SetPlayerFacingAngle(playerid, 80.8152 );
                SetPlayerCameraPos(playerid, 1543.1853,-1675.1349,13.5560);
                SetPlayerCameraLookAt(playerid, 1546.7958,-1674.9213,13.5630);
                GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~b~~b~Police & Regime", 3000, 3);
            } /*case 24 ..26: {
                SetPlayerPos(playerid, 1515.7484,-2232.6597,13.5469);
                SetPlayerFacingAngle(playerid, 324.6881 );
                SetPlayerCameraPos(playerid, 1518.3016,-2228.4558,13.5469);
                SetPlayerCameraLookAt(playerid, 1515.7484,-2232.6597,13.5469);
                GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~~w~San Fierro Rifas", 3000, 3);
            }*/
case 24 .. 28: {
           

                SetPlayerPos(playerid, 1220.1063,-1410.3185,13.1395);
                SetPlayerFacingAngle(playerid, 354.7488);
                SetPlayerCameraPos(playerid, 1220.2598,-1407.5026,13.1717);
                SetPlayerCameraLookAt(playerid, 1220.1063,-1410.3185,13.1395);
                GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~h~~h~~p~Loco ~g~Syndicato", 3000, 3);
                gTeam[playerid] = LOCO;
            } case 29 .. 31: { //here starts the dealer-team
                SetPlayerPos(playerid, 2782.0300,-2008.1980,13.5547);
                SetPlayerFacingAngle(playerid, 359.7808);
                SetPlayerCameraPos(playerid, 2782.5583,-2004.1533,13.5471);
                SetPlayerCameraLookAt(playerid, 2782.0300,-2008.1980,13.5547);
                GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~~y~Dealers", 3000, 3);
            }
        }
        return 1;
    }
I want to display the weapons for each case (each skin) with a textdraw, and I know how to do this! BUT, it will show the same textdraw for ANY case! So what do I have to do? Do I have to write each case once? (case 0, case 1, case 2, etc...)?
Reply
#3

Perhaps the textdraws aren't going away because you are not using TextDrawHideForPlayer. I know what you're trying to do, but I think you need to do it another way for this to work.
Reply
#4

Like this?

pawn Код:
case 0: //bla
case 1: //weapons
case 2: //weapons
Reply
#5

Try this;
pawn Код:
Groveweapons = TextDrawCreate(10.0, 10.0, "Weapon1~n~Weapon2~n~Weapon3");
OT:
I'm already working on that we are discussing.
Reply
#6

Lol, I already said that it's fixed, I'm asking for another thing! Look at my second post, with the cases! Each case is one skin! Each skin has different weapons! Do I need to write any case once now?
Reply
#7

I really can't seem to understand what the problem is. However, first you should is, create a textdraw in a variable on OnGameModeInit. In each case, set the string to a different string.
Reply
#8

try this, I havn't tested it at all, but see what I did to ballas? if that works then continue with the rest of the classes. You might not need to do the "switch" again.

PHP код:
switch(classid) {
   case 
0..2: {
                
SetPlayerTeamFromClass(playeridclassid);
                
SetPlayerPos(playerid1992.1263,-1175.7640,20.1479);
                
SetPlayerFacingAngleplayerid187.0574 );
                
SetPlayerCameraPos(playerid1991.3074,-1179.9628,20.0234);
                
SetPlayerCameraLookAt(playerid1992.1263,-1175.7640,20.1479);
                
GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~n~~n~~p~Ballas"30003);
                switch(
classid){
                case 
0:
                {
                    
TextDrawShowForPlayer(playeridBallasweapons1);
                }
                case 
1:
                {
                    
TextDrawHideForPlayer(playeridBallasweapons1);
                    
TextDrawShowForPlayer(playeridBallasweapons2);
                }
                
//ApplyAnimation(playerid,"SMOKING", "M_smk_tap",4.0,1,1,1,1,1);
            
} case 3..7: {
                
SetPlayerPos(playerid2486.7598,-1647.5186,14.0703);
                
SetPlayerFacingAngleplayerid187.5500 );
                
SetPlayerCameraPos(playerid2486.4346,-1646.0953-5,14.0703);
                
SetPlayerCameraLookAt(playerid2486.7598,-1647.5186,14.0703);
                
GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~n~~n~~g~Grove Street Families"30003);
                
ApplyAnimation(playerid,"RAPPING""RAP_A_OUT ",4.0,1,1,1,1,1);
            } case 
8..10: {
                
SetPlayerPos(playerid2571.8352,-1091.2091,66.9639);
                
SetPlayerFacingAngle(playerid48.7203 );
                
SetPlayerCameraPos(playerid2570.1152,-1089.5372,66.8601);
                
SetPlayerCameraLookAt(playerid2571.8352,-1091.2091,66.9639);
                
GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~Los Santos Vagos"30003);
                
//ApplyAnimation(playerid, "SMOKING", "F_smklean_loop", 4.1, 0, 1, 1, 1, 0, 1);
            
} case 11 .. 14: {
                
SetPlayerPos(playerid1793.2360,-2122.8770,13.5469);
                
SetPlayerFacingAngle(playerid8.3180 );
                
SetPlayerCameraPos(playerid1793.3226,-2119.6809,13.5543);
                
SetPlayerCameraLookAt(playerid1793.2360,-2122.8770,13.5469);
                
GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~n~~n~~b~~h~~h~~h~Los Varrios Aztecas"30003);
            } case 
15 .. 23: {
                
SetPlayerPos(playerid1546.7958,-1674.9213,13.5630);
                
SetPlayerFacingAngle(playerid80.8152 );
                
SetPlayerCameraPos(playerid1543.1853,-1675.1349,13.5560);
                
SetPlayerCameraLookAt(playerid1546.7958,-1674.9213,13.5630);
                
GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~n~~n~~b~~b~Police & Regime"30003);
            } 
/*case 24 ..26: {
                SetPlayerPos(playerid, 1515.7484,-2232.6597,13.5469);
                SetPlayerFacingAngle(playerid, 324.6881 );
                SetPlayerCameraPos(playerid, 1518.3016,-2228.4558,13.5469);
                SetPlayerCameraLookAt(playerid, 1515.7484,-2232.6597,13.5469);
                GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~w~~w~San Fierro Rifas", 3000, 3);
            }*/ 
case 24 .. 28: {
                
SetPlayerPos(playerid1220.1063,-1410.3185,13.1395);
                
SetPlayerFacingAngle(playerid354.7488);
                
SetPlayerCameraPos(playerid1220.2598,-1407.5026,13.1717);
                
SetPlayerCameraLookAt(playerid1220.1063,-1410.3185,13.1395);
                
GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~n~~n~~h~~h~~p~Loco ~g~Syndicato"30003);
                
gTeam[playerid] = LOCO;
            } case 
29 .. 31: { //here starts the dealer-team
                
SetPlayerPos(playerid2782.0300,-2008.1980,13.5547);
                
SetPlayerFacingAngle(playerid359.7808);
                
SetPlayerCameraPos(playerid2782.5583,-2004.1533,13.5471);
                
SetPlayerCameraLookAt(playerid2782.0300,-2008.1980,13.5547);
                
GameTextForPlayer(playerid"~n~~n~~n~~n~~n~~n~~n~~n~~n~~y~~y~Dealers"30003);
            }
        }
        return 
1;
    } 
Reply
#9

@new

Yeah, thanks, I just wanted to know that, the rest I know by myself! Thanks!

But, now I got two little problems. I have the following under "OnGameModeInit":

pawn Код:
Ballasweapons1 = TextDrawCreate(140.0, 260.0, "Desert Eagle~n~Sniper~n~Spas");
        TextDrawUseBox(Ballasweapons1, 1);
        TextDrawBoxColor(Ballasweapons1, TEAM_LOCO_COLOR);
        TextDrawFont(Ballasweapons1, 3);
        TextDrawTextSize(Ballasweapons1, 50.0, 100.0);
        TextDrawAlignment(Ballasweapons1, 1);
Now look at the picture! The text usually has to be IN the box, but it isn't!
And also, the word "Desert Eagle" has to be in ONE line! What am I doing wrong?
Reply
#10

pawn Код:
Ballasweapons1 = TextDrawCreate(140.0, 260.0, "Desert Eagle~n~Sniper~n~Spas");
TextDrawUseBox(Ballasweapons1, 1);
TextDrawBoxColor(Ballasweapons1, TEAM_LOCO_COLOR);
TextDrawFont(Ballasweapons1, 3);
TextDrawTextSize(Ballasweapons1, 50.0, 100.0);
TextDrawAlignment(Ballasweapons1, 2);
Maybe try that. I'm not good when it comes to textdraw.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)