Problem with textdraw
#1

Hello, I have a problem, first of all, the code:
public OnPlayerCommandText(playerid, cmdtext[])
{
for(new blue = 0; blue < 500; blue++)
{
new Text:blsk;
new string [50];
format(string, sizeof string, "blue %d", blue);
TextDrawSetString(blsk, string);
{
if (strcmp("/blue", cmdtext, true, 10) == 0)
{

if (GetPlayerTeam(playerid) == 0)
{
blue = blue + 1;
SetPlayerTeam(playerid, 1);
SendClientMessage(playerid, 0x33aa33aa, "Dabar tu blue teame");
}
if (GetPlayerTeam(playerid) == 1)
{
SendClientMessage(playerid, 0x33aa33aa, "tu jau esi ten");
return 1;
}
}
}
}
return 0;
}
and after using this command, server shows a textdraw which counts till 500, meanwhile I need only to plus 1. What's the problem?
Reply
#2

Use [pawn]tags[/pawn] please.
Reply
#3

Quote:
Originally Posted by MP2
Посмотреть сообщение
Use [pawn]tags[/pawn] please.
yup no one can understand
Reply
#4

oh, yeah, sorry
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    for(new blue = 0; blue < 5000; blue++)
    {
        new Text:blsk;
        new string [50];
        format(string, sizeof string, "blue %d", blue);
        TextDrawSetString(blsk, string);
        {
        if (strcmp("/blue", cmdtext, true, 10) == 0)
        {

            if (GetPlayerTeam(playerid) == 0)
            {
            blue = blue + 1;
            SetPlayerTeam(playerid, 1);
            SendClientMessage(playerid, 0x33aa33aa, "Dabar tu blue teame");
            }
            if (GetPlayerTeam(playerid) == 1)
            {
            SendClientMessage(playerid, 0x33aa33aa, "tu jau esi ten");
            return 1;
            }
        }
    }
    }
    return 0;
}
Reply
#5

Okay, you've done one of the many steps you need to do in order to get your problem solved. You posted code, however you never said what is wrong except that it's a textdraw problem. Care to elaborate so that we can actually help you? It's a lot easier for all of us if we know what we are looking for =).

EDIT:

Right I actually missed the text part in the bunch of code that wasn't in any tag. Sorry.

Why do you loop 5000 times through it? What? Can you explain your code?
Reply
#6

I want a textdraw which counts how many people are on the team. Every person in the server could see how many people are on team blue (Blue: 0). And when anyone writes /blue, that value adds by one. (Blue: 1). And like I understood, textdraw has to update. But im trying to do that and I can't get a result that I want.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)