示例#1
0
void _AddKickuserToMenu (edict_t * ent, int fromix)
{
	int i, j;
	edict_t *other;
	qboolean erg;
	char buf[256];

	j = 0;
	for(i = 0, other = g_edicts + 1; i < game.maxclients && j < fromix; i++, other++)
	{
		if (!other->inuse || !other->client || other->client->pers.mvdspec)
			continue;

		if (other != ent)
			j++;
	}
	erg = true;

	for (; i < game.maxclients && erg; i++, other++)
	{
		if (!other->inuse || !other->client || other->client->pers.mvdspec)
			continue;

		if (other != ent)
		{
			//+ Marker: Hier gewählten markieren - erledigt -
			sprintf (buf, "%s%2i: %s%s",
			other == ent->client->resp.kickvote ? "*" : "", i,
			other->client->pers.netname,
			other == Mostkickvotes ? MostKickMarker : "");
			erg = xMenu_Add (ent, buf, _KickSelected);
		}
	}
}
示例#2
0
void _AddIgnoreuserToMenu (edict_t * ent, int fromix)
{
	int i, j;
	edict_t *other;
	qboolean erg;
	char buf[256];

	j = 0;
	for (i = 0, other = g_edicts + 1; i < game.maxclients && j < fromix; i++, other++)
	{
		if (other->inuse && other != ent)
			j++;
	}
	erg = true;
	for (; i < game.maxclients && erg; i++, other++)
	{
		if (other->inuse && other != ent)
		{
			//+ Marker: Hier gewählten markieren - erledigt -
			sprintf (buf, "%s%2i: %s", IsInIgnoreList (ent, other) ? "*" : "",
			i, other->client->pers.netname);
			erg = xMenu_Add (ent, buf, _IgnoreSelected);
		}
	}
}
示例#3
0
void _AddKickuserToMenu (edict_t * ent, int fromix)
{
	int i, j;
	edict_t *other;
	qboolean erg;
	char buf[256];

	j = 0;
	for(i = 1; i <= game.maxclients && j < fromix; i++)
	{
		other = &g_edicts[i];
		if (other->inuse && other != ent)
			j++;
	}
	erg = true;
	while (i <= game.maxclients && erg)
	{
		other = &g_edicts[i];
		if (other->inuse && other != ent)
		{
			//+ Marker: Hier gewählten markieren - erledigt -
			sprintf (buf, "%s%2i: %s%s",
			other == ent->client->resp.kickvote ? "*" : "", i,
			other->client->pers.netname,
			other == Mostkickvotes ? MostKickMarker : "");
			erg = xMenu_Add (ent, buf, _KickSelected);
		}
		i++;
	}
}
示例#4
0
void
AddMapToMenu (edict_t * ent, int fromix)
{
  int i;
  char buffer[512], spc[64];
  votelist_t *search;
  float prozent;

  i = 0;
  search = map_votes;
  while (search && i < fromix)
    {
      search = search->next;
      i++;
    }
  while (search)
    {
      prozent =
	(float) (((float) search->num_votes / (float) map_num_clients) * 100);
      i = 27 - strlen (search->mapname);
      if (prozent < 10.00)
	i -= 6;
      else if (prozent < 100.00)
	i -= 7;
      else
	i -= 8;
      if (i < 0)
	i = 0;
      spc[i--] = '\0';
      while (i >= 0)
	spc[i--] = ' ';
      //+ Marker: Hier einbauen, daß die gewählte Karte markiert ist
      //  problem: '*' am anfang wird nicht berücksichtigt. - erledigt -
      //alt: sprintf(buffer, "%s%s%.1f%%", search->mapname, spc, prozent);
      sprintf (buffer, "%s%s%s%.1f%%",
	       ent->client->resp.mapvote == search->mapname ? "*" : "",
	       search->mapname, spc, prozent);


      if (xMenu_Add (ent, buffer, MapSelected) == true)
	search = search->next;
      else
	search = NULL;
    }
}
示例#5
0
void
AddConfigToMenu (edict_t * ent, int fromix)
{
  int i;
  char buffer[512], spc[64];
  configlist_t *search;
  float prozent;

  i = 0;
  search = config_votes;
  while (search && i < fromix)
    {
      search = search->next;
      i++;
    }
  while (search)
    {
      prozent =
	(float) (((float) search->num_votes / (float) config_num_clients) *
		 100);
      i = 27 - strlen (search->configname);
      if (prozent < 10.00)
	i -= 6;
      else if (prozent < 100.00)
	i -= 7;
      else
	i -= 8;
      if (i < 0)
	i = 0;
      spc[i--] = '\0';
      while (i >= 0)
	spc[i--] = ' ';
      sprintf (buffer, "%s%s%s%.1f%%",
	       ent->client->resp.cvote == search->configname ? "*" : "",
	       search->configname, spc, prozent);

      if (xMenu_Add (ent, buffer, ConfigSelected) == true)
	search = search->next;
      else
	search = NULL;
    }
}