Slow updating.
#1

I am currently using a textdraw for team 1 kills and team 2 kills. My problem is that it counts very slow, if i make a kill it pop ups like... 6 seconds later :S
I hope anyone can help me fix it.
Reply
#2

Show the code where you update it.
Reply
#3

Код:
public OnPlayerDeath(playerid, killerid, reason)
{
  TextDrawHideForPlayer (playerid, textkills);
  if (gTeam[playerid] == TEAM_ATTACK) TeamKills[0]++; 
	else if (gTeam[playerid] == TEAM_DEFEND) TeamKills[1]++;
 	SetPlayerScore(killerid, GetPlayerScore(killerid) + 1);
	return 1;
}
Reply
#4

I mean the textdraw.
Reply
#5

pawn Код:
//public on player spawn
    format (string, sizeof(string), "~r~Grove: %d ~n~~g~Aztecas: %d", TeamKills[1], TeamKills[0]);
    TextDrawSetString (textkills, string);
    TextDrawShowForAll (textkills);

    //ongamemodeinit
    textkills = TextDrawCreate(31.000000, 209.000000, " ");
    TextDrawBackgroundColor(textkills, 255);
    TextDrawFont(textkills, 2);
    TextDrawLetterSize(textkills, 0.490000, 1.699998);
    TextDrawColor(textkills, -1);
    TextDrawSetOutline(textkills, 0);
    TextDrawSetProportional(textkills, 1);
    TextDrawSetShadow(textkills, 1);
    TextDrawUseBox(textkills, 1);
    TextDrawBoxColor(textkills, -1347440726);
    TextDrawTextSize(textkills, 170.000000, -1.000000);
Reply
#6

pawn Код:
//public on player spawn
    format (string, sizeof(string), "~r~Grove: %d ~n~~g~Aztecas: %d", TeamKills[1], TeamKills[0]);
    TextDrawSetString (textkills, string);
    TextDrawShowForAll (textkills);
Do you have it somewhere else in your script?
Reply
#7

nope
Reply
#8

Of course it's delayed, you're having it happen ONPLAYERSPAWN, when it should be updated ONPLAYERDEATH
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)