Problema plugin

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
Electronistu
Membru, skill 0
Membru, skill 0
Posts: 34
Joined: 03 Jul 2009, 13:15
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com!

24 Jun 2010, 16:00

Buna ziu am o problema cu pluginul resetscore cand scrie un jucator /retry in chat ii apare mesaju: "Ti-ai resetat scorul" tuturor jucatorilor de pe server iar eu vreau sa apara numa jucatorului care a scris /retry in chat daca ma puteti ajuta am pus mai jos pluginul

Code: Select all

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#if defined _colorchat_included
  #endinput
#endif
#define _colorchat_included

enum Color
{
   NORMAL = 1, // clients scr_concolor cvar color
   GREEN, // Green Color
   TEAM_COLOR, // Red, grey, blue
   GREY, // grey
   RED, // Red
   BLUE, // Blue
}

new const TeamName[][] = 
{
   "",
   "TERRORIST",
   "CT",
   "SPECTATOR"
}

#define adtime	 600.0 

new pcvar_Advertise
new pcvar_Display

public plugin_init()
{
	register_plugin("Reset Score", "1.0", "Silenttt")
	
	register_clcmd("say /retry", "reset_score")
	register_clcmd("say /retry", "reset_score")
	
	pcvar_Advertise = register_cvar("sv_rsadvertise", "1")
	pcvar_Display = register_cvar("sv_rsdisplay", "1")
	
	if(get_cvar_num("sv_rsadvertise") == 1)
	{
		set_task(adtime, "advertise", _, _, _, "b")
	}
}

public reset_score(id)
{
	cs_set_user_deaths(id, 0)
	set_user_frags(id, 0)
	cs_set_user_deaths(id, 0)
	set_user_frags(id, 0)
	
	if(get_pcvar_num(pcvar_Display) == 1)
	{
		new name[33]
		get_user_name(id, name, 32)
		client_print(0, print_chat, "%s si-a resetat scorul!", name)
	}
	else
	{
		client_print(0, print_chat, "[>FDS.Idle.Ro<] Ti-ai resetat scorul!")
	}
}

public advertise()
{
	set_hudmessage(255, 0, 0, -1.0, 0.20, 0, 0.2, 12.0)
	show_hudmessage(0, "")
}

public client_putinserver(id)
{
	if(get_pcvar_num(pcvar_Advertise) == 1)
	{
		set_task(10.0, "connectmessage", id, _, _, "a", 1)
	}
}

public connectmessage(id)
{
	if(is_user_connected(id))
	{
	ColorChat(id, RED, "^x04* ^x03Scrie in chat ^x04/retry ^x03pentru a-ti reseta scorul la 0!")
	}
}

ColorChat(id, Color:type, const msg[], any:...)
{
   new message[256];

   switch(type)
   {
      case NORMAL: 
      {
         message[0] = 0x01;
      }
      case GREEN: // Green
      {
         message[0] = 0x04;
      }
      default: 
      {
         message[0] = 0x03;
      }
   }

   vformat(message[1], 251, msg, 4);

   message[192] = '^0';

   new team, ColorChange, index, MSG_Type;
   
   if(id)
   {
      MSG_Type = MSG_ONE_UNRELIABLE;
      index = id;
   } else {
      index = FindPlayer();
      MSG_Type = MSG_BROADCAST;
   }
   
   team = get_user_team(index);
   ColorChange = ColorSelection(index, MSG_Type, type);

   ShowColorMessage(index, MSG_Type, message);
      
   if(ColorChange)
   {
      Team_Info(index, MSG_Type, TeamName[team]);
   }
}

ShowColorMessage(id, type, message[])
{
   static msgSayText;
   if(!msgSayText)
   {
      msgSayText = get_user_msgid("SayText");
   }
   message_begin(type, msgSayText, _, id);
   write_byte(id)      
   write_string(message);
   message_end();   
}

Team_Info(id, type, team[])
{
   static msgTeamInfo;
   if(!msgTeamInfo)
   {
      msgTeamInfo = get_user_msgid("TeamInfo");
   }
   message_begin(type, msgTeamInfo, _, id);
   write_byte(id);
   write_string(team);
   message_end();

   return 1;
}

ColorSelection(index, type, Color:Type)
{
   switch(Type)
   {
      case RED:
      {
         return Team_Info(index, type, TeamName[1]);
      }
      case BLUE:
      {
         return Team_Info(index, type, TeamName[2]);
      }
      case GREY:
      {
         return Team_Info(index, type, TeamName[0]);
      }
   }

   return 0;
}

FindPlayer()
{
   new i = -1;

   while(i <= get_maxplayers())
   {
      if(is_user_connected(++i))
         return i;
   }

   return -1;
}
RoyalServer
User avatar
FyNNN
Membru, skill +3
Membru, skill +3
Posts: 1421
Joined: 09 May 2010, 14:43
Detinator Steam: Da
CS Status: Shhht guritza !
Detinator server CS: Nu
SteamID: mircea_fynn
Reputatie: Membru Club eXtreamCS (o luna)
Ban 3 luni!
Location: Arad
Has thanked: 125 times
Been thanked: 167 times
Contact:

24 Jun 2010, 16:04

| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>

#if defined _colorchat_included
  #endinput
#endif
#define _colorchat_included

enum Color
{
   NORMAL = 1, // clients scr_concolor cvar color
   GREEN, // Green Color
   TEAM_COLOR, // Red, grey, blue
   GREY, // grey
   RED, // Red
   BLUE, // Blue
}

new const TeamName[][] = 
{
   "",
   "TERRORIST",
   "CT",
   "SPECTATOR"
}

#define adtime	 600.0 

new pcvar_Advertise
new pcvar_Display

public plugin_init()
{
	register_plugin("Reset Score", "1.0", "Silenttt")
	
	register_clcmd("say /retry", "reset_score")
	register_clcmd("say /retry", "reset_score")
	
	pcvar_Advertise = register_cvar("sv_rsadvertise", "1")
	pcvar_Display = register_cvar("sv_rsdisplay", "1")
	
	if(get_cvar_num("sv_rsadvertise") == 1)
	{
		set_task(adtime, "advertise", _, _, _, "b")
	}
}

public reset_score(id)
{
	cs_set_user_deaths(id, 0)
	set_user_frags(id, 0)
	cs_set_user_deaths(id, 0)
	set_user_frags(id, 0)
	
	if(get_pcvar_num(pcvar_Display) == 1)
	{
		new name[33]
		get_user_name(id, name, 32)
		client_print(0, print_chat, "%s si-a resetat scorul!", name)
	}
	else
	{
		client_print(id, print_chat, "[>FDS.Idle.Ro<] Ti-ai resetat scorul!")
	}
}

public advertise()
{
	set_hudmessage(255, 0, 0, -1.0, 0.20, 0, 0.2, 12.0)
	show_hudmessage(0, "")
}

public client_putinserver(id)
{
	if(get_pcvar_num(pcvar_Advertise) == 1)
	{
		set_task(10.0, "connectmessage", id, _, _, "a", 1)
	}
}

public connectmessage(id)
{
	if(is_user_connected(id))
	{
	ColorChat(id, RED, "^x04* ^x03Scrie in chat ^x04/retry ^x03pentru a-ti reseta scorul la 0!")
	}
}

ColorChat(id, Color:type, const msg[], any:...)
{
   new message[256];

   switch(type)
   {
      case NORMAL: 
      {
         message[0] = 0x01;
      }
      case GREEN: // Green
      {
         message[0] = 0x04;
      }
      default: 
      {
         message[0] = 0x03;
      }
   }

   vformat(message[1], 251, msg, 4);

   message[192] = '^0';

   new team, ColorChange, index, MSG_Type;
   
   if(id)
   {
      MSG_Type = MSG_ONE_UNRELIABLE;
      index = id;
   } else {
      index = FindPlayer();
      MSG_Type = MSG_BROADCAST;
   }
   
   team = get_user_team(index);
   ColorChange = ColorSelection(index, MSG_Type, type);

   ShowColorMessage(index, MSG_Type, message);
      
   if(ColorChange)
   {
      Team_Info(index, MSG_Type, TeamName[team]);
   }
}

ShowColorMessage(id, type, message[])
{
   static msgSayText;
   if(!msgSayText)
   {
      msgSayText = get_user_msgid("SayText");
   }
   message_begin(type, msgSayText, _, id);
   write_byte(id)      
   write_string(message);
   message_end();   
}

Team_Info(id, type, team[])
{
   static msgTeamInfo;
   if(!msgTeamInfo)
   {
      msgTeamInfo = get_user_msgid("TeamInfo");
   }
   message_begin(type, msgTeamInfo, _, id);
   write_byte(id);
   write_string(team);
   message_end();

   return 1;
}

ColorSelection(index, type, Color:Type)
{
   switch(Type)
   {
      case RED:
      {
         return Team_Info(index, type, TeamName[1]);
      }
      case BLUE:
      {
         return Team_Info(index, type, TeamName[2]);
      }
      case GREY:
      {
         return Team_Info(index, type, TeamName[0]);
      }
   }

   return 0;
}

FindPlayer()
{
   new i = -1;

   while(i <= get_maxplayers())
   {
      if(is_user_connected(++i))
         return i;
   }

   return -1;
}
Incearca asa :) .
Daca nu merge spune-mi, ca rezolv, iar daca merge dai un Multumesc ;) .
Electronistu
Membru, skill 0
Membru, skill 0
Posts: 34
Joined: 03 Jul 2009, 13:15
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com!

24 Jun 2010, 16:29

Merge multumesc :P
Post Reply

Return to “Cereri”

  • Information