Alte informatii: Daca puteti, sa puneti sa aibe glow automat la cei care au vip (flagul "v"). Sa fie glow albastru la CT si glow rosu la T.
- | Afiseaza codul
#include <amxmodx> #include <fun> #include <engine> #include <cstrike> //#include <ColorChat> 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" } #define PLUGIN "HNS VIPMENU" #define VERSION "1.0" //Thanks to Falcao for weapons define and /vips online menu /* Define arme,grenazi */ new const DGLW4[ ] = "weapon_deagle"; new const FL4[ ] = "weapon_flashbang" new const SM4[ ] = "weapon_smokegrenade" new const HE4[ ] = "weapon_hegrenade" /* EndDefine arme,grenazi */ /* VIP ONLINE STUFF */ #define GROUPS_NAME 1 #define GROUPS_ACCESS 1 #define CharsMax(%1) sizeof %1 - 1 /*END OF VIP ONLINE STUFF */ new const g_szTag[ ] = "[HNS.DEVILX.RO]"; new count[33]; public plugin_init() { register_plugin(PLUGIN, VERSION, "OneShot"); register_clcmd("say /vmenu", "SayVipMenu"); register_clcmd("say /vipmenu", "SayVipMenu"); register_clcmd("say /vips", "vips_online"); register_clcmd("say vips", "vips_online"); set_task(120.0,"Items_Restriction",_,_,_,"b",0) } public Items_Restriction() { new iPlayers[ 32 ]; new iPlayersNum; get_players( iPlayers, iPlayersNum, "ch" ); for( new i = 0; i < iPlayersNum ; i++ ) count[iPlayers[ i ]] = 0 } public client_putinserver(id) { if( IsUserVip( id ) ) { new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); ColorChat( 0, RED, "^x04%s^x01 VIP-ul^x03 %s^x01 se conecteaza pe server !", g_szTag, szName ); client_cmd( 0, "spk fvox/bell" ); } } public client_disconnect(id) { if( IsUserVip( id ) ) { new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); ColorChat( 0, RED, "^x04%s^x01 VIP-ul^x03 %s^x01 s-a deconectat !", g_szTag, szName ); } } public SayVipMenu(id) { if( !IsUserVip( id ) ) { ColorChat( id, RED, "^x04%s^x01 Nu ai acces la^x03 vipmenu^x01 !", g_szTag ); return PLUGIN_HANDLED; } new menu = menu_create("\r[HNS.DEVILX.RO]\w -\r Alege itemul\w :", "vip_menu_handler"); if ( cs_get_user_team(id) == CS_TEAM_T ) { menu_additem(menu, "Deagle -\r 1\w glont", "1", 0); menu_additem(menu, "Gravity\r 650\w (\r10\w secunde)", "2", 0); menu_additem(menu, "GodMode (\r10\w secunde)", "3", 0); menu_additem(menu, "NoClip (\r10\w secunde)", "4", 0); menu_additem(menu, "Armura \r75", "5", 0); menu_additem(menu, "1\r HE\w + 1\r Smoke", "6", 0); menu_additem(menu, "2\r Flash", "7", 0); menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL, "\w Iesire" ); menu_display(id, menu, 0); } else if ( cs_get_user_team(id) == CS_TEAM_CT ) { menu_additem(menu, "Deagle -\r 1\w glont", "8", 0); menu_additem(menu, "Gravity\r 650\w (\r10\w secunde)", "9", 0); menu_additem(menu, "GodMode (\r10\w secunde)", "10", 0); menu_additem(menu, "NoClip (\r10\w secunde)", "11", 0); menu_additem(menu, "Armura\r 75", "12", 0); menu_additem(menu, "2\r Flash", "13", 0); menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL, "\w Iesire" ); menu_display(id, menu, 0); } return PLUGIN_HANDLED; } public vips_online(id) { new sPlayers[32], iNum, iPlayer new sName[32] new szMenu[256], nLen, keys get_players(sPlayers, iNum, "ch") nLen += format(szMenu[nLen], 255-nLen,"\w V.I.P\r Online\w :^n^n") for(new a = 0; a < iNum ; a++) { iPlayer = sPlayers[a] if( IsUserVip( id ) ) { get_user_name(iPlayer, sName, sizeof sName - 1) nLen += format(szMenu[nLen], 255-nLen,"\r[\w Nume: \y%s\w | Acces: \yVIP\r ]^n", sName) } } keys = (1<<0|1<<1|1<<2|1<<3|1<<4|1<<5|1<<6|1<<9) show_menu(id,keys,szMenu,-1) return PLUGIN_HANDLED; } public vip_menu_handler(id, menu, item) { if( item == MENU_EXIT ) { menu_destroy(menu); return PLUGIN_HANDLED; } new data[6], iName[64]; new access, callback; menu_item_getinfo(menu, item, access, data,5, iName, 63, callback); new key = str_to_num(data); switch(key) { case 1: { if (count[id] >= 1) { ColorChat( id, RED, "^x04%s^x01 Ai voie^x03 deagle^x01 doar odata la^x03 2 minute !^x01",g_szTag) return PLUGIN_HANDLED; } if(is_user_alive(id)) { new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); give_item(id,DGLW4); new gL_DGLW4 = find_ent_by_owner(-1,DGLW4,id); cs_set_weapon_ammo(gL_DGLW4, 1); ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 Deagle^x01 cu^x03 1^x01 glont.", g_szTag ); ColorChat( 0, RED, "^x04%s^x01 VIP-ul^x03 %s^x01 si-a luat un^x03 deagle^x01 din meniu !", g_szTag, szName ); count[id]++ } return PLUGIN_HANDLED; } case 2: { if (count[id] >= 1) { ColorChat( id, RED, "^x04%s^x01 Ai voie^x03 gravity^x01 odata la^x03 2^x01 minute !",g_szTag) return PLUGIN_HANDLED; } if(is_user_alive(id)) { new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); set_user_gravity ( id, 0.8 ); set_task(10.0, "RemoveGravity", id); ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 650^x01 gravity^x03 10^x01 secunde !", g_szTag ); ColorChat( 0, RED, "^x04%s^x01 VIP-ul^x03 %s^x01 si-a luat^x03 650^x01 gravity din meniu !", g_szTag, szName ); count[id]++ } return PLUGIN_HANDLED; } case 3: { if (count[id] >= 1) { ColorChat( id, RED, "^x04%s^x01 Ai voie^x03 Godmode^x01 odata la^x03 2^x01 minute !",g_szTag) return PLUGIN_HANDLED; } if(is_user_alive(id)) { new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); set_user_godmode(id,1); ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 GodMode 10^x01 secunde !", g_szTag ); ColorChat( 0, RED, "^x04%s^x01 VIP-ul^x03 %s^x01 si-a luat^x03 Godmode^x01 din meniu !", g_szTag, szName ); set_task(10.0,"RemoveGodMode",id); count[id]++ } } case 4: { if (count[id] >= 1) { ColorChat( id, RED, "^x04%s^x01 Ai voie^x03 Noclip^x01 odata la^x03 2^x01 minute !",g_szTag) return PLUGIN_HANDLED; } if(is_user_alive(id)) { new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); set_user_noclip( id, 1 ); set_task(10.0,"RemoveNoClip",id); ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 NoClip 10^x01 secunde !", g_szTag ); ColorChat( 0, RED, "^x04%s^x01 VIP-ul^x03 %s^x01 si-a luat^x03 Noclip^x01 din meniu !", g_szTag, szName ); count[id]++ } return PLUGIN_HANDLED; } case 5: { if(is_user_alive(id)) { new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); set_user_armor( id, 75 ); ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 75^x01 armura !", g_szTag ); ColorChat( 0, RED, "^x04%s^x01 VIP-ul^x03 %s^x01 si-a luat^x03 armura^x01 din meniu !", g_szTag, szName ); } } case 6: { if(is_user_alive(id)) { new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); give_item(id,HE4); give_item(id,SM4); ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 1^x01 HE +^x03 1^x01 Smoke !", g_szTag ); ColorChat( 0, RED, "^x04%s^x01 VIP-ul^x03 %s^x01 si-a luat^x03 1^x01 HE +^x03 1^x01 Smoke din meniu !", g_szTag, szName ); } } case 7: { if(is_user_alive(id)) { new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); give_item(id,FL4); ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 2^x01 Flash !", g_szTag ); ColorChat( 0, RED, "^x04%s^x01 VIP-ul^x03 %s^x01 si-a luat^x03 2^x01 FlashBanguri din meniu !", g_szTag, szName ); } } case 8: { if (count[id] >= 1) { ColorChat( id, RED, "^x04%s^x01 Ai voie^x03 deagle^x01 doar odata la^x03 2^x01 minute !",g_szTag) return PLUGIN_HANDLED; } if(is_user_alive(id)) { new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); give_item(id,DGLW4); new gL_DGLW4 = find_ent_by_owner(-1,DGLW4,id); cs_set_weapon_ammo(gL_DGLW4, 1); ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 Deagle^x01 cu^x03 1^x01 glont .", g_szTag ); ColorChat( 0, RED, "^x04%s^x01 VIP-ul^x03 %s^x01 si-a luat un^x03 deagle^x01 din meniu !", g_szTag, szName ); count[id]++ } return PLUGIN_HANDLED; } case 9: { if (count[id] >= 1) { ColorChat( id, RED, "^x04%s^x01 Ai voie^x03 gravity^x01 odata la^x03 2^x01 minute !",g_szTag) return PLUGIN_HANDLED; } if(is_user_alive(id)) { new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); set_user_gravity ( id, 0.8 ); set_task(10.0, "RemoveGravity", id); ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 650^x01 gravity^x03 10^x01 secunde !", g_szTag ); ColorChat( 0, RED, "^x04%s^x01 VIP-ul^x03 %s^x01 si-a luat^x03 650^x01 gravity din meniu !", g_szTag, szName ); count[id]++ } return PLUGIN_HANDLED; } case 10: { if (count[id] >= 1) { ColorChat( id, RED, "^x04%s^x01 Ai voie^x03 Godmode^x01 odata la^x03 2^x01 minute !",g_szTag) return PLUGIN_HANDLED; } if(is_user_alive(id)) { new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); set_user_godmode(id,1); ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 GodMode 10^x01 secunde !", g_szTag ); ColorChat( 0, RED, "^x04%s^x01 VIP-ul^x03 %s^x01 si-a luat^x03 Godmode^x01 din meniu !", g_szTag, szName ); set_task(10.0,"RemoveGodMode",id); count[id]++ } } case 11: { if (count[id] >= 1) { ColorChat( id, RED, "^x04%s^x01 Ai voie^x03 Noclip^x01 odata la^x03 2^x01 minute !",g_szTag) return PLUGIN_HANDLED; } if(is_user_alive(id)) { new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); set_user_noclip( id, 1 ); set_task(10.0,"RemoveNoClip",id); ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 NoClip 10^x01 secunde !", g_szTag ); ColorChat( 0, RED, "^x04%s^x01 VIP-ul^x03 %s^x01 si-a luat^x03 Noclip^x01 din meniu !", g_szTag, szName ); count[id]++ } return PLUGIN_HANDLED; } case 12: { if(is_user_alive(id)) { new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); set_user_armor( id, 75 ); ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 75^x01 armura !", g_szTag ); ColorChat( 0, RED, "^x04%s^x01 VIP-ul^x03 %s^x01 si-a luat^x03 armura^x01 din meniu !", g_szTag, szName ); } } case 13: { if(is_user_alive(id)) { new szName[ 32 ]; get_user_name( id, szName, sizeof ( szName ) -1 ); give_item(id,FL4); ColorChat( id, RED, "^x04%s^x01 Ai primit^x03 2^x01 Flash !", g_szTag ); ColorChat( 0, RED, "^x04%s^x01 VIP-ul^x03 %s^x01 si-a luat^x03 2^x01 FlashBanguri din meniu !", g_szTag, szName ); } } } return PLUGIN_HANDLED; } public RemoveGravity(id) { set_user_gravity ( id, 1.0 ); ColorChat( id, RED, "^x04%s^x01 Gravitatia ta a expirat,ai primit inapoi^x03 700^x01 gravity !", g_szTag ); } public RemoveGodMode(id) { set_user_godmode(id,0); ColorChat( id, RED, "^x04%s^x03 GodMode^x01 a expirat !", g_szTag ); } public RemoveNoClip(id) { set_user_noclip( id, 0 ); ColorChat( id, RED, "^x04%s^x03 NoClip^x01 a expirat !", g_szTag ); } stock bool:IsUserVip( id ) { if( get_user_flags( id ) & read_flags( "v" ) ) return true; return false; } ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...) { new 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); // Make sure message is not longer than 192 character. Will crash the server. message[192] = '^0'; new 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[]) { static bool:saytext_used; static get_user_msgid_saytext; if(!saytext_used) { get_user_msgid_saytext = get_user_msgid("SayText"); saytext_used = true; } message_begin(type, get_user_msgid_saytext, _, id); write_byte(id) write_string(message); message_end(); } Team_Info(id, type, team[]) { static bool:teaminfo_used; static get_user_msgid_teaminfo; if(!teaminfo_used) { get_user_msgid_teaminfo = get_user_msgid("TeamInfo"); teaminfo_used = true; } 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() { new i = -1; while(i <= get_maxplayers()) { if(is_user_connected(++i)) return i; } return -1; }