#include <amxmodx>
#include <hamsandwich>
enum Color
{
NORMAL = 1, // clients scr_concolor cvar color
GREEN, // Green Color
TEAM_COLOR, // Red, grey, blue
GREY, // grey
RED, // Red
BLUE, // Blue
}
new TeamName[][] =
{
"",
"TERRORIST",
"CT",
"SPECTATOR"
}
ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...)
{
static message[256];
switch(type)
{
case NORMAL: // clients scr_concolor cvar color
{
message[0] = 0x01;
}
case GREEN: // Green
{
message[0] = 0x04;
}
default: // White, Red, Blue
{
message[0] = 0x03;
}
}
vformat(message[1], 251, msg, 4);
message[192] = '^0';
static team, ColorChange, index, MSG_Type;
if(id)
{
MSG_Type = MSG_ONE;
index = id;
} else {
index = FindPlayer();
MSG_Type = MSG_ALL;
}
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[])
{
message_begin(type, get_user_msgid("SayText"), _, id);
write_byte(id)
write_string(message);
message_end();
}
Team_Info(id, type, team[])
{
message_begin(type, get_user_msgid("TeamInfo"), _, 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()
{
static i;
i = -1;
while(i <= get_maxplayers())
{
if(is_user_connected(++i))
{
return i;
}
}
return -1;
}
#include <fun>
#define ACCESS_HEGRENADE_1 (1<<0) // a
#define ACCESS_FLASHBANG_2 (1<<1) // b
#define ACCESS_SMOKEGRENADE_3 (1<<2) // c
new gCvarGrenades;
public plugin_init() {
register_plugin( "Full Pack Grenades", "1.3", "Simple32" );
gCvarGrenades = register_cvar( "mode_grenades", "abc" );
RegisterHam( Ham_Spawn, "player", "fwdPlayerSpawn", 1 );
}
public fwdPlayerSpawn( id ){
server_print("fwdPlayerSpawn(%d) called", id);
if( is_user_alive( id ) )
{
server_print("is_user_alive(%d): true", id);
static szFlags[32];
get_pcvar_string(gCvarGrenades, szFlags, charsmax(szFlags));
new iFlags = read_flags(szFlags);
server_print("mode_grenades: %s / %d", szFlags, iFlags);
if(iFlags & ACCESS_HEGRENADE_1)
{
ColorChat(id, NORMAL, "^4[FPG]^1 Te kaptál egy ^3HE Gránátot!");
give_item(id, "weapon_hegrenade");
}
if(iFlags & ACCESS_FLASHBANG_2)
{
ColorChat(id, NORMAL, "^4[FPG]^1 Te kaptál egy ^3FLASH Gránátot!");
give_item(id, "weapon_flashbang");
}
if(iFlags & ACCESS_SMOKEGRENADE_3)
{
ColorChat(id, NORMAL, "^4[FPG]^1 Te kaptál egy ^3SMOKE Gránátot!");
give_item(id, "weapon_smokegrenade");
}
}
else
server_print("is_user_alive(%d): false", id);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang3081\\ f0\\ fs16 \n\\ par }
*/