Teams/Scores
#1

Hi all. So I want the team name would be above this team after this point. What is wrong here?

Код:
dcmd_Teams(playerid,params[])
{
	#pragma unused params
	if(!IsPlayerAdmin(playerid)) SendClientMessage(playerid, AAD_COLOR_GREY, "You need to be admin to do that");
	DefendersCount++;
	new string[128];
      new name[MAX_PLAYER_NAME];;
      GetPlayerName(playerid, name, sizeof(name));
	format(string, sizeof(string), "%s: %d", name, DefendersCount);
	TextDrawSetString(DefenderDraw,string);
return 1;
}
Reply
#2

Help!
Reply
#3

I'm not familiar with dcmd, but what error does it give you?
Reply
#4

it is not error, but me dont show clan name i wanna /teams Clan Name and Scores
Reply
#5

If you need a code to update the text draws with the number of defenders and attackers, do the following

Put this at the top of the script if you haven't already
Код:
new AttackersCount;
new DefendersCount;
Under OnGameModeInit function

Код:
SetTimer("numberupdate",5000,1);
Then put this anywhere in the script.
Код:
forward numberupdate();
public numberupdate()
{
	for(new i=0;i<MAX_PLAYERS;i++)
	{
		if(gTeam[i] == TEAM_DEFENDER)
		{
       		DefendersCount++;
		}
		if(gTeam[playerid==TEAM_ATTACKER)
		{
			AttackersCount++;
		}
	}
		
	new string[128];
       format(string, sizeof(string), "Number Of Defenders : %d", DefendersCount);
	TextDrawSetString(DefenderDraw,string);
	new string2[128];
	format(string2,sizeof(String2),"Number Of Attackers" %d",AttackersCount);
	TextDrawSetString(DefenderDraw,string2);
	return 1;
}
Reply
#6

o where is Clan Name?
Reply
#7

You want to show every member of each clan's name? Or just the name of the clan?
Reply
#8

Clan name
Reply
#9

Use DJDhan's code and type in the clan name instead of "Number of Attackers" and "Number of Defenders"

Example:

Код:
forward numberupdate();
public numberupdate()
{
	for(new i=0;i<MAX_PLAYERS;i++)
	{
		if(gTeam[i] == TEAM_DEFENDER)
		{
       		DefendersCount++;
		}
		if(gTeam[playerid==TEAM_ATTACKER)
		{
			AttackersCount++;
		}
	}
		
	new string[128];
       format(string, sizeof(string), "Clan1's Name : %d", DefendersCount);
	TextDrawSetString(DefenderDraw,string);
	new string2[128];
	format(string2,sizeof(String2),"Clan2's Name" %d",AttackersCount);
	TextDrawSetString(DefenderDraw,string2);
	return 1;
}
Reply
#10

but how i can change with command?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)