Textdraw problem
#1

Hi guys, I have a problem with a textdraw, a simple one, it doesn't show up even after I called it with TextDrawShowForPlayer everywhere, when I connect, it shows, but after I spawn it doesn't, I put TextDrawShowForPlayer at OnPlayerSpawn but no effects, then I tried to make a command to show it to see if it works (I use ZCMD) and when I spawned and typed the command the Textdraw appeared then disappeared very fast, help me, I need to fix this really quick..

Codes:

pawn Код:
new Text:FRICNRInfo[MAX_PLAYERS];
pawn Код:
for(new p = 0; p < MAX_PLAYERS; p++)
    {
        FRICNRInfo[p] = TextDrawCreate(18.000000, 428.000000, "Fri's CnR v1.0 - Forum: Not Yet!");
        TextDrawAlignment(FRICNRInfo[p], 0);
        TextDrawBackgroundColor(FRICNRInfo[p], 0x000000ff);
        TextDrawFont(FRICNRInfo[p], 2);
        TextDrawLetterSize(FRICNRInfo[p], 0.199999, 0.899999);
        TextDrawColor(FRICNRInfo[p], 0xffffffff);
        TextDrawSetOutline(FRICNRInfo[p], 1);
        TextDrawSetProportional(FRICNRInfo[p], 1);
        TextDrawSetShadow(FRICNRInfo[p], 1);

       
    }
pawn Код:
TextDrawShowForPlayer(playerid, FRICNRInfo[playerid]);
TextDrawSetString(FRICNRInfo[playerid], "Fri's CnR v1.0 - Forum: Not Yet!");
Reply
#2

Try this:
pawn Код:
new PlayerText:FRICNRInfo[MAX_PLAYERS];

public OnPlayerConnect(playerid)
{
    FRICNRInfo[playerid] =
    CreatePlayerTextDraw            (playerid, 18.000000, 428.000000, "Fri's CnR v1.0 - Forum: Not Yet!");
    PlayerTextDrawAlignment         (playerid, FRICNRInfo[playerid], 0);
    PlayerTextDrawBackgroundColor   (playerid, FRICNRInfo[playerid], 255);
    PlayerTextDrawFont              (playerid, FRICNRInfo[playerid], 2);
    PlayerTextDrawLetterSize        (playerid, FRICNRInfo[playerid], 0.199999, 0.899999);
    PlayerTextDrawColor             (playerid, FRICNRInfo[playerid], -1);
    PlayerTextDrawSetOutline        (playerid, FRICNRInfo[playerid], 1);
    PlayerTextDrawSetProportional   (playerid, FRICNRInfo[playerid], 1);
    PlayerTextDrawSetShadow         (playerid, FRICNRInfo[playerid], 1);
    PlayerTextDrawShow              (playerid, FRICNRInfo[playerid]);
}
Reply
#3

It's the only textdraw on the gamemode, the rest of them are called by GameTextForPlayer..


EDIT: I'll try the code you written and come back with an edit.

EDIT: RedFusion i get these warnings:
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(3677) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(367 : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(542 : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(5429) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(5585) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(5920) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(5927) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(6363) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(6364) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


9 Warnings.

How shall i arrange the code provided by you?
Reply
#4

Replace
pawn Код:
new FRICNRInfo[MAX_PLAYERS];
with
pawn Код:
new PlayerText:FRICNRInfo[MAX_PLAYERS];
Put the rest of the code within OnPlayerConnect as shown in my previous post
Reply
#5

I put
pawn Код:
for(new p = 0; p < MAX_PLAYERS; p++)
    {
        FRICNRInfo[p] = TextDrawCreate(18.000000, 428.000000, "Fri's CnR v1.0 - Forum: Not Yet!");
        TextDrawAlignment(FRICNRInfo[p], 0);
        TextDrawBackgroundColor(FRICNRInfo[p], 0x000000ff);
        TextDrawFont(FRICNRInfo[p], 2);
        TextDrawLetterSize(FRICNRInfo[p], 0.199999, 0.899999);
        TextDrawColor(FRICNRInfo[p], 0xffffffff);
        TextDrawSetOutline(FRICNRInfo[p], 1);
        TextDrawSetProportional(FRICNRInfo[p], 1);
        TextDrawSetShadow(FRICNRInfo[p], 1);


    }
Under OnPlayerConnect, now I get these errors/warnings:
Код:
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(3677) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(3678) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(5428) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(5429) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(5585) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(5920) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(5927) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(6199) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(6200) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(6201) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(6202) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(6203) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(6204) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(6205) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(6206) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(6207) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(6366) : warning 213: tag mismatch
C:\Users\Cretu\Downloads\GTA SA\Server Fri CnR\gamemodes\FriCNR.pwn(6367) : warning 213: tag mismatch
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


18 Warnings.
is it because I moved it under onplayerconnect?

EDIT: I compiled the script with those warnings and still the same problem, only shows the textdraw when i connect, but after spawning it dissappears...Please i need to fix this ..
Reply
#6

EDIT: Never mind, fixed it. Thanks to [HLF]Southclaw and RedFusion!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)