SA-MP Forums Archive
Textdraws help - MASTERS ONLY. - 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: Textdraws help - MASTERS ONLY. (/showthread.php?tid=502043)



Textdraws help - MASTERS ONLY. - Equuuuin0X - 21.03.2014

So, I've tried to make textdraws, I've put it on OnPlayerSpawn and OnGameModeInIt.

And I also did TextDrawShowForPlayer aswell on both publics.

but in-game, it doesnt shows anything, in the previous attempts, my stats textdraws were working properly, any help ?

pawn Код:
ForumURL = TextDrawCreate(800.000000, 131.000000, "<< COD TDM >>");
    TextDrawBackgroundColor(ForumURL, 255);
    TextDrawFont(ForumURL, 2);
    TextDrawLetterSize(ForumURL, 0.280000, 1.399999);
    TextDrawColor(ForumURL, 3394815);
    TextDrawSetOutline(ForumURL, 1);
    TextDrawSetProportional(ForumURL, 1);
   
    CODTDM = TextDrawCreate(800.000000, 313.000000, "/stats /cmds /ghelp");
    TextDrawBackgroundColor(CODTDM, 255);
    TextDrawFont(CODTDM, 2);
    TextDrawLetterSize(CODTDM, 0.280000, 1.399999);
    TextDrawColor(CODTDM, 3394815);
    TextDrawSetOutline(CODTDM, 1);
    TextDrawSetProportional(CODTDM, 1);



Re: Textdraws help - MASTERS ONLY. - Flake. - 22.03.2014

pawn Код:
public OnGameModeInit()
{
    ForumURL = TextDrawCreate(800.000000, 131.000000, "<< COD TDM >>");
    TextDrawBackgroundColor(ForumURL, 255);
    TextDrawFont(ForumURL, 2);
    TextDrawLetterSize(ForumURL, 0.280000, 1.399999);
    TextDrawColor(ForumURL, 3394815);
    TextDrawSetOutline(ForumURL, 1);
    TextDrawSetProportional(ForumURL, 1);

    CODTDM = TextDrawCreate(800.000000, 313.000000, "/stats /cmds /ghelp");
    TextDrawBackgroundColor(CODTDM, 255);
    TextDrawFont(CODTDM, 2);
    TextDrawLetterSize(CODTDM, 0.280000, 1.399999);
    TextDrawColor(CODTDM, 3394815);
    TextDrawSetOutline(CODTDM, 1);
    TextDrawSetProportional(CODTDM, 1);
    return 1;
}

public OnPlayerSpawn(playerid)
{
    TextDrawShowForPlayer(playerid, ForumURL);
    TextDrawShowForPlayer(playerid, CODTDM);
}
This should work, if now check your positioning of the actual letters, make sure they're on the screen..


Re: Textdraws help - MASTERS ONLY. - Equuuuin0X - 22.03.2014

the new should be like this, rite ?

pawn Код:
new Text:CODTDM;
new Text:ForumURL;



Re: Textdraws help - MASTERS ONLY. - Flake. - 22.03.2014

Quote:
Originally Posted by Equuuuin0X
Посмотреть сообщение
the new should be like this, rite ?

pawn Код:
new Text:CODTDM;
new Text:ForumURL;
That would work just fine, yes


Re: Textdraws help - MASTERS ONLY. - Pottus - 22.03.2014

TextDrawCreate(800.000000, 131.000000

800.0 is off the screen dude.


Re: Textdraws help - MASTERS ONLY. - Equuuuin0X - 22.03.2014

lol. tell me the right coordinates pls.

I want it to be at the right bottom,and below the money screen.


Re: Textdraws help - MASTERS ONLY. - Hanuman - 22.03.2014

decrease the 800 value. Keep the value less 550


Re: Textdraws help - MASTERS ONLY. - Equuuuin0X - 22.03.2014

I need the specific coordinates please, as stated above post.


Re: Textdraws help - MASTERS ONLY. - AceFlyer - 22.03.2014

Try using one of the various text draw editors they will help you position the textdraw in the place where you want it and also generate the code for you .

https://sampforum.blast.hk/showthread.php?tid=376758

https://sampforum.blast.hk/showthread.php?tid=442095


Re: Textdraws help - MASTERS ONLY. - Equuuuin0X - 22.03.2014

I've tried like this.

pawn Код:
public OnPlayerSpawn(playerid)
{




TextDrawShowForPlayer(playerid, textdraw);
TextDrawShowForPlayer(playerid, TEAMS_TD);
TextDrawShowForPlayer(playerid, RANKS_TD);
TextDrawShowForPlayer(playerid, KILLS_TD);
TextDrawShowForPlayer(playerid, DEATHS_TD);
TextDrawHideForPlayer(playerid, CountText[playerid]);
TextDrawHideForPlayer(playerid, Welcome);
TextDrawHideForPlayer(playerid, register1);
TextDrawHideForPlayer(playerid, CountText[playerid]);
TextDrawShowForPlayer(playerid, RANK[playerid]);
TextDrawShowForPlayer(playerid, TEAM[playerid]);
TextDrawShowForPlayer(playerid, KILLS[playerid]);
TextDrawShowForPlayer(playerid, DEATHS[playerid]);
TextDrawShowForPlayer(playerid, ForumURL);
TextDrawShowForPlayer(playerid, CODTDM);
   
if(FirstSpawn[playerid] == 1)
    {
    SendClientMessage(playerid, -1,"Please select your class");
    FirstSpawn[playerid] = 0;
    SelectTextDraw(playerid, 0xFFFFFFFF);
    TextDrawShowForPlayer(playerid, Textdraw0);
    TextDrawShowForPlayer(playerid, Textdraw1);
    TextDrawShowForPlayer(playerid, Textdraw2);
    TextDrawShowForPlayer(playerid, Textdraw3);
    TextDrawShowForPlayer(playerid, Textdraw4);
    TextDrawShowForPlayer(playerid, Textdraw5);
    TextDrawShowForPlayer(playerid, Textdraw6);
    TextDrawShowForPlayer(playerid, Textdraw7);
    TextDrawShowForPlayer(playerid, Textdraw8);
    TextDrawShowForPlayer(playerid, Textdraw9);
    TextDrawShowForPlayer(playerid, Textdraw10);
    TextDrawShowForPlayer(playerid, Textdraw11);
    TextDrawShowForPlayer(playerid, Textdraw12);
    TextDrawShowForPlayer(playerid, Textdraw13);
    TextDrawShowForPlayer(playerid, Textdraw14);
    TextDrawShowForPlayer(playerid, Textdraw15);

    }
   
GivePlayerWeapons(playerid);
   
if(gClass[playerid] == SNIPER)
    {
    SetPlayerColor(playerid, 0x15FF0000);
    }

   

   

    SetPlayerMapIcon(playerid, 10, 407.3594,2454.5784,16.5000, 19,2,MAPICON_LOCAL); //Desert Airport
    SetPlayerMapIcon(playerid, 9,  -311.0136,1542.9733,75.5625, 19,2,MAPICON_LOCAL); //Big Ear
    SetPlayerMapIcon(playerid, 0,  -36.5458, 2347.6426, 24.1406, 19,2,MAPICON_LOCAL); //Snakes farm
    SetPlayerMapIcon(playerid, 1,  260.0900,2889.5242,11.1854, 19,2,MAPICON_LOCAL); //Bay side
    SetPlayerMapIcon(playerid, 3,  -551.6992,2593.0771,53.9348, 19,2,MAPICON_LOCAL); //Army hotel
    SetPlayerMapIcon(playerid, 4,  670.9215,1705.4658,7.1875, 19,2,MAPICON_LOCAL); //Army petrol bunk
    SetPlayerMapIcon(playerid, 7,  588.3246,875.7402,-42.4973, 19,2,MAPICON_LOCAL); //Quarry
    SetPlayerMapIcon(playerid, 8,  -314.8433,1773.9176,43.6406, 19,2,MAPICON_LOCAL); //Desert Guest house

   




if(pInfo[playerid][Registered] == 1 && pInfo[playerid][Logged] == 0)
{
ShowPlayerDialog(playerid, JDIALOGS+45, DIALOG_STYLE_MSGBOX,"     {FB0404}Kicked", "You have been kicked | Reason: \"You must be logged before spawn\"", "Ok", "");
SetTimerEx("KickPlayer",100,false,"d", playerid);
return 0;
}
   
if(GetPVarInt(playerid,"Useskin") == 1)
{
SetPlayerSkin(playerid, pInfo[playerid][Skin]);
}






if(gTeam[playerid] == T_SPAIN)
{
new rand = random(sizeof(T_SPAIN_SPAWN));
SetPlayerPos(playerid, T_SPAIN_SPAWN[rand][0], T_SPAIN_SPAWN[rand][1], T_SPAIN_SPAWN[rand][2]);
}
if(gTeam[playerid] == T_GERMANY)
{
new rand = random(sizeof(T_GERMANY_SPAWN));
SetPlayerPos(playerid, T_GERMANY_SPAWN[rand][0], T_GERMANY_SPAWN[rand][1], T_GERMANY_SPAWN[rand][2]);
}
    if(gTeam[playerid] == T_ENGLAND)
    {
       new rand = random(sizeof(T_ENGLAND_SPAWN));
       SetPlayerPos(playerid, T_ENGLAND_SPAWN[rand][0], T_ENGLAND_SPAWN[rand][1], T_ENGLAND_SPAWN[rand][2]);
    }
    if(gTeam[playerid] == T_UAE)
    {
       new rand = random(sizeof(T_UAE_SPAWN));
       SetPlayerPos(playerid, T_UAE_SPAWN[rand][0], T_UAE_SPAWN[rand][1], T_UAE_SPAWN[rand][2]);
    }


    if(GetPlayerScore(playerid) >= 0 && GetPlayerScore(playerid) <= 299)
    {
      SetPlayerWantedLevel(playerid, 0);
    }
    if(GetPlayerScore(playerid) >= 300 && GetPlayerScore(playerid) <= 749)
    {
      SetPlayerWantedLevel(playerid, 1);
    }
    if(GetPlayerScore(playerid) >= 750 && GetPlayerScore(playerid) <= 1499)
    {
      SetPlayerWantedLevel(playerid, 2);
    }
    if(GetPlayerScore(playerid) >= 1500 && GetPlayerScore(playerid) <= 2999)
    {
      SetPlayerWantedLevel(playerid, 3);
    }
    if(GetPlayerScore(playerid) >= 3000 && GetPlayerScore(playerid) <= 4999)
    {
      SetPlayerWantedLevel(playerid, 4);
    }
    if(GetPlayerScore(playerid) >= 5000 && GetPlayerScore(playerid) <= 9999)
    {
      SetPlayerWantedLevel(playerid, 5);
    }
    if(GetPlayerScore(playerid) >= 10000 && GetPlayerScore(playerid) <= 50000)
    {
      SetPlayerWantedLevel(playerid, 6);
    }

//tEAM bASES
    GangZoneShowForAll(T_SPAIN_BASE, T_SPAIN_Z_C);
    GangZoneShowForAll(T_GERMANY_BASE, T_GERMANY_Z_C);
    GangZoneShowForAll(T_ENGLAND_BASE, T_ENGLAND_Z_C);
    GangZoneShowForAll(T_UAE_BASE, T_UAE_Z_C);


   
    SetPlayerVirtualWorld(playerid, 0);
    SetPlayerInterior(playerid, 0);
    SendClientMessage(playerid, -1, "You are being processed, please wait!");
    SetTimerEx("SpawnProtection", 10000, false, "i", playerid);
    SendClientMessage(playerid, RED, "Anti-Spawn kill protection");
    SetTimerEx("SpawnProtection1", 3000, false, "i", playerid);
    TogglePlayerControllable(playerid, false);
    SetPlayerHealth(playerid, 99999);




       
    UpdateLabelText(playerid);
    UpdateStatsTextdraw(playerid);
    pInfo[playerid][Spawned]    = 1;
   

            TextDrawHideForPlayer(playerid, SPAIN_TD);
            TextDrawHideForPlayer(playerid, GERMANY_TD);
            TextDrawHideForPlayer(playerid, ENGLAND_TD);
            TextDrawHideForPlayer(playerid, UAE_TD);
            TextDrawShowForPlayer(playerid, ForumURL);
            TextDrawShowForPlayer(playerid, CODTDM);
           
    ForumURL = TextDrawCreate(800.000000, 131.000000, "<< COD TDM >>");
    TextDrawBackgroundColor(ForumURL, 255);
    TextDrawFont(ForumURL, 2);
    TextDrawLetterSize(ForumURL, 0.280000, 1.399999);
    TextDrawColor(ForumURL, 3394815);
    TextDrawSetOutline(ForumURL, 1);
    TextDrawSetProportional(ForumURL, 1);

    CODTDM = TextDrawCreate(800.000000, 313.000000, "/stats /cmds /ghelp");
    TextDrawBackgroundColor(CODTDM, 255);
    TextDrawFont(CODTDM, 2);
    TextDrawLetterSize(CODTDM, 0.280000, 1.399999);
    TextDrawColor(CODTDM, 3394815);
    TextDrawSetOutline(CODTDM, 1);
    TextDrawSetProportional(CODTDM, 1);


       
    return 1;
}
It appears when connecting, dissapears after selecting classes.