SA-MP Forums Archive
Teams/Scores - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Teams/Scores (/showthread.php?tid=154431)



Teams/Scores - knopke - 13.06.2010

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;
}



Re: Teams/Scores - knopke - 13.06.2010

Help!


Re: Teams/Scores - Cameltoe - 13.06.2010

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


Re: Teams/Scores - knopke - 13.06.2010

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


Re: Teams/Scores - DJDhan - 13.06.2010

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;
}



Re: Teams/Scores - knopke - 13.06.2010

o where is Clan Name?


Re: Teams/Scores - Naxix - 13.06.2010

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


Re: Teams/Scores - knopke - 13.06.2010

Clan name


Re: Teams/Scores - Naxix - 13.06.2010

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;
}



Re: Teams/Scores - knopke - 13.06.2010

but how i can change with command?