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(id, CC_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], 251, msg, 4);
CC_message[192] = '^0';
new CC_team, CC_ColorChange, index, MSG_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(index, MSG_Type, type);
CC_ShowColorMessage(index, MSG_Type, CC_message);
if (CC_ColorChange)
{
CC_TeamInfo(index, MSG_Type, CC_TeamName[CC_team]);
}
}
CC_ShowColorMessage(index, type, message[])
{
static CC_SayText;
if (!CC_SayText)
{
CC_SayText = get_user_msgid("SayText");
}
message_begin(type, CC_SayText, _, index);
write_byte(index);
write_string(message);
message_end();
}
CC_TeamInfo(index, type, team[])
{
static CC_TeamInfo;
if (!CC_TeamInfo)
{
CC_TeamInfo = get_user_msgid("TeamInfo");
}
message_begin(type, CC_TeamInfo, _, index);
write_byte(index);
write_string(team);
message_end();
return 1;
}
CC_ColorSelection(index, type, CC_Colors:Type)
{
switch(Type)
{
case RED:
{
return CC_TeamInfo(index, type, CC_TeamName[1]);
}
case BLUE:
{
return CC_TeamInfo(index, type, CC_TeamName[2]);
}
case GREY:
{
return CC_TeamInfo(index, type, CC_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(id, 0);
set_user_frags(id, 0);
cs_set_user_deaths(id, 0);
set_user_frags(id, 0);
ColorChat(id, RED, "^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(players, num)
new i
for(i=0;i<num;i++)
{
new name[32] ;
new ipeki[32];
get_user_name(players[i],name, 31)
get_user_ip(players[i],ipeki, 31, 0)
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 , 1 ) )
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 i = 0;i < 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 i = 0;i < 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 - 1, 1);
iNum++;
if(iNum >= 5)
iNum = 0;
return 0;
}