13.08.2010, 18:53
how do i make it show the ammount of players on TEAM_HUNTER 1 in the bottom left corner for example if theres 1 player in team hunter it should say Hunters: 1 please help someone
forward THplayers();
SetTimer("THplayers", 1000, true); // true makes it repeat all the time
public THplayers()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
new teamcount = 0, string[100];
if(GetPlayerTeam(i) == TEAM_HUNTER) teamcount++;
format(string, sizeof(string),"~n~ ~n~ ~n~ ~n~ ~g~Team Hunter Players: %d", teamcount); // the ~n~ makes it go to the bottom
GameTextForAll(1000, 3);
return 1;
}
return 1;
}
You MUST forward this
pawn Код:
pawn Код:
Now we need to public it pawn Код:
|
thplayers = TextDrawCreate(..);
format(string, sizeof(string),"~n~ ~n~ ~n~ ~n~ ~g~Team Hunter Players: %d", teamcount); // the ~n~ makes it go to the bottom
GameTextForAll(1000, 3);
format(string, sizeof(string), "Team Hunter players: %d", teamcount);
TextDrawSetString(thplayers, string);
Somewhere at the top new thplayers;
At OnFilterScriptInIt or OnGameModeInIt pawn Код:
pawn Код:
pawn Код:
|
thplayers = TextDrawCreate(..);
TextDrawSetString(thplayers, string);
i get this
C:\Users\Brandon\Desktop\GTA SAN ANDREAS\GTA San Andreas\samp\gamemodes\HnK.pwn(105) : error 029: invalid expression, assumed zero C:\Users\Brandon\Desktop\GTA SAN ANDREAS\GTA San Andreas\samp\gamemodes\HnK.pwn(105) : warning 213: tag mismatch C:\Users\Brandon\Desktop\GTA SAN ANDREAS\GTA San Andreas\samp\gamemodes\HnK.pwn(337) : warning 213: tag mismatch Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase line 105 Код:
thplayers = TextDrawCreate(..); Код:
TextDrawSetString(thplayers, string); |
Here you go?..its a example fs:
Modify to your needs..if you need any help or w/e, just contact me. |