09.12.2010, 17:43
hi,
im counting the deaths on my server:
After there are 30 people killed there appears a checkpoint on the map
But ive got a problem with my texdraw.
I want a textdraw that is somewhere on the screen all the time and that shows how many deaths there are already.
(So every player knows when the next cp will appear).
I also dont know how to do a new line in a texdraw(tried it with ~n~ and \n)
The texdraw itself appears but it doesnt show any deaths.
regards.
im counting the deaths on my server:
pawn Код:
new DeathsCount;
public OnPlayerDeath(playerid, killerid, reason)
{
DeathsCount++;
if(DeathsCount == 30)
{
SetCheckpointForAll(cp1,681.3374,-463.3429,22.5705,2.0);
}
}
return 1;
But ive got a problem with my texdraw.
I want a textdraw that is somewhere on the screen all the time and that shows how many deaths there are already.
(So every player knows when the next cp will appear).
pawn Код:
new Text:DeathCounter;
//OnGameModeInit:
DeathCounter = TextDrawCreate(10.0, 130.0, "Victims so far: ~n~Needed for next bombsmuggle: 30");
TextDrawUseBox(DeathCounter, 0);
TextDrawColor(DeathCounter, 0x008040FF );
TextDrawSetOutline(DeathCounter, 1);
TextDrawAlignment(DeathCounter, 1);
TextDrawLetterSize(DeathCounter, 0.850, 2.000);
//OnPlayerSpawn:
new newtext[41], DeathsCount;
format(newtext, sizeof(newtext), "Victims so far: %s\nNeeded for next bombsmuggle: 30", DeathsCount);
TextDrawSetString(DeathCounter, newtext);
TextDrawShowForPlayer(playerid, DeathCounter);
The texdraw itself appears but it doesnt show any deaths.
regards.