Show Number of players on a team on bottom left corner?
#1

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
Reply
#2

You MUST forward this
pawn Код:
forward THplayers();
Add at public OnFilterScriptInIt:
pawn Код:
SetTimer("THplayers", 1000, true); // true makes it repeat all the time

Now we need to public it
pawn Код:
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;
}
Try this
Reply
#3

Quote:
Originally Posted by Aztecking
Посмотреть сообщение
pawn Код:
SetTimer("THplayers", 1000, true); // false doesn't stop timer, gametext gets updated every 1 second
false stops it ._. false makes it will only happen 1 time.. true will be a repeating interval
Mistake.. I forgot that the 3rd param is repeating..
Reply
#4

Quote:
Originally Posted by Claude
Посмотреть сообщение
You MUST forward this
pawn Код:
forward THplayers();
Add at public OnFilterScriptInIt:
pawn Код:
SetTimer("THplayers", 1000, false); // false doesn't stop timer, gametext gets updated every 1 second

Now we need to public it
pawn Код:
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;
}
Try this
bad ass but its not in the corner and its too big how can i put it in the bottom right corner
Reply
#5

Quote:
Originally Posted by Aztecking
Посмотреть сообщение
TEXTDRAW
well can you teach me how to make a textdraw properly?
Reply
#6

Quote:
Originally Posted by Aztecking
Посмотреть сообщение
TEXTDRAW
Somewhere at the top new thplayers;
At OnFilterScriptInIt or OnGameModeInIt
pawn Код:
thplayers = TextDrawCreate(..);
Change the
pawn Код:
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);
to
pawn Код:
format(string, sizeof(string), "Team Hunter players: %d", teamcount);
TextDrawSetString(thplayers, string);
Textdraw: Make yourself one using Textdraw creator
Reply
#7

Quote:
Originally Posted by Claude
Посмотреть сообщение
Somewhere at the top new thplayers;
At OnFilterScriptInIt or OnGameModeInIt
pawn Код:
thplayers = TextDrawCreate(..);
Change the
pawn Код:
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);
to
pawn Код:
format(string, sizeof(string), "Team Hunter players: %d", teamcount);
TextDrawSetString(thplayers, string);
Textdraw: Make yourself one using Textdraw creator
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(..);
line 337
Код:
TextDrawSetString(thplayers, string);
Reply
#8

Quote:
Originally Posted by lSCARl
Посмотреть сообщение
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(..);
line 337
Код:
TextDrawSetString(thplayers, string);
The ..(dots) at TextDrawCreate are supposed to be your textdraw coordinates..
Reply
#9

Here you go?..its a example fs:
Modify to your needs..if you need any help or w/e, just contact me.
Reply
#10

Quote:
Originally Posted by s0nic
Посмотреть сообщение
Here you go?..its a example fs:
Modify to your needs..if you need any help or w/e, just contact me.
ftw!!!!!!!!!!!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)