SA-MP Forums Archive
Textdraw doesn't show. - 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: Textdraw doesn't show. (/showthread.php?tid=476497)



Textdraw doesn't show. - Kyance - 18.11.2013

So, i have a textdraw "Battlefield 1.3b", but i guess that due it, a diff. textdraw doesn't "work".
Codes:

pawn Код:
new Text:ServerName;
new Text:Team1;
new Text:Team2;
pawn Код:
ServerName = TextDrawCreate(510.000000, 12.500000, "..::~r~Battlefield ~w~v1.3b::..");//485, 10 is the original thing
    TextDrawBackgroundColor(ServerName, 255);
    TextDrawFont(ServerName, 1);
    TextDrawLetterSize(ServerName, 0.330000, 1.200000);
    TextDrawColor(ServerName, -1);
    TextDrawSetOutline(ServerName, 1);
    TextDrawSetProportional(ServerName, 1);
    TextDrawSetShadow(ServerName,1);
   
    Team1 = TextDrawCreate(17 ,458 , "US Marine");
    TextDrawFont(Team1 , 2);
    TextDrawLetterSize(Team1 , 0.7, 4.8999999999999995);
    TextDrawColor(Team1 , 0x5083cfFF);
    TextDrawSetOutline(Team1 , false);
    TextDrawSetProportional(Team1 , true);
    TextDrawSetShadow(Team1 , 1);
   
    Team2 = TextDrawCreate(22 ,457 , "Russian Spetsnaz");
    TextDrawFont(Team2 , 2);
    TextDrawLetterSize(Team2 , 0.7, 4.8999999999999995);
    TextDrawColor(Team2 , 0xad2d2dFF);
    TextDrawSetOutline(Team2 , false);
    TextDrawSetProportional(Team2 , true);
    TextDrawSetShadow(Team2 , 1);
ONPLAYERSPAWN CODE

pawn Код:
if(GetPlayerTeam(playerid) == USA_Army)
    {
        SetPlayerColor(playerid, USA_Army_COLOUR);
        SetPlayerRandomUSASpawn(playerid);
        SetPlayerHealth(playerid, 99);
        SetPlayerArmour(playerid, 50);
        GivePlayerWeapon(playerid, 16, 5);
        GivePlayerWeapon(playerid, 24, 247);
        GivePlayerWeapon(playerid, 29, 500);
        GivePlayerWeapon(playerid, 31, 500);
        SetPlayerSkin(playerid, 287);
        TextDrawShowForPlayer(playerid, Text:Team1); //Should show US Marine textdraw
        TextDrawHideForPlayer(playerid, Text:Team2); //should hide Russian Spetsnaz textdraw
    }
    else if(GetPlayerTeam(playerid) == Russian_Spetsnaz)
    {
        SetPlayerColor(playerid, Russian_Spetsnaz_COLOUR);
        SetPlayerSkin(playerid, 112);
        SetPlayerHealth(playerid, 75);
        SetPlayerArmour(playerid, 70);
        GivePlayerWeapon(playerid, 16, 3);
        GivePlayerWeapon(playerid, 24, 247);
        GivePlayerWeapon(playerid, 29, 500);
        GivePlayerWeapon(playerid, 30, 500);
        TextDrawShowForPlayer(playerid, Text:Team2); //Should show Russian Spetsnaz textdraw
        TextDrawHideForPlayer(playerid, Text:Team1); //Hides US Marine textdraw
    }
    //GangzoneStuff
    TextDrawShowForPlayer(playerid, Text:ServerName);
    return 1;
}
So, basically, the Team-Textdraw doesn't show, but whe servername textdraw shows..


Respuesta: Textdraw doesn't show. - adri1 - 18.11.2013

Change
pawn Код:
TextDrawShowForPlayer(playerid, Text:Team1);
TextDrawShowForPlayer(playerid, Text:Team2);
to
pawn Код:
TextDrawShowForPlayer(playerid, Team1);
TextDrawShowForPlayer(playerid, Team2);

and
TextDrawShowForPlayer(playerid, Text:ServerName);
to TextDrawShowForPlayer(playerid, ServerName);


Re: Textdraw doesn't show. - Kirollos - 18.11.2013

seems like the if checks doesn't return true for some reason, are you sure you used SetPlayerTeam before OnPlayerSpawn gets called?


Re: Textdraw doesn't show. - Kyance - 18.11.2013

Quote:
Originally Posted by adri1
Посмотреть сообщение
Change
pawn Код:
TextDrawShowForPlayer(playerid, Text:Team1);
TextDrawShowForPlayer(playerid, Text:Team2);
to
pawn Код:
TextDrawShowForPlayer(playerid, Team1);
TextDrawShowForPlayer(playerid, Team2);

and
TextDrawShowForPlayer(playerid, Text:ServerName);
to TextDrawShowForPlayer(playerid, ServerName);
Didn't help.


Quote:
Originally Posted by kirollos
Посмотреть сообщение
seems like the if checks doesn't return true for some reason, are you sure you used SetPlayerTeam before OnPlayerSpawn gets called?
pawn Код:
public OnPlayerRequestClass(playerid, classid) {
    SetPlayerPos(playerid, 268.5824,1884.6180,-30.0938);
    SetPlayerCameraPos(playerid, 268.4520,1886.7498,-29.5313);
    SetPlayerCameraLookAt(playerid, 268.5824,1884.6180,-30.0938);
    switch(classid)
    {
        case 0:
        {
            SetPlayerTeam(playerid, USA_Army);
            SetPlayerSkin(playerid, 287);
            GameTextForPlayer(playerid, "~b~USA Army", 20, 0);
        }
        case 1:
        {
            SetPlayerTeam(playerid, Russian_Spetsnaz);
            SetPlayerSkin(playerid, 112);
            GameTextForPlayer(playerid, "~r~Russian Spetsnaz", 20, 0);
            }
        }
    return 1;
}
Yeah.. this is before OnPlayerSpawn..
Btw, the "GameTextForPlayer" is @ 20 cause it some-how doesn't want to automatically change(It stays there for 5+ seconds)(Even if i change it to 1, it would stay there for the 5+ seconds xd)


Re: Textdraw doesn't show. - Kyance - 19.11.2013

bump D:


Re: Textdraw doesn't show. - Kyance - 21.11.2013

/bump :[
EDIT: Tried "playing" with the fonts, still didn't work.