Offline |
![Őskövület Őskövület](./images/ranks/hl21.png) |
![Avatar](./download/file.php?avatar=4691_1589321182.jpg) |
Csatlakozott: 2011.12.28. 00:35 Hozzászólások: 2736
Megköszönt másnak: 56 alkalommal Megköszönték neki: 275 alkalommal
|
Hali. Valaki be tudná állítani, hogy amit chatbe ír azt ne 6x írja le egymás utána hanem pl 2 percenként vagy egy körben csak 1x. Mert ez így elég idegesítő: [VIP] Ha szeretned latni a vipmenut, ird be: /vipmenu [VIP] Ha szeretned latni a vipmenut, ird be: /vipmenu [VIP] Ha szeretned latni a vipmenut, ird be: /vipmenu [VIP] Ha szeretned latni a vipmenut, ird be: /vipmenu [VIP] Ha szeretned latni a vipmenut, ird be: /vipmenu [VIP] Ha szeretned latni a vipmenut, ird be: /vipmenu /* Plugin generated by AMXX-Studio */ #include <amxmodx> #include <amxmisc> #include <hamsandwich> #include <fun> #include <cstrike> #include <fakemeta> #define PLUGIN "Surf Vip" #define VERSION "1.01" #define AUTHOR "eNz0" #define is_valid_player(%1) (1 <= %1 <= 32) #define CharsMax(%1) sizeof %1 - 1 static const COLOR[] = "^x04" new cvar_time, cvar_type, cvar_blockchat, cvar_team_tele, cvar_team_time, cvar_health, cvar_gravity, cvar_damage, cvar_speed new bool: g_used[33] new bool: g_team_tele new bool: g_speed[33] new bool: g_damage[33] new bool: used_weapons[33] new bool: used_tele[33] new bool: used_powers[33] static Float: start_time new const g_sound_beep[] = "weapons/c4button.wav"; new maxplayers new gmsgSayText new g_MsgSync /*================================================================================ [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 const TeamName[][] = { "", "TERRORIST", "CT", "SPECTATOR" } /*================================================================================ [Teleports] =================================================================================*/ #define TELEPORT_SOUND "common/bodydrop2.wav" #define VOL_ZERODOTSEVEN 0.7 static const CT_4SpawnOrigins[][ 3 ] = { { -214, 3715, 41 }, { -448, 3714, 41 }, { -223, 3311, 41 }, { -448, 3308, 41 } }; static const T_4SpawnOrigins[][ 3 ] = { { -778, 3705, 41 }, { -554, 3722, 41 }, { -778, 3288, 41 }, { -570, 3347, 41 } }; static const Scout_Place[][ 3 ] = { { -317, 943, -1161 }, { -672, 933, -1161 } }; static const Gun_Room[][ 3 ] = { { -689, -949, -138 }, { -590, -958, -138 }, { -485, -947, -138 }, { -396, -961, -138 }, { -324, -960, -138 }, { -688, -840, -138 }, { -594, -844, -138 }, { -486, -866, -138 }, { -398, -852, -138 }, { -331, -845, -138 }, { -383, -697, -138 }, { -317, -683, -138 } }; static const Mario_Room[][ 3 ] = { { 3610, 1053, -2317 }, { 3612, 629, -2317 }, { 3403, 1079, -2273 }, { 3081, 1091, -2317 }, { 3391, 641, -2317 }, { 3056, 578, -2317 }, { 3116, 285, -2275 }, { 3343, 245, -2317 } }; static const Awp_Place[][ 3 ] = { { 1795, -1070, -159 }, { 1544, -1075, -159 }, { 1304, -1072, -159 } }; /*================================================================================*/ public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) RegisterHam(Ham_Spawn, "player", "bacon_spawn", 1) RegisterHam(Ham_TakeDamage, "player", "bacon_damage") register_forward(FM_PlayerPreThink, "fwd_player_prethink") cvar_type = register_cvar("vip_type", "0") //1 - auto kiekviena spawn, 0 - Parasius /vipmenu) cvar_time = register_cvar("vip_time", "5.0") //Laikas iki vip menu pasirodymo (su 1 tipu) cvar_blockchat = register_cvar("vip_block_chat", "1") //Nerodyti, kai vipas paraso /vipmenu cvar_team_tele = register_cvar("vip_team_tele", "1") //Ijungti teleportus i spawn vietas cvar_team_time = register_cvar("vip_team_tele_time", "10") //Po kiek laiko ijungti spawn teleportus //Galiu meniu cvar_health = register_cvar("vip_extra_health", "50") //Papildomos vip gyvybes cvar_gravity = register_cvar("vip_gravity", "600") //Vip gravitacija cvar_damage = register_cvar("vip_dmg_multi", "1.5") //Vip multi zala (1.0 normali) cvar_speed = register_cvar("vip_speed", "300") //Vip greitis register_clcmd( "say /vipmenu", "vipmenu", ADMIN_LEVEL_H); register_clcmd("say /vip", "ShowMotd") register_clcmd( "say", "handle_say") register_event("HLTV", "event_new_round", "a", "1=0", "2=0") register_event("Damage", "on_damage", "b", "2!0", "3=0", "4!0") maxplayers = get_maxplayers() g_MsgSync = CreateHudSyncObj() gmsgSayText = get_user_msgid("SayText") } public client_connect(id) { new name[32]; get_user_name(id,name,31); if(vip(id)) ColorChat(0, RED, "^x04[VIP]^x01 V.I.P csatlakozott:^x03 %s", name); } public on_damage(id) { new attacker = get_user_attacker(id) if ( is_user_connected(id) && is_user_connected(attacker)) if (vip(attacker)) { new damage = read_data(2) set_hudmessage(0, 100, 200, -1.0, 0.55, 2, 0.1, 4.0, 0.02, 0.02, -1) ShowSyncHudMsg(attacker, g_MsgSync, "%i^n", damage) } } public event_new_round() { g_team_tele = false start_time = get_gametime() } public plugin_precache() { precache_sound( TELEPORT_SOUND ); engfunc(EngFunc_PrecacheSound, g_sound_beep); } public bacon_spawn(id) { if(task_exists(id)) remove_task(id) if(g_used[id]) g_used[id] = false if(vip(id) && (get_pcvar_num(cvar_type) == 1)) { set_task(get_pcvar_float(cvar_time), "menu_vip", id) } if(!(get_pcvar_num(cvar_type) == 1)) set_task(1.0, "PrintAd") used_powers[id] = false used_weapons[id] = false used_tele[id] = false g_speed[id] = false g_used[id] = false g_damage[id] = false } public PrintAd() { ColorChat(0, RED, "^x04[VIP]^x01 Ha szeretned latni a vipmenut, ird be:^x03 /vipmenu"); } public bacon_damage(victim, inflictor, attacker, Float:damage) { if (is_valid_player(attacker) && g_damage[attacker]) { damage *= get_pcvar_float(cvar_damage) SetHamParamFloat(4, damage) } } public fwd_player_prethink(id) { if(g_speed[id] && vip(id)) { new Float:speed speed = get_pcvar_float(cvar_speed) engfunc(EngFunc_SetClientMaxspeed, id, speed); set_pev(id, pev_maxspeed, speed); } } public vipmenu(id) { if(get_pcvar_num(cvar_type) == 0) { set_task(0.2, "menu_vip", id) } else if(get_pcvar_num(cvar_type) == 1) { ColorChat(0, RED, "^x04[VIP]^x01 VIP menu^x03 Automatikus!"); } else { set_task(0.2, "menu_vip", id) } if(get_pcvar_num(cvar_blockchat)) return PLUGIN_HANDLED return PLUGIN_CONTINUE } public menu_vip(id) { if(!is_user_alive(id)) return new map[ 32 ]; get_mapname( map, charsmax( map ) ); new menu = menu_create("\rSurf V.I.P Menü! \y[Cfg: Danii]", "menu_vip_handler"); if(vip(id)) { if(!used_weapons[id]) menu_additem(menu, "\w Fegyver menü", "1", 0); else if(used_weapons[id]) menu_additem(menu, "\d Fegyver menü", "1", 0); if(!used_powers[id]) menu_additem(menu, "\w Saját menü", "2", 0); else if(used_powers[id]) menu_additem(menu, "\d Saját menü", "2", 0); if( equal( map, "surf_ski_2" ) ) { if(!used_tele[id]) menu_additem(menu, "\wTelepor Menü", "3", 0); else if(used_tele[id]) menu_additem(menu, "\wTelepor Menü", "3", 0); } } else { menu_additem(menu, "\d Fegyver Menü", "1", 0); menu_additem(menu, "\d Saját Menü", "2", 0); menu_additem(menu, "\d Teleport Menü", "3", 0); menu_additem(menu, "\w V.I.P!", "4", 0); } menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); } public menu_vip_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); new map[ 32 ]; get_mapname( map, charsmax( map ) ); switch(key) { case 1: { if(!used_weapons[id]) { menu_weapons(id) used_weapons[id] = true ColorChat(id, RED, "^x04[VIP]^x04 Fegyver menu aktiv!") } else { ColorChat(id, RED, "^x04[VIP]^x03 Varjon a kovetkezo korig!") menu_vip(id) } } case 2: { if(!used_powers[id]) { second_menu(id) used_powers[id] = true ColorChat(id, RED, "^x04[VIP]^x04 Fegyver menu aktiv!") } else { ColorChat(id, RED, "^x04[VIP]^x03 Varjon a kovetkezo korig!") menu_vip(id) } } case 3: { if( equal( map, "surf_ski_2" ) ) { if(!used_tele[id]) { menu_teleport(id) used_tele[id] = true ColorChat(id, RED, "^x04[VIP]^x04 Teleport Menu aktiv!") } else { ColorChat(id, RED, "^x04[VIP]^x03 Varjon a kovetkezo korig!") menu_vip(id) } } } case 4: { ShowMotd(id) } } emit_sound(id, CHAN_VOICE, g_sound_beep, VOL_NORM, ATTN_NORM, 0, PITCH_NORM) menu_destroy(menu); return PLUGIN_HANDLED; } public menu_weapons(id) { if(!vip(id) || !is_user_alive(id)) return g_used[id] = true new menu = menu_create("\rSurf V.I.P fegyver Menü! \y[Cfg: Danii]", "weapon_menu_handler"); menu_additem(menu, "\w AK47 + M3", "1", 0); menu_additem(menu, "\d M4A1 + M3", "2", 0); menu_additem(menu, "\w AWP + M3", "3", 0); menu_additem(menu, "\d Gránátok + M3", "4", 0); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); } public weapon_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: { strip_user_weapons(id) cs_set_weapon_ammo( give_item( id, "weapon_m3" ), 8 ) cs_set_user_bpammo(id, CSW_M3, 32) cs_set_weapon_ammo( give_item( id, "weapon_ak47" ), 30 ) cs_set_user_bpammo(id, CSW_AK47, 90) give_item( id, "weapon_knife" ) cs_set_weapon_ammo( give_item( id, "weapon_deagle" ), 7 ) cs_set_user_bpammo(id, CSW_DEAGLE, 35) } case 2: { strip_user_weapons(id) cs_set_weapon_ammo( give_item( id, "weapon_m3" ), 8 ) cs_set_user_bpammo(id, CSW_M3, 32) cs_set_weapon_ammo( give_item( id, "weapon_m4a1" ), 30 ) cs_set_user_bpammo(id, CSW_M4A1, 90) give_item( id, "weapon_knife" ) cs_set_weapon_ammo( give_item( id, "weapon_deagle" ), 7 ) cs_set_user_bpammo(id, CSW_DEAGLE, 35) } case 3: { strip_user_weapons(id) cs_set_weapon_ammo( give_item( id, "weapon_m3" ), 8 ) cs_set_user_bpammo(id, CSW_M3, 32) cs_set_weapon_ammo( give_item( id, "weapon_awp" ), 10 ) cs_set_user_bpammo(id, CSW_AWP, 30) give_item( id, "weapon_knife" ) cs_set_weapon_ammo( give_item( id, "weapon_deagle" ), 7 ) cs_set_user_bpammo(id, CSW_DEAGLE, 35) } case 4: { strip_user_weapons(id) cs_set_weapon_ammo( give_item( id, "weapon_m3" ), 8 ) cs_set_user_bpammo(id, CSW_M3, 32) give_item(id, "weapon_hegrenade") give_item(id, "weapon_flashbang") give_item(id, "weapon_flashbang") give_item( id, "weapon_knife" ) cs_set_weapon_ammo( give_item( id, "weapon_deagle" ), 7 ) cs_set_user_bpammo(id, CSW_DEAGLE, 35) } } emit_sound(id, CHAN_VOICE, g_sound_beep, VOL_NORM, ATTN_NORM, 0, PITCH_NORM) menu_vip(id) menu_destroy(menu); return PLUGIN_HANDLED; } public second_menu(id) { if(!vip(id) || !is_user_alive(id)) return new menu = menu_create("\rSurf VIP Extra menü! \y[Cfg: Danii]", "second_menu_handler"); menu_additem(menu, "\w Kisebb gravitáció", "1", 0); menu_additem(menu, "\d Gyorsabb sebesség", "2", 0); menu_additem(menu, "\w Több élet", "3", 0); menu_additem(menu, "\d Nagyobb sebzés", "4", 0); menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); } public second_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: { new Float: gravity = get_pcvar_num(cvar_gravity) / 800.0 set_user_gravity(id, gravity) } case 2: { g_speed[id] = true } case 3: { set_user_health(id, get_user_health(id) + get_pcvar_num(cvar_health)) } case 4: { g_damage[id] = true } } new map[ 32 ]; get_mapname( map, charsmax( map ) ); if( equal( map, "surf_ski_2" ) ) menu_vip(id) emit_sound(id, CHAN_VOICE, g_sound_beep, VOL_NORM, ATTN_NORM, 0, PITCH_NORM) menu_destroy(menu); return PLUGIN_HANDLED; } public handle_say(id) { new said[192] read_args(said,192) if( ( containi(said, "who") != -1 && containi(said, "admin") != -1 ) || contain(said, "/vips") != -1 ) set_task(0.1,"print_adminlist",id) return PLUGIN_CONTINUE } public print_adminlist(user) { new adminnames[33][32] new message[256] new contactinfo[256], contact[112] new id, count, x, len for(id = 1 ; id <= maxplayers ; id++) if(is_user_connected(id)) if(get_user_flags(id) & ADMIN_LEVEL_H) get_user_name(id, adminnames[count++], 31) len = format(message, 255, "%s Online V.I.P: ",COLOR) if(count > 0) { for(x = 0 ; x < count ; x++) { len += format(message[len], 255-len, "%s%s ", adminnames[x], x < (count-1) ? ", ":"") if(len > 96 ) { print_message(user, message) len = format(message, 255, "%s ",COLOR) } } print_message(user, message) } else { len += format(message[len], 255-len, "Nincs jelent V.I.P!") print_message(user, message) } get_cvar_string("amx_contactinfo", contact, 63) if(contact[0]) { format(contactinfo, 111, "%s Contact Server Admin -- %s", COLOR, contact) print_message(user, contactinfo) } } print_message(id, msg[]) { message_begin(MSG_ONE, gmsgSayText, {0,0,0}, id) write_byte(id) write_string(msg) message_end() } public menu_teleport(id) { if(!vip(id) || !is_user_alive(id)) return new Float: cur_time= get_gametime() new menu = menu_create("\rSurf VIP Teleportáló Menü! \y[Cfg: Danii]", "teleport_menu_handler"); menu_additem(menu, "\w Fegyver szoba", "1", 0); menu_additem(menu, "\d Scout hely", "2", 0); menu_additem(menu, "\w Márió Szoba", "3", 0); menu_additem(menu, "\d Awp hely", "4", 0); if(get_pcvar_num(cvar_team_tele)) { if(cur_time - start_time >= get_pcvar_float(cvar_team_time)) { menu_additem(menu, "\w CT Oldal", "5", 0); menu_additem(menu, "\d T Oldal", "6", 0); g_team_tele = true } } menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0); } public teleport_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: { set_user_origin( id, Gun_Room[ random_num( 0, charsmax( Gun_Room ) ) ] ); } case 2: { set_user_origin( id, Scout_Place[ random_num( 0, charsmax( Scout_Place ) ) ] ); } case 3: { set_user_origin( id, Mario_Room[ random_num( 0, charsmax( Mario_Room ) ) ] ); } case 4: { set_user_origin( id, Awp_Place[ random_num( 0, charsmax( Awp_Place ) ) ] ); } case 5: { if(g_team_tele) set_user_origin( id, CT_4SpawnOrigins[ random_num( 0, charsmax( CT_4SpawnOrigins ) ) ] ); } case 6: { if(g_team_tele) set_user_origin( id, T_4SpawnOrigins[ random_num( 0, charsmax( T_4SpawnOrigins ) ) ] ); } } emit_sound( id, CHAN_STATIC, TELEPORT_SOUND, VOL_ZERODOTSEVEN, ATTN_NORM, 0, PITCH_NORM ); teleport_effect(id); menu_vip(id) menu_destroy(menu); return PLUGIN_HANDLED; } stock teleport_effect(index) { new Velocity[ 3 ]; set_pev( index, pev_velocity, Velocity ); new iOrigin[ 3 ]; get_user_origin( index, iOrigin, 0 ); message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); write_byte( TE_TELEPORT ); write_coord( iOrigin[ 0 ] ); write_coord( iOrigin[ 1 ] ); write_coord( iOrigin[ 2 ] ); message_end(); message_begin( MSG_PVS, SVC_TEMPENTITY, iOrigin ); write_byte( TE_TAREXPLOSION ); write_coord( iOrigin[ 0 ] ); write_coord( iOrigin[ 1 ] ); write_coord( iOrigin[ 2 ] ); message_end(); } public ShowMotd(id) { show_motd(id, "vip.txt") } /*================================================================================ [Colorchat] =================================================================================*/ ColorChat(id, Color:type, const msg[], any:...) { 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_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, players = get_maxplayers(); while(i <= players) { if(is_user_connected(++i)) return i; } return -1; } /*================================================================================*/ stock bool:vip(id) { return (get_user_flags(id) & ADMIN_LEVEL_H)? true : false } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par } */
|
|