Problems
#1

I have multiple problem, first is that when i /ann (text) it dont show up, it did before but i added a textdraw, after that i cant see it (they dont have the same name)

second, i have textdrawdestroy on ongamemodeexit, but when i /rcon gmx it dont destroy it..
Reply
#2

~~~~~~~~
Reply
#3

Put this in OnGameModeInit:
pawn Код:
public AnnText()
{
    ann = TextDrawCreate(314.000000, 198.000000, " ");
    TextDrawAlignment(ann, 2);
    TextDrawBackgroundColor(ann, 255);
    TextDrawFont(ann, 3);
    TextDrawLetterSize(ann, 1.1, 2.400003);
    TextDrawColor(ann, -1);
    TextDrawSetOutline(ann, 1);
    TextDrawSetProportional(ann, 1);
}
pawn Код:
CMD:announce(playerid, params[])
{
    new string[150];
    format(string, sizeof string, "~w~%s", text);
    TextDrawSetString(ann, string);
    TextDrawShowForAll(ann);
    annTextOnScreen = true;
    return 1;
}
Then, instead of using TextDrawDestroy to hide the announcement from players, use TextDrawHideForAll.
Reply
#4

But this i got too, how i do with this? (player ann)

pawn Код:
public pAnnText(playerid)
{
    pann[playerid] = TextDrawCreate(314.000000, 198.000000, " ");
    TextDrawAlignment(pann[playerid], 2);
    TextDrawBackgroundColor(pann[playerid], 255);
    TextDrawFont(pann[playerid], 3);
    TextDrawLetterSize(pann[playerid], 1.1, 2.400003);
    TextDrawColor(pann[playerid], -1);
    TextDrawSetOutline(pann[playerid], 1);
    TextDrawSetProportional(pann[playerid], 1);
}
Reply
#5

Just use TextDrawShowForPlayer instead of TextDrawShowForAll when doing a pAnn.
Reply
#6

Yeah but there is (playerid) and on gamemodeinit i get alot of error
Reply
#7

Remove this whole thing:
pawn Код:
public pAnnText(playerid)
{
    pann[playerid] = TextDrawCreate(314.000000, 198.000000, " ");
    TextDrawAlignment(pann[playerid], 2);
    TextDrawBackgroundColor(pann[playerid], 255);
    TextDrawFont(pann[playerid], 3);
    TextDrawLetterSize(pann[playerid], 1.1, 2.400003);
    TextDrawColor(pann[playerid], -1);
    TextDrawSetOutline(pann[playerid], 1);
    TextDrawSetProportional(pann[playerid], 1);
}
Example:
pawn Код:
CMD:announce(playerid, params[])
{
    new string[150];
    format(string, sizeof string, "~w~%s", params);
    TextDrawSetString(ann, string);
    TextDrawShowForAll(ann);
    annTextOnScreen = true;
    return 1;
}

CMD:pann(playerid, params[])
{
    new id, text[120];
    if(sscanf(params, "is[120]", id, text)) return SendClientMessage(playerid, -1, "USAGE: /pann [id] [message]");
    new string[150];
    format(string, sizeof string, "~w~%s", text);
    TextDrawSetString(ann, string);
    TextDrawShowForPlayer(id, ann);
    annTextOnScreen = true;
    return 1;
}
Reply
#8

So no need to create it like two times?

pawn Код:
public AnnText()
{
    ann = TextDrawCreate(314.000000, 198.000000, " ");
    TextDrawAlignment(ann, 2);
    TextDrawBackgroundColor(ann, 255);
    TextDrawFont(ann, 3);
    TextDrawLetterSize(ann, 1.1, 2.400003);
    TextDrawColor(ann, -1);
    TextDrawSetOutline(ann, 1);
    TextDrawSetProportional(ann, 1);
}

public pAnnText(playerid)
{
    pann[playerid] = TextDrawCreate(314.000000, 198.000000, " ");
    TextDrawAlignment(pann[playerid], 2);
    TextDrawBackgroundColor(pann[playerid], 255);
    TextDrawFont(pann[playerid], 3);
    TextDrawLetterSize(pann[playerid], 1.1, 2.400003);
    TextDrawColor(pann[playerid], -1);
    TextDrawSetOutline(pann[playerid], 1);
    TextDrawSetProportional(pann[playerid], 1);
}
Reply
#9

Quote:
Originally Posted by BenzoAMG
Посмотреть сообщение
Remove this whole thing:
pawn Код:
public pAnnText(playerid)
{
    pann[playerid] = TextDrawCreate(314.000000, 198.000000, " ");
    TextDrawAlignment(pann[playerid], 2);
    TextDrawBackgroundColor(pann[playerid], 255);
    TextDrawFont(pann[playerid], 3);
    TextDrawLetterSize(pann[playerid], 1.1, 2.400003);
    TextDrawColor(pann[playerid], -1);
    TextDrawSetOutline(pann[playerid], 1);
    TextDrawSetProportional(pann[playerid], 1);
}
Example:
pawn Код:
CMD:announce(playerid, params[])
{
    new string[150];
    format(string, sizeof string, "~w~%s", params);
    TextDrawSetString(ann, string);
    TextDrawShowForAll(ann);
    annTextOnScreen = true;
    return 1;
}

CMD:pann(playerid, params[])
{
    new id, text[120];
    if(sscanf(params, "is[120]", id, text)) return SendClientMessage(playerid, -1, "USAGE: /pann [id] [message]");
    new string[150];
    format(string, sizeof string, "~w~%s", text);
    TextDrawSetString(ann, string);
    TextDrawShowForPlayer(id, ann);
    annTextOnScreen = true;
    return 1;
}

This is
Reply
#10

Quote:
Originally Posted by gekas
Посмотреть сообщение
This is
I want both of them
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)