Textdraw troubles
#1

Just one of them shows up. They should show up both.

pawn Код:
forward energytimer();
new Text:noenergy[2];
pawn Код:
public energytimer()
{
for(new i; i<MAX_PLAYERS; i++)
{
if(energy[i]>=5)
{
energy[i] -=5;
TextDrawShowForPlayer(i,noenergy[0]);
TextDrawShowForPlayer(i,noenergy[1]);
return 1;
}
else
{
TogglePlayerControllable(i,0);
TextDrawShowForPlayer(i,noenergy[1]);
}
}
return 1;
}
pawn Код:
public OnGameModeInit()
{
    // Don't use these lines if it's a filterscript
    SetGameModeText("Blank Script");
    AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
   
   
    noenergy[0] = TextDrawCreate(79.000000, 146.000000, "Out of energy, you're unconscious\nUse /kill or wait for a medic");
    TextDrawBackgroundColor(noenergy[0], 255);
    TextDrawFont(noenergy[0], 2);
    TextDrawLetterSize(noenergy[0], 0.400000, 1.300000);
    TextDrawColor(noenergy[0], 0xFF4F05ff);
    TextDrawSetOutline(noenergy[0], 1);
    TextDrawSetProportional(noenergy[0], 1);
   
    noenergy[1] = TextDrawCreate(84.000000, 325.000000, "Use /kill or wait for a medic");
    TextDrawBackgroundColor(noenergy[1], 255);
    TextDrawFont(noenergy[1], 2);
    TextDrawLetterSize(noenergy[1], 0.599999, 2.499999);
    TextDrawColor(noenergy[1], -1);
    TextDrawSetOutline(noenergy[1], 1);
    TextDrawSetProportional(noenergy[1], 1);
   
    return 1;
}
Reply
#2

sorry for the way to early bump but I just need this little help..
Reply
#3

guys serious?
Reply
#4

Код:
forward energytimer();
public energytimer()
{
	for(new i; i<MAX_PLAYERS; i++)
	{
		GetPlayerHealth(i,energy[i]);
		if(energy[i]>=5)
		{
			SetPlayerHealth(i,energy[i]-5);
			TextDrawShowForPlayer(i,noenergy[0]);
			TextDrawShowForPlayer(i,noenergy[1]);
		}
		else
		{
			TogglePlayerControllable(i,0);
			TextDrawShowForPlayer(i,noenergy[1]);
		}
	}
	return 1;
}
this shows up both textdraws. the upper is slightly too long, but it works.
Reply
#5

C:\Users\Michael\Desktop\maxlife0.3c\filterscripts \energy.pwn(265) : warning 213: tag mismatch
Reply
#6

Quote:
Originally Posted by bartje01
Посмотреть сообщение
C:\Users\Michael\Desktop\maxlife0.3c\filterscripts \energy.pwn(265) : warning 213: tag mismatch
Give me line 265
Reply
#7

Oh damn xD

here it is
GetPlayerHealth(i,energy[i]);
Strange enough, the script works. but I still want the warning to be gone
Reply
#8

Can you show energy[i]
Reply
#9

What do you mean? :P

this?
new energy[MAX_PLAYERS];
Reply
#10

Sorry i thought u had something with energy like a stock or something

try making a new

tell me if it fixes the warning

pawn Код:
new Float:energy;
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)