Raised This Month: $ Target: $400
 0% 

3 plugins in 1 .


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sader
Junior Member
Join Date: Aug 2011
Old 08-15-2011 , 11:03   Re: 3 plugins in 1 .
Reply With Quote #1

It compiles successfully so should work

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>
// ColorChat Included
enum CC_Colors
{
 
YELLOW 1// 1; Yellow;  ^x01; default
 
GREEN,  // 2; Green;  ^x04
 
TEAM_COLOR// 3; Red, Blue, Grey; ^x03; teamcolor(t;ct;spec)
 
GREY,  // 4; Grey;  Spectator Color
 
RED,  // 5; Red;  Terrorist Color
 
BLUE,  // 6; Blue; Counter-Terrorist Color
}
new 
CC_TeamName[][] =
{
 
"",
 
"TERRORIST",
 
"CT",
 
"SPECTATOR"
};
#define STR_LEN 32
enum _:Infos
{
  
gUserIp[STR_LEN],
  
gUserName[STR_LEN]
}
new 
gLastUsers[5][Infos];

public 
ColorChat(idCC_Colors:type, const msg[], {Float,Sql,Result,_}:...)
{
 if (
get_playersnum() < 1)
 {
  return;
 }
 static 
CC_message[256];
 switch(
type)
 {
  case 
YELLOW:
  {
   
CC_message[0] = 0x01;
  }
  case 
GREEN:
  {
   
CC_message[0] = 0x04;
  }
  default:
  {
   
CC_message[0] = 0x03;
  }
 }
 
vformat(CC_message[1], 251msg4);
 
CC_message[192] = '^0';
 new 
CC_teamCC_ColorChangeindexMSG_Type;
 if (!
id)
 {
  
index CC_FindPlayer();
  
MSG_Type MSG_ALL;
 }
 else
 {
  
MSG_Type MSG_ONE;
  
index id;
 }
 
CC_team get_user_team(index);
 
CC_ColorChange CC_ColorSelection(indexMSG_Typetype);
 
CC_ShowColorMessage(indexMSG_TypeCC_message);
 if (
CC_ColorChange)
 {
  
CC_TeamInfo(indexMSG_TypeCC_TeamName[CC_team]);
 }
}
CC_ShowColorMessage(indextypemessage[])
{
 static 
CC_SayText;
 if (!
CC_SayText)
 {
  
CC_SayText get_user_msgid("SayText");
 }
 
message_begin(typeCC_SayText_index);
 
write_byte(index);
 
write_string(message);
 
message_end();
}
CC_TeamInfo(indextypeteam[])
{
 static 
CC_TeamInfo;
 if (!
CC_TeamInfo)
 {
  
CC_TeamInfo get_user_msgid("TeamInfo");
 }
 
message_begin(typeCC_TeamInfo_index);
 
write_byte(index);
 
write_string(team);
 
message_end();
 return 
1;
}
CC_ColorSelection(indextypeCC_Colors:Type)
{
 switch(
Type)
 {
  case 
RED:
  {
   return 
CC_TeamInfo(indextypeCC_TeamName[1]);
  }
  case 
BLUE:
  {
   return 
CC_TeamInfo(indextypeCC_TeamName[2]);
  }
  case 
GREY:
  {
   return 
CC_TeamInfo(indextypeCC_TeamName[0]);
  }
 }
 return 
0;
}
CC_FindPlayer()
{
 new 
index = -1;
 while(
index <= get_maxplayers())
 {
  if (
is_user_connected(++index))
  {
   return 
index;
  }
 }
 return -
1;
}
public 
plugin_init()
{
 
register_plugin("ResetScore,Showip,Last IP""1.0""Cagulatii,No *mErCy*,Alka");
 
 
register_clcmd("say /resetscore""command_RS");
 
register_clcmd("say /restartscore""command_RS");
 
register_clcmd("say /reset""command_RS");
 
register_clcmd("say /retry""command_RS");
 
register_clcmd("say /rs""command_RS");
 
register_clcmd("say resetscore""command_RS");
 
register_clcmd("say rs""command_RS");
 
  
register_concmd("amx_showip""cmd_showip"ADMIN_KICK"><LisTa IP jucatori><");
  
register_concmd("amx_lastip""cmdLastIp"ADMIN_ADMIN"");
}
public 
command_RS(id)
{
 if (!
is_user_connected(id)) return;
 
cs_set_user_deaths(id0);
 
set_user_frags(id0);
 
cs_set_user_deaths(id0);
 
set_user_frags(id0);
 
ColorChat(idRED"^x04[ ZALAU ]^x03 Scorul tau este:^x04 0-0^x03 !!!");
}
/*
public plugin_init() {
   register_plugin("Showip", "No *mErCy*", "1.0")
   register_concmd("amx_showip", "cmd_showip", ADMIN_KICK, "><LisTa IP jucatori><")
}
*/
public cmd_showip(id)
{
   
console_print(id,"|-+-+-+-+- LisTa IP Jucatori -+-+-+-+-|")
   
console_print(id,"|=============================|")
   new 
players[32], num
   get_players
(playersnum)
   new 
i
   
   
for(i=0;i<num;i++)
   {
   new 
name[32] ;
   new 
ipeki[32];
   
get_user_name(players[i],name31)
   
get_user_ip(players[i],ipeki310)
   
console_print(id,"   -   %s - %s"name,ipeki)
   }
   
console_print(id"|=============================|")
   return 
PLUGIN_HANDLED
}
/*
public plugin_init() 
{
  register_plugin(PLUGIN, VERSION, AUTHOR)
  register_concmd("amx_lastip", "cmdLastIp", ADMIN_ADMIN, "");
}
*/
public cmdLastIp(id,level,cid)
{
  if ( ! 
cmd_access id level cid ) )
  return 
PLUGIN_HANDLED
  
  
if(!gLastUsers[0][gUserName][0]) {
  
  
client_print(id,3,"Inca nu a iesit nici un jucator de pe server!");
  return 
1;
  }
  
  for(new 
0;5;i++)
  {
    if(!
gLastUsers[i][gUserName][0] || ! gLastUsers[i][gUserIp][0])
    continue;
    
console_print(id,"%s - %s",gLastUsers[i][gUserName], gLastUsers[i][gUserIp]);
  }
  
  return 
1;
}
public 
client_disconnect(id)
{
  static 
sName[32];
  
get_user_name(id,sName,sizeof sName 1);
  for(new 
0;sizeof gLastUsers;i++)
  {
  
  if(
equali(gLastUsers[i][gUserName],sName))
  return 
1;
  }
  
  static 
iNum;
  
get_user_name(id,gLastUsers[iNum][gUserName],STR_LEN 1);
  
get_user_ip(id,gLastUsers[iNum][gUserIp],STR_LEN 11);
  
iNum++;
  
  if(
iNum >= 5)
  
iNum 0;
  
  return 
0;

sader is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:29.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode