Skocz do zawartości

Nowy szablon forum

mygo.pl

Stworzyliśmy dla Was nowy wygląd forum. Z pewnością znajdziesz rzeczy, które wg Ciebie mogą zostać zmienione - wspomnij o tym w specjalnym wątku.

Czytaj więcej

Jak założyć własną sieć

serwerów CS

Zastanawiasz się nad prowadzeniem własnej sieci serwerów? Przeczytaj podstawowe informacje, na które należy zwrócić uwagę, przy takim projekcie.

Czytaj więcej

Tworzymy spis sieci

dodaj swoją

Dodaj sieć do której należysz, pozwoli to na promocję i budowę ogólnopolskiej bazy sieci CS.

Czytaj więcej

MYGO.pl

RSSy
  • Postów

    28145
  • Dołączył

  • Ostatnia wizyta

    nigdy
  • Wygrane w rankingu

    11

Treść opublikowana przez MYGO.pl

  1. Hello, I've noticed that the server CMD doesn't show online players, even tho there are players connected to the server. How do I make it so that the CMD displays the players online? Or do I need some sort of plugin for that as well? Thank you ! Photos of the issue: #1 https://i.imgur.com/4ZdeTH3.png #2 https://i.imgur.com/tBLM6WB.png Przeczytaj cały wpis
  2. This is a lightweight version of Ultimate Gore plugin for Counter-Strike and Condition Zero. Gibs used are the default Half-Life ones, so no custom messages are needed. There is only 1 cvar "amx_gore" with 3 flags (default "ab"): a = Blood spray on death by headshot b = Gib on death by C4 explosion c = Gib on death by nade Remember to set these cvars in your server.cfg Code: violence_ablood 3 violence_hblood 3 violence_agibs 3 violence_hgibs 3Compatible with HLDS / ReHLDS and zBots. That's it. Have fun. Attached Files Get Plugin or Get Source (cs_gore_lite.sma - 2.6 KB) Przeczytaj cały wpis
  3. Hey, im interested in a plugin, which would push a message/log in the dedicated server's console whenever a player connects to a server, I'd appreciate if someone could help me out with that. Thanks ! Przeczytaj cały wpis
  4. Descriptionafter a period of time, you can self escape once from special infected's skill. kill horde or special infected can reduce the cooldown(optional). press shift buttons to query the current cooldown. occupy center text to print info when survivor is alive or afk. current support translation: chi(Simplified Chinese). I won't add more translations, you could make your own or ask another one. Cvars PHP Code: // duration to block boomer skill // - // Default: "3.0" // Minimum: "0.000000" escape_cooldown_block_time_boomer "3.0" // cooldown will decrease when killed a horde // - // Default: "1.5" // Minimum: "0.000000" escape_cooldown_reward_horde "1.5" // cooldown will decrease when killed a special_infected // - // Default: "5.0" // Minimum: "0.000000" escape_cooldown_reward_special_infected "5.0" // escape cooldown // - // Default: "60.0" // Minimum: "0.100000" escape_cooldown_time "60.0" Change log Spoiler Code: 1.0 (2024-02-27: -init public release. Attached Files escape_cooldown.phrases.txt (1.7 KB) Get Plugin or Get Source (escape_cooldown.sp - 20.8 KB) Wyświetl pełny artykuł
  5. I remember seeing something like this before but for the angels of me, I couldn't find it anywhere... While a player is holding the knoif he becomes less visible, partially transparent or something like that. Like that predator cloaking thing. 65% or even a bit more invisible/transparent would be noice. Przeczytaj cały wpis
  6. Hello, im looking for this particular mod port for my Half-Life server: https://forums.alliedmods.net/showth...hlight=minigun If anyone could assist me with that I'd greatly appreciate ! Przeczytaj cały wpis
  7. Hello, i use this plugin to change skin but when person change skin he need to touch 2 or 3 to show grenad or pistol and when set knife show skin not change directly. I mean when chose you need to set otherthing and when back skin change i need to make skin to change direct when you have knife PHP Code: #include <amxmodx> #include <cstrike> #include <cromchat> new const PLUGIN[] = "Knife Menu"; new const VERSION[] = "1.0"; new const AUTHOR[] = "RevCrew"; new const KNFModels[][] = { "models/v_knife.mdl", "models/RevCrewz/v_Knife1.mdl", "models/RevCrewz/v_Knife2.mdl", "models/RevCrewz/v_Knife3.mdl", "models/RevCrewz/v_Knife4.mdl" }; new const KNFMenuNames[][] = { "Knife [DEFAUT]", "Knife Gamma", "Knife Tatto's", "Knife Glace", "Knife Slice" }; new KNF[33]; public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR); register_clcmd("say /knife","KnfMenu"); register_event("CurWeapon", "CurentWeapon", "be", "1=1"); } public plugin_precache() { for(new i; i < sizeof KNFModels; i++) { precache_model(KNFModels[i]); } } public MenuKnf(id) { new menu = menu_create("\y>>>>> \rKnife Menu \y<<<<<^n \dby >>\rRevCrew\d<<", "KnfCase") menu_additem(menu, "Knife \r[DEFAUT]^n", "1", 0) menu_additem(menu, "\wKnife \yGamma", "2", 0) menu_additem(menu, "\wKnife \yTatto's", "3", 0) menu_additem(menu, "\wKnife \yGlace", "4", 0) menu_additem(menu, "\wKnife \ySlice", "5", 0) menu_setprop(menu, MPROP_EXIT, MEXIT_ALL); menu_display(id, menu, 0 ); return 1; } public KnfCase(id, menu, item) { if(item == MENU_EXIT) { return 1; } new nick[33]; get_user_name(id, nick, 32); KNF[id] = item; CC_SendMessage(id, "&x03%s &x01You Chouse &x04%s &x01as Your Knife", nick, KNFMenuNames[item]); menu_destroy (menu); return 1; } public CurentWeapon(id) { if(get_user_weapon(id) == CSW_KNIFE) { set_pev(id, pev_viewmodel2, KNFModels[KNF[id]]); } } public KnfMenu(id) { if(is_user_alive(id)) { MenuKnf(id); }else{ MenuKnf(id); } } Przeczytaj cały wpis
  8. Descriptionafter self revive by other plugins or mods, block the "thanks" scene, no soliloquize. Change log Spoiler Code: 1.0 (2024-02-25: -init public release. Attached Files Get Plugin or Get Source (block_self_revive_thanks_scene.sp - 4.6 KB) Wyświetl pełny artykuł
  9. i want to add ADMIN_LEVEL_G flag ,so only people with this flag can use /colors Add in the /colors menu the function Remove trail as the first options , when you select it the trail is removed and a Chat message shows "you remove your trail " Also this plugin is based on the first /trail plugin , when you say trail / trail " trail 12 blue" gives you trail color , remove this option, when you type: trail /trail colors /colors , this way you can only use it from the /colors menu. Code: /***************************************************************************************** * * plugin_trail.sma * * By Bahrmanou ([email protected]) * *****************************************************************************************/ /***************************************************************************************** If some map cause problem (crash the server) because of too much precaches, create a file in your AmxModx configs folder named 'sensiblemaps.cfg' and add the map name (WITHOUT the extension '.bsp') in that file. So if the map is in the list, the plugin prevents trail sprites to be precached (i.e. the trails are DISABLED for this map. *****************************************************************************************/ #include <amxmodx> #include <amxmisc> #include <engine> #define PLUGNAME "plugin_trail" #define VERSION "1.3.1" #define AUTHOR "Bahrmanou" #define ACCESS_LEVEL ADMIN_LEVEL_A #define ACCESS_ADMIN ADMIN_ADMIN #define MAX_TEXT_LENGTH 200 #define MAX_NAME_LENGTH 40 #define MAX_PLAYERS 32 #define MAX_DISTANCE 300 #define CFG_FILE "colors.cfg" #define MAX_COLORS 200 #define DEF_TRAIL_LIFE 2 #define TASKID 1337 // change if it interfere with another plugin! #define TICK 0.1 #define NUM_SPRITES 12 new bool:gl_parsed new bool:gl_trail new bool:gl_not_this_map new gl_trail_life new gl_trail_size[MAX_PLAYERS] new gl_trail_brightness[MAX_PLAYERS] new gl_trail_type[MAX_PLAYERS] new gl_sprite_name[NUM_SPRITES][] = { "sprites/laserbeam.spr", "sprites/blueflare1.spr", "sprites/dot.spr", "sprites/flare5.spr", "sprites/flare6.spr", "sprites/plasma.spr", "sprites/smoke.spr", "sprites/xbeam5.spr", "sprites/xenobeam.spr", "sprites/xssmke1.spr", "sprites/zbeam3.spr", "sprites/zbeam2.spr" } new gl_sprite[NUM_SPRITES] new gl_def_sprite_size[NUM_SPRITES] = { 5, 12, 4, 16, 16, 6, 9, 4, 15, 14, 15, 20 } new gl_def_sprite_brightness[NUM_SPRITES] = { 160, 255, 200, 255, 255, 230, 150, 150, 240, 220, 200, 200 } new gl_players[MAX_PLAYERS] new gl_player_position[MAX_PLAYERS][3] new gl_timer_count[MAX_PLAYERS] new gl_timer_limit new gl_player_colors[MAX_PLAYERS][3] new gl_color_names[MAX_COLORS][MAX_NAME_LENGTH] new gl_colors[MAX_COLORS][3] new gl_num_colors public plugin_init() { register_plugin(PLUGNAME, VERSION, AUTHOR) register_concmd("amx_trail","cmdTrail", ACCESS_LEVEL, "- ['on'|'off'|'1'|'0'] : enable/disable trails.") register_concmd("amx_trail_user","cmdUserTrail", ACCESS_LEVEL, "- <name or #userid> <colorname | 'random' | 'off'> : set user trail.") register_concmd("amx_trail_type", "cmdTrailType", ACCESS_LEVEL, "- <type> : set trail type for all players.") register_concmd("amx_trail_life","cmdTrailLife", ACCESS_LEVEL, "- [duration] : get/set trail duration, in seconds.") register_concmd("amx_trail_size","cmdTrailSize", ACCESS_LEVEL, "- [size] : get/set trail size.") register_concmd("amx_trail_brightness","cmdTrailBrightness", ACCESS_LEVEL, "- [brightness] : get/set trail brightness.") register_concmd("amx_trail_reload", "cmdReload", ACCESS_LEVEL, ": reload colors configuration file.") register_clcmd("say /colors", "trails_menu") register_clcmd("say", "SayCmd", 0, "") gl_parsed = gl_trail = parse_file() if (!gl_sprite[0]) gl_trail = false gl_trail_life = DEF_TRAIL_LIFE gl_timer_limit = floatround(float(gl_trail_life)/TICK) } public plugin_modules() { require_module("engine") } public plugin_precache() { if (check_map()) { gl_not_this_map = true return } for (new i=0; i<NUM_SPRITES; i++) { gl_sprite[i] = precache_model(gl_sprite_name[i]) } } public client_putinserver(id) { gl_trail_type[id] = gl_sprite[0] gl_trail_size[id] = gl_def_sprite_size[0] gl_trail_brightness[id] = gl_def_sprite_brightness[0] } public client_disconnect(id) { if (task_exists(TASKID+id)) remove_task(TASKID+id) gl_player_colors[id][0] = gl_player_colors[id][1] = gl_player_colors[id][2] = 0 } /***************************************************************************************** * * cmdTrail ['on'|'off'|'1'|'0'] : enable/disable trails. * *****************************************************************************************/ public cmdTrail(id, level, cid) { if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED if (!gl_parsed) { console_print(id, "Trails are OFF because I couldn't read the config file '%s'!", CFG_FILE) return PLUGIN_HANDLED } if (gl_not_this_map) { console_print(id, "Trails are disabled for this map!") return PLUGIN_HANDLED } new str[5] read_argv(1, str, 4) if (equali(str, "on") || equali(str, "1")) { if (gl_trail) { console_print(id, "Trails are already enabled.") } else { gl_trail = true console_print(id, "Trails are now ENABLED.") } } else if (equali(str, "off") || equali(str, "0")) { if (!gl_trail) { console_print(id, "Trails are already disabled.") }else { gl_trail = false new playercount get_players(gl_players, playercount) for (new i=0; i<playercount; i++) { kill_trail_task(gl_players[i]) } say_to_all("Your trail has been removed.", id) console_print(id, "Trails are now DISABLED.") } } else { if (gl_trail) { console_print(id, "Trails are ENABLED.") } else { console_print(id, "Trails are DISABLED.") } } return PLUGIN_HANDLED } /***************************************************************************************** * * cmdUserTrail <name or #userid> <colorname | 'random' | 'off'> : set user trail. * *****************************************************************************************/ public cmdUserTrail(id, level, cid) { if (!cmd_access(id, level, cid, 3)) return PLUGIN_HANDLED if (!gl_parsed) { console_print(id, "Trails are OFF because I couldn't read the config file '%s'!", CFG_FILE) return PLUGIN_HANDLED } if (gl_not_this_map) { console_print(id, "Trails are disabled for this map!") return PLUGIN_HANDLED } new user[MAX_NAME_LENGTH+1], colorname[MAX_NAME_LENGTH] new plName[MAX_NAME_LENGTH+1] read_argv(1, user, MAX_NAME_LENGTH) read_argv(2, colorname, MAX_NAME_LENGTH-1) new player = cmd_target(id, user, 6) if (!player) { console_print(id, "Unknown player: %s", user) return PLUGIN_HANDLED } get_user_name(player, plName, MAX_NAME_LENGTH) if (access(player, ADMIN_IMMUNITY) && id!=player) { console_print(id, "You cannot do that to %s, you silly bear!", plName) return PLUGIN_HANDLED } if (!is_user_alive(player)) { console_print(id, "Only alive players, please!") return PLUGIN_HANDLED } if (equali(colorname, "off")) { if (!gl_player_colors[player][0] && !gl_player_colors[player][1] && !gl_player_colors[player][2]) { console_print(id, "The %s's trail is already off!", plName) return PLUGIN_HANDLED } kill_trail_task(player) console_print(id, "The %s's trail has been removed.", plName) client_print(player, print_chat, "Your trail has been removed.") } else if (equali(colorname, "random")) { do_trail(player, "", "") console_print(id, "%s has now a random color trail.", plName) } else { do_trail(player, colorname, "") console_print(id, "%s has now a %s trail.", plName, colorname) } return PLUGIN_HANDLED } /***************************************************************************************** * * cmdTrailType <type> : set trail type (sprite) for all players * *****************************************************************************************/ public cmdTrailType(id, level, cid) { if (!cmd_access(id, level, cid, 2)) return PLUGIN_HANDLED if (!gl_parsed) { console_print(id, "Trails are OFF becaus I couldn't read the config file '%s'!", CFG_FILE) return PLUGIN_HANDLED } if (gl_not_this_map) { console_print(id, "Trails are disabled for this map!") return PLUGIN_HANDLED } new str[5], type read_argv(1, str, 4) type = str_to_num(str) if (type<1 || type>NUM_SPRITES) { console_print(id, "Type must be in [1,%d] range!", NUM_SPRITES) return PLUGIN_HANDLED } for (new i=0; i<MAX_PLAYERS; i++) { gl_trail_type[i] = gl_sprite[type-1] gl_trail_size[i] = gl_def_sprite_size[type-1] gl_trail_brightness[i] = gl_def_sprite_brightness[type-1] } restart_player_trail(id) return PLUGIN_HANDLED } /***************************************************************************************** * * cmdTrailLife [duration] : get/set trail duration, in seconds. * *****************************************************************************************/ public cmdTrailLife(id, level, cid) { if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED if (!gl_parsed) { console_print(id, "Trails are OFF because I couldn't read the config file '%s'!", CFG_FILE) return PLUGIN_HANDLED } if (gl_not_this_map) { console_print(id, "Trails are disabled for this map!") return PLUGIN_HANDLED } new Str[3], life read_argv(1, Str, 2) if (!Str[0]) { console_print(id, "Trail life is currently %d seconds.", gl_trail_life) return PLUGIN_HANDLED } life = str_to_num(Str) if (life<1 || life>30) { console_print(id, "Trail life must be in [1,30] range!") return PLUGIN_HANDLED } gl_trail_life = life gl_timer_limit = floatround(float(life)/TICK) restart_players_trails() return PLUGIN_HANDLED } /***************************************************************************************** * * cmdTrailSize [size] : get/set trail size. * *****************************************************************************************/ public cmdTrailSize(id, level, cid) { if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED if (!gl_parsed) { console_print(id, "Trails are OFF because I couldn't read the config file '%s'!", CFG_FILE) return PLUGIN_HANDLED } if (gl_not_this_map) { console_print(id, "Trails are disabled for this map!") return PLUGIN_HANDLED } new Str[3], size read_argv(1, Str, 2) if (!Str[0]) { console_print(id, "Your trail size is currently %d.", gl_trail_size[id]) return PLUGIN_HANDLED } size = str_to_num(Str) if (size<1) { console_print(id, "Trail size must be positive!") return PLUGIN_HANDLED } gl_trail_size[id] = size restart_player_trail(id) return PLUGIN_HANDLED } /***************************************************************************************** * * cmdTrailBrightness [brightness] : get/set trail brightness. * *****************************************************************************************/ public cmdTrailBrightness(id, level, cid) { if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED if (!gl_parsed) { console_print(id, "Trails are OFF because I couldn't read the config file '%s'!", CFG_FILE) return PLUGIN_HANDLED } if (gl_not_this_map) { console_print(id, "Trails are disabled for this map!") return PLUGIN_HANDLED } new Str[3], bright read_argv(1, Str, 3) if (!Str[0]) { console_print(id, "Your trail brightness is currently %d.", gl_trail_brightness[id]) return PLUGIN_HANDLED } bright = str_to_num(Str) if (bright<1 || bright>255) { console_print(id, "Brightness must be in [1,255] range!") return PLUGIN_HANDLED } gl_trail_brightness[id] = bright restart_player_trail(id) return PLUGIN_HANDLED } /***************************************************************************************** * * cmdReload : reload configuration file. * *****************************************************************************************/ public cmdReload(id, level, cid) { if (!cmd_access(id, level, cid, 1)) return PLUGIN_HANDLED if (gl_not_this_map) { console_print(id, "Trails are disabled for this map!") return PLUGIN_HANDLED } gl_parsed = parse_file() if (gl_parsed) { console_print(id, "Ok, configuration file successfuly reloaded.") } else { console_print(id, "Uh Oh...There was a problem! Please check your amx log file to know whats causing this.") } return PLUGIN_HANDLED } /***************************************************************************************** * * sayCmd : say trail <[['light'|'dark'] colorname] | ['random'] | ['off'] | ['help']> * *****************************************************************************************/ public SayCmd(id, level, cid) { new args[128], msg[200], plName[MAX_NAME_LENGTH], colname[MAX_NAME_LENGTH], arg2[MAX_NAME_LENGTH], arg3[MAX_NAME_LENGTH], typenum read_args(args, 128) remove_quotes(args) if (equali(args, "trail", 5)) { if (!gl_trail) { client_print(id, print_chat, "Trails have been disabled.") return PLUGIN_HANDLED } if (gl_not_this_map) { client_print(id, print_chat, "Trails have been disabled for this map.") return PLUGIN_HANDLED } get_user_name(id, plName, MAX_NAME_LENGTH) if (!get_user_team(id) && !access(id, ADMIN_ADMIN)) { client_print(id, print_chat, "You must be playing!") return PLUGIN_HANDLED } if (!args[5]) { do_trail(id, "", "") return PLUGIN_HANDLED } else { parse(args[6], colname, MAX_NAME_LENGTH, arg2, MAX_NAME_LENGTH, arg3, MAX_NAME_LENGTH) // console_print(id, "restline = '%s'", restline) typenum = str_to_num(colname) } if (equali(colname, "off")) { if (!gl_player_colors[id][0] && !gl_player_colors[id][1] && !gl_player_colors[id][2]) { client_print(id, print_chat, "Your trail is already off!") return PLUGIN_HANDLED } kill_trail_task(id) client_print(id, print_chat, "Your trail was removed.") format(msg, 199, "%s's trail was removed.", plName) say_to_all(msg, id) return PLUGIN_HANDLED } else if (equali(colname, "random")) { do_trail(id, "", "") return PLUGIN_HANDLED } else if (equali(colname, "help")) { trail_help(id) return PLUGIN_HANDLED } if (typenum) { if (typenum<1 || typenum>NUM_SPRITES) { client_print(id, print_chat, "Type must be in the range [1,%d].", NUM_SPRITES) return PLUGIN_HANDLED } typenum-- gl_trail_type[id] = gl_sprite[typenum] gl_trail_size[id] = gl_def_sprite_size[typenum] gl_trail_brightness[id] = gl_def_sprite_brightness[typenum] if (arg2[0]) { colname = arg2 arg2 = arg3 } else { if (!gl_player_colors[id][0] && !gl_player_colors[id][1] && !gl_player_colors[id][2]) { do_trail(id, "", "") return PLUGIN_HANDLED } new r = gl_player_colors[id][0] new g = gl_player_colors[id][1] new b = gl_player_colors[id][2] kill_trail_task(id) gl_player_colors[id][0] = r gl_player_colors[id][1] = g gl_player_colors[id][2] = b get_user_origin(id, gl_player_position[id]) set_task(TICK, "check_position", TASKID+id, "", 0, "b") trail_msg(id) client_print(id, print_chat, "You have a trail of type %d.", typenum+1) format(msg, 199, "%s has a type %d trail.", plName, typenum+1) say_to_all(msg, id) return PLUGIN_HANDLED } } if (equali(colname, "dark")) { copy(colname, MAX_NAME_LENGTH-1, arg2) if (!colname[0]) { client_print(id, print_chat, "Specify a color name!") return PLUGIN_HANDLED } do_trail(id, colname, "dark") } else if (equali(colname, "light")) { copy(colname, MAX_NAME_LENGTH-1, arg2) if (!colname[0]) { client_print(id, print_chat, "Specify a color name!") return PLUGIN_HANDLED } do_trail(id, colname, "light") } else { do_trail(id, colname, "") } } return PLUGIN_CONTINUE } /***************************************************************************************** *****************************************************************************************/ do_trail(id, colname[], intensity[]) { new i, msg[200] new name[33] get_user_name(id, name, 32) if (!colname[0]) { kill_trail_task(id) gl_player_colors[id][0] = random(256) gl_player_colors[id][1] = random(256) gl_player_colors[id][2] = random(256) get_user_origin(id, gl_player_position[id]) set_task(TICK, "check_position", TASKID+id, "", 0, "b") trail_msg(id) client_print(id, print_chat, "You have a random color trail.") format(msg, 199, "%s has a random color trail.", name) say_to_all(msg, id) return } for (i=0; i<gl_num_colors; i++) { if (equali(colname, gl_color_names[i])) { new Float:intens, r, g, b if (equali(intensity, "dark")) { intens = 0.5 } else if (equali(intensity, "light")) { intens = 2.0 } else { copy(intensity, 1, "") intens = 1.0 } kill_trail_task(id) r = floatround(float(gl_colors[i][0]) * intens) g = floatround(float(gl_colors[i][1]) * intens) b = floatround(float(gl_colors[i][2]) * intens) gl_player_colors[id][0] = min(r, 255) gl_player_colors[id][1] = min(g, 255) gl_player_colors[id][2] = min(b, 255) get_user_origin(id, gl_player_position[id]) set_task(TICK, "check_position", TASKID+id, "", 0, "b") trail_msg(id) if (intensity[0]) { client_print(id, print_chat, "You have a %s %s trail.", intensity, colname) format(msg, 199, "%s has now a %s %s trail.", name, intensity, colname) } else { client_print(id, print_chat, "You have a %s trail.", colname) format(msg, 199, "%s has now a %s trail.", name, colname) } say_to_all(msg, id) return } } client_print(id, print_chat, "Sorry, %s, but I dont recognize the color '%s'!", name, colname) return } /***************************************************************************************** *****************************************************************************************/ public check_position(taskid) { new origin[3], id = taskid-TASKID if (!get_user_team(id)) { kill_trail_msg(id) return } get_user_origin(id, origin) if (origin[0]!=gl_player_position[id][0] || origin[1]!=gl_player_position[id][1] || origin[2]!=gl_player_position[id][2]) { if (get_distance(origin, gl_player_position[id])>MAX_DISTANCE || gl_timer_count[id] >= gl_timer_limit/2) { kill_trail_msg(id) trail_msg(id) } gl_player_position[id][0] = origin[0] gl_player_position[id][1] = origin[1] gl_player_position[id][2] = origin[2] gl_timer_count[id] = 0 } else { if (gl_timer_count[id] < gl_timer_limit) gl_timer_count[id]++ } } /***************************************************************************************** *****************************************************************************************/ kill_trail_task(id) { if (task_exists(TASKID+id)) remove_task(TASKID+id) kill_trail_msg(id) gl_player_colors[id][0] = gl_player_colors[id][1] = gl_player_colors[id][2] = 0 } /***************************************************************************************** *****************************************************************************************/ kill_trail_msg(id) { gl_timer_count[id] = 0 message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(99) // TE_KILLBEAM write_short(id) message_end() } /***************************************************************************************** *****************************************************************************************/ trail_msg(id) { message_begin(MSG_BROADCAST, SVC_TEMPENTITY) write_byte(22) // TE_BEAMFOLLOW write_short(id) write_short(gl_trail_type[id]) write_byte(gl_trail_life*10) write_byte(gl_trail_size[id]) write_byte(gl_player_colors[id][0]) write_byte(gl_player_colors[id][1]) write_byte(gl_player_colors[id][2]) write_byte(gl_trail_brightness[id]) message_end() } /***************************************************************************************** *****************************************************************************************/ restart_player_trail(id) { if (task_exists(TASKID+id)) { remove_task(TASKID+id) kill_trail_msg(id) get_user_origin(id, gl_player_position[id]) set_task(TICK, "check_position", TASKID+id, "", 0, "b") trail_msg(id) } } /***************************************************************************************** *****************************************************************************************/ restart_players_trails() { new playercount get_players(gl_players, playercount) for (new i=0; i<playercount; i++) { restart_player_trail(gl_players[i]) } } /***************************************************************************************** *****************************************************************************************/ say_to_all(msg[], id) { new playercount get_players(gl_players, playercount) for (new i=0; i<playercount; i++) { if (gl_players[i]!=id) client_print(gl_players[i], print_chat, msg) } } /***************************************************************************************** *****************************************************************************************/ trail_help(id) { new msg[200], clen=0 console_print(id, "^nTrail Colors List:^n") for (new i=0; i<gl_num_colors; i++) { clen += format(msg[clen], 199-clen, "%s ", gl_color_names[i]) if (clen > 80) { console_print(id, msg) copy(msg, 1, "") clen = 0 } } console_print(id, "^nNOTE: All colors can be prefixed by the words 'light' or 'dark'.^n") console_print(id, "^nSay 'trail <color>' to get a colored trail.^nSay 'trail off' to turn trail off.") console_print(id, "Say 'trail <number> [color]' to change the look of the trail.^n") console_print(id, "^nExamples:") console_print(id, " trail") console_print(id, " trail off") console_print(id, " trail tomato") console_print(id, " trail 6 gold") console_print(id, " trail 11 light blue") client_print(id, print_chat, "The colors list has been displayed in your console.") } /***************************************************************************************** *****************************************************************************************/ bool:parse_file() { new got_line, line_num=0, len=0, parsed new r[3][4], g[3][4], b[3][4] new full_line[MAX_TEXT_LENGTH], rest_line[MAX_TEXT_LENGTH], cfgdir[MAX_TEXT_LENGTH], cfgpath[MAX_TEXT_LENGTH] gl_num_colors = 0 get_configsdir(cfgdir, MAX_TEXT_LENGTH) format(cfgpath, MAX_TEXT_LENGTH, "%s/%s", cfgdir, CFG_FILE) if (!file_exists(cfgpath)) { log_amx("ERROR: Cannot find configuration file '%s'!", cfgpath) return false } got_line = read_file(cfgpath, line_num, full_line, MAX_TEXT_LENGTH, len) if (got_line <=0) { log_amx("ERROR: Cannot read configuration file '%s'!", cfgpath) return false } while (got_line>0) { if (!equal(full_line, "//", 2) && len) { strtok(full_line, gl_color_names[gl_num_colors], MAX_NAME_LENGTH, rest_line, MAX_TEXT_LENGTH, ' ', 1) copy(full_line, MAX_TEXT_LENGTH, rest_line) parsed = parse(full_line,r[0],3,g[0],3,b[0],3) if (parsed<3) { log_amx("ERROR: Not enough colors, line %d in configuration file '%s'!", 1+line_num, CFG_FILE) return false } gl_colors[gl_num_colors][0] = str_to_num(r[0]) gl_colors[gl_num_colors][1] = str_to_num(g[0]) gl_colors[gl_num_colors][2] = str_to_num(b[0]) gl_num_colors++ if (gl_num_colors>=MAX_COLORS) { log_amx("WARNING: Max colors reached in file '%s'!", CFG_FILE) return true } } line_num++ got_line = read_file(cfgpath, line_num, full_line, MAX_TEXT_LENGTH, len) } return true } check_map() { new got_line, line_num, len new cfgdir[MAX_TEXT_LENGTH] new cfgpath[MAX_TEXT_LENGTH] new mapname[MAX_NAME_LENGTH] new txt[MAX_TEXT_LENGTH] get_configsdir(cfgdir, MAX_TEXT_LENGTH-1) get_mapname(mapname, MAX_NAME_LENGTH-1) format(cfgpath, MAX_TEXT_LENGTH, "%s/sensiblemaps.cfg", cfgdir) if (file_exists(cfgpath)) { got_line = read_file(cfgpath, line_num, txt, MAX_TEXT_LENGTH-1, len) while (got_line>0) { if (equali(txt, mapname)) return 1 line_num++ got_line = read_file(cfgpath, line_num, txt, MAX_TEXT_LENGTH-1, len) } } return 0 } public trails_menu(id) { static i,menu menu = menu_create("Trails Colors","selected_trails") for(i=0; i<gl_num_colors; i++) menu_additem(menu,gl_color_names[i]) menu_setprop(menu, MPROP_EXIT, MEXIT_ALL) menu_display(id, menu, 0) } public selected_trails(id,menu,item) { do_trail(id, gl_color_names[item], "") } Przeczytaj cały wpis
  10. this plugin makes your incapacitated health bar cleaner. Change log Spoiler Code: 1.5 (2024-02-25: -minor improve. Attached Files Get Plugin or Get Source (remove_health_buffer_when_incapped.sp - 2.5 KB) Wyświetl pełny artykuł
  11. MYGO.pl

    RSS[Solved] No

    Result ya Przeczytaj cały wpis
  12. Greetings I've got a blockmaker that I'm trying to fix but I can't When I try to change the block size it's always the normal model and can't figure out what's the problem The models work fine in other Blockmakers but in this one it's always normal :X I need the pole/large/small to work with their models Much Appreciation Attached Files Get Plugin or Get Source (2.sma - 179.0 KB) Przeczytaj cały wpis
  13. Hi is there any modification of ZombiePlague 4.3 with only infection mod (removed swarm, multi, neme, surv etc) Przeczytaj cały wpis
  14. Hola, ¿puedes darme un complemento cuando un jugador se coloque cuchillo se vuelva invisible pero si saca arma se vuelva visible. Przeczytaj cały wpis
  15. If I send text messages via RCON to my CS2 server it looks ingame like this: Console: Hello world! Is it possible (or is there already a plugin) that can interpret these messages and rewrite them in color so the players on the server can see the message easier? Like: Admin: Hello world! Regards Bl4CkGuuN Przeczytaj cały wpis
  16. Hello, forgive me if this has already been asked/discussed, Im currently in a process of opening my HL: Deathmatch server, but I've noticed that there's some sort of anti bhop or speed cap which prevents players from gaining higher speeds. I've join other servers which do not have such issue so I was wondering if there's a plugin that fixes my described issue or maybe I need to tweak something within the server files? Sorry for newbie question -tiltedShrimp Przeczytaj cały wpis
  17. Hello everyone, this plugin separates the arm skins for each team. The only problem is that it doesn't work when I watch a replay on HLTV, the default arm always remains for both teams. PHP Code: #include <amxmodx> #include <cstrike> #include <fakemeta> #include <hamsandwich> new const VIEW_MODEL[][] = { "models/alt/v_knife.mdl", //0 "models/alt/v_p228.mdl", //1 "models/alt/v_knife.mdl", //2 "models/alt/v_scout.mdl", //3 "models/alt/v_hegrenade.mdl", //4 "models/alt/v_xm1014.mdl", //5 "models/alt/v_c4.mdl", //6 "models/alt/v_mac10.mdl", //7 "models/alt/v_aug.mdl", //8 "models/alt/v_smokegrenade.mdl",//9 "models/alt/v_elite.mdl", //10 "models/alt/v_fiveseven.mdl", //11 "models/alt/v_ump45.mdl", //12 "models/alt/v_sg550.mdl", //13 "models/alt/v_galil.mdl", //14 "models/alt/v_famas.mdl", //15 "models/alt/v_usp.mdl", //16 "models/alt/v_glock18.mdl", //17 "models/alt/v_awp.mdl", //18 "models/alt/v_mp5.mdl", //19 "models/alt/v_m249.mdl", //20 "models/alt/v_m3.mdl", //21 "models/alt/v_m4a1.mdl", //22 "models/alt/v_tmp.mdl", //23 "models/alt/v_g3sg1.mdl", //24 "models/alt/v_flashbang.mdl", //25 "models/alt/v_deagle.mdl", //26 "models/alt/v_sg552.mdl", //27 "models/alt/v_ak47.mdl", //28 "models/alt/v_knife.mdl", //29 "models/alt/v_p90.mdl" //30 } new const OLD_MODEL[][] = { "", //0 "models/v_p228.mdl", //1 "", //2 "models/v_scout.mdl", //3 "models/v_hegrenade.mdl", //4 "models/v_xm1014.mdl", //5 "models/v_c4.mdl", //6 "models/v_mac10.mdl", //7 "models/v_aug.mdl", //8 "models/v_smokegrenade.mdl", //9 "models/v_elite.mdl", //10 "models/v_fiveseven.mdl", //11 "models/v_ump45.mdl", //12 "models/v_sg550.mdl", //13 "models/v_galil.mdl", //14 "models/v_famas.mdl", //15 "models/v_usp.mdl", //16 "models/v_glock18.mdl", //17 "models/v_awp.mdl", //18 "models/v_mp5.mdl", //19 "models/v_m249.mdl", //20 "models/v_m3.mdl", //21 "models/v_m4a1.mdl", //22 "models/v_tmp.mdl", //23 "models/v_g3sg1.mdl", //24 "models/v_flashbang.mdl", //25 "models/v_deagle.mdl", //26 "models/v_sg552.mdl", //27 "models/v_ak47.mdl", //28 "models/v_knife.mdl", //29 "models/v_p90.mdl" //30 } new const g_weapons[][] = { "weapon_p228", "weapon_scout", "weapon_hegrenade", "weapon_xm1014", "weapon_c4", "weapon_mac10", "weapon_aug", "weapon_smokegrenade", "weapon_elite", "weapon_fiveseven", "weapon_ump45", "weapon_sg550", "weapon_galil", "weapon_famas", "weapon_usp", "weapon_glock18", "weapon_awp", "weapon_mp5navy", "weapon_m249", "weapon_m3", "weapon_m4a1", "weapon_tmp", "weapon_g3sg1", "weapon_flashbang", "weapon_deagle", "weapon_sg552", "weapon_ak47", "weapon_knife", "weapon_p90" } const m_pPlayer = 41; new cvar_alteam, primer[33]; public plugin_init() { register_plugin("CS:GO Arm Switcher Lite", "2.6", "Cheap_Suit & hellmonja"); register_event("CurWeapon", "Event_CurWeapon", "be","1=1"); RegisterHam(Ham_AddPlayerItem, "player", "FwdAddItem"); for(new i = 0; i <= sizeof g_weapons - 1; i++) RegisterHam(Ham_Item_Deploy, g_weapons[i], "Fw_ItemDeploy", 1); cvar_alteam = register_cvar("armsw_team", "1"); } public plugin_precache() { for(new i = 0; i <= CSW_P90; i++) precache_model(VIEW_MODEL[i]); } public Event_CurWeapon(id) { if(!is_user_connected(id) || !is_user_alive(id)) return if(!primer[id]) { switch_arms(id, get_user_weapon(id)); primer[id] = 1; } } public Fw_ItemDeploy(weapon) { static id; id = get_pdata_cbase(weapon, m_pPlayer, 4); if(!is_user_connected(id) || !is_user_alive(id)) return PLUGIN_HANDLED if(get_pcvar_num(cvar_alteam) <= 0 || get_pcvar_num(cvar_alteam) >= 3) return PLUGIN_CONTINUE switch_arms(id, cs_get_weapon_id(weapon)); return PLUGIN_CONTINUE } public FwdAddItem(id) { switch_arms(id, get_user_weapon(id)); } switch_arms(id, wpnid) { static model[32]; pev(id, pev_viewmodel2, model, 31); if(get_user_team(id) == get_pcvar_num(cvar_alteam) && equali(model, OLD_MODEL[wpnid])) set_pev(id, pev_viewmodel2, VIEW_MODEL[wpnid]); return PLUGIN_CONTINUE } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par } */ Przeczytaj cały wpis
  18. Offline game mod zp5.0.8 I want to add fps next to ammo in the bottom left bar? Przeczytaj cały wpis
  19. When you were rescued by the other players, you realized you had no primary weapon, and now I've fixed it to give primary weapons at any opportunity. Attached Files Get Plugin or Get Source (l4d_Rescuer weapon fix.sp - 1.5 KB) Wyświetl pełny artykuł
  20. Hello, first of all I apologize if the topic is in the wrong section. I'm looking for MrHellish's plugin, it was called nativepro, but I can't find it, it was used for admin rights and more precisely for admins who are added by nick to use their rights with another nick, I think the command was amx_goadmin. Adding admins by STEAMID or IP doesn't work for me. thanks in advance Edit: now i see that i have put the topic in sourcemod, please move it. It is about counter strike 1.6 Przeczytaj cały wpis
  21. MYGO.pl

    RSSPlugin error

    Hello. How could I solve these errors? Code: [AMXX] Displaying debug trace (plugin "zp_cso_knifes.amxx", version "1.0") [AMXX] Run time error 4: index out of bounds [AMXX] [0] zp_cso_knifes.sma::Fw_EmitSound (line 256) [AMXX] Displaying debug trace (plugin "zp_cso_knifes.amxx", version "1.0") [AMXX] Run time error 4: index out of bounds [AMXX] [0] zp_cso_knifes.sma::CBaseWeapon_Deploy_Post (line 240)Line 233 - 276 Spoiler public CBaseWeapon_Deploy_Post( iEntity ) { if( !pev_valid( iEntity ) ) return HAM_HANDLED; new iPlayer; iPlayer = get_pdata_cbase( iEntity , 41 , 4 ); if( zp_get_user_zombie( iPlayer ) ) return HAM_HANDLED set_pev( iPlayer , pev_viewmodel2 , Knife_View_Models[ iKnife[ iPlayer ] ] ); set_pev( iPlayer , pev_weaponmodel2 , Knife_Player_Models[ iKnife[ iPlayer ] ] ); set_pev( iPlayer , pev_maxspeed , Knife_Speed[ iKnife[ iPlayer ] ]) set_pdata_float( iPlayer , 83 , 1.0 , 5 ); return HAM_IGNORED; } public Fw_EmitSound( iPlayer , iChannel , iSample[] , Float:flVolume , Float:flAttn , iFlag , iPitch ) { if( ! is_user_connected( iPlayer ) ) return FMRES_IGNORED; if( zp_get_user_zombie( iPlayer ) ) return FMRES_IGNORED if( iSample[ 8 ] == 'k' && iSample[ 9 ] == 'n' && iSample[ 10 ] == 'i' ) { if( iSample[ 14 ] == 'd' ) { emit_sound( iPlayer , iChannel , Knife_Sounds[ iKnife [ iPlayer ] ] [ 0 ] , flVolume , flAttn , iFlag , iPitch ) } else if(iSample[ 14 ] == 'h') { if(iSample[ 17 ] == 'w') { emit_sound(iPlayer , iChannel , Knife_Sounds[ iKnife[ iPlayer ] ] [ 3 ] , flVolume , flAttn , iFlag , iPitch ) } else { emit_sound(iPlayer , iChannel , Knife_Sounds[ iKnife[ iPlayer ] ] [ random_num( 1 , 2 ) ] , flVolume , flAttn , iFlag , iPitch ) } } else { if( iSample[ 15 ] == 'l' ) { emit_sound( iPlayer , iChannel , Knife_Sounds[ iKnife[ iPlayer ] ] [ 4 ] , flVolume , flAttn , iFlag , iPitch ) } else { emit_sound( iPlayer , iChannel , Knife_Sounds[ iKnife[ iPlayer ] ] [ 5 ] , flVolume , flAttn , iFlag , iPitch ) } } return FMRES_SUPERCEDE; } return FMRES_IGNORED; } If all the code is needed, I will post it. Przeczytaj cały wpis
  22. Ive tried to add a Knife submenu but i kept getting errors, so i just gave up and deleted the code, what i wanted was to add my knife menu in the buymenu the menu is supposed to look like this [Title] 1. Pistols 2. Shotguns 3. Rifles 4. Snipers 5. Machineguns 6. Extra items (humans) 7. Knife menu (idk how to add this one) edit - to open the knife menu you have to use PHP Code: client_cmd(id, "knife") PHP Code: #include <amxmodx> #include <amxmisc> #include <cstrike> #include <fakemeta_util> #include <sqlx> #include <hamsandwich> #include <zombieplague> #include <dhudmessage> #define INI "zp_buymenu.ini" #define CFG "zp_buymenu.cfg" #define TXT "zp_buymenu.txt" #define WAV "items/9mmclip1.wav" #define FLAG_A (1<<0) #define FLAG_B (1<<1) #define FLAG_C (1<<2) #define FLAG_D (1<<3) #define FLAG_E (1<<4) #define FLAG_F (1<<5) #define FLAG_G (1<<6) #define FLAG_H (1<<7) #define FLAG_I (1<<8) #define FLAG_J (1<<9) #define FLAG_K (1<<10) #define MENU 8 new g_money[33], g_menu[MENU], g_maxplayers, g_gamemode, g_count[7], g_msg_BuyClose, g_msg_StatusIcon, g_msg_Money, g_msg_BlinkAcct, bool:g_limit[128][33], bool:g_limit_round[128][33], cvar_no_one_win, cvar_zombies_win, cvar_zombies_loose, cvar_zombies_kill, cvar_humans_win, cvar_humans_loose, cvar_humans_kill, cvar_show_equipments, cvar_ammo_give, cvar_money_max, cvar_money_save, Array:g_pistols, Array:g_shotguns, Array:g_submachineguns, Array:g_rifles, Array:g_machineguns, Array:g_equipments_h, Array:g_equipments_z, Handle:SQL_Connection, Handle:SQL_Tuple, bool:g_connected enum { SECTION_NONE = 0, SECTION_PISTOLS, SECTION_SHOTGUNS, SECTION_SUBMACHINEGUNS, SECTION_RIFLES, SECTION_MACHINEGUNS, SECTION_EQUIPMENTS_H, SECTION_EQUIPMENTS_Z } const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90) const SECONDARY_WEAPONS_BIT_SUM = (1<<CSW_P228)|(1<<CSW_ELITE)|(1<<CSW_FIVESEVEN)|(1<<CSW_USP)|(1<<CSW_GLOCK18)|(1<<CSW_DEAGLE) enum { DROP_PRIMARY = 1, DROP_SECONDARY } new const MAXAMMO[] = { -1, 52, // P228 Compact -1, 90, // Schmidt Scout 1, 32, // XM1014 M4 1, 100, // Ingram MAC-10 90, // Steyr AUG A1 1, 120, // Dual Elite Berettas 100, // FiveseveN 100, // UMP 45 90, // SG-550 Auto-Sniper 90, // IMI Galil 90, // Famas 100, // USP .45 ACP Tactical 120, // Glock 18C 30, // AWP Magnum Sniper 120, // MP5 Navy 200, // M249 Para Machinegun 32, // M3 Super 90 90, // M4A1 Carbine 120, // Schmidt TMP 90, // G3SG1 Auto-Sniper 2, 35, // Desert Eagle .50 AE 90, // SG-552 Commando 90, // AK-47 Kalashnikov -1, 100 // ES P90 } new const BUYAMMO[] = { -1, 13, // P228 Compact -1, 30, // Schmidt Scout -1, 8, // XM1014 M4 -1, 12, // Ingram MAC-10 30, // Steyr AUG A1 -1, 30, // Dual Elite Berettas 50, // FiveseveN 12, // UMP 45 30, // SG-550 Auto-Sniper 30, // IMI Galil 30, // Famas 12, // USP .45 ACP Tactical 30, // Glock 18C 10, // AWP Magnum Sniper 30, // MP5 Navy 30, // M249 Para Machinegun 8, // M3 Super 90 30, // M4A1 Carbine 30, // Schmidt TMP 30, // G3SG1 Auto-Sniper -1, 7, // Desert Eagle .50 AE 30, // SG-552 Commando 30, // AK-47 Kalashnikov -1, 50 // ES P90 } new const TYPEAMMO[][] = { "", "357sig", // P228 Compact "", "762nato", // Schmidt Scout "", "buckshot", // XM1014 M4 "", "45acp", // Ingram MAC-10 "556nato", // Steyr AUG A1 "", "9mm", // Dual Elite Berettas "57mm", // FiveseveN "45acp", // UMP 45 "556nato", // SG-550 Auto-Sniper "556nato", // IMI Galil "556nato", // Famas "45acp", // USP .45 ACP Tactical "9mm", // Glock 18C "338magnum", // AWP Magnum Sniper "9mm", // MP5 Navy "556natobox", // M249 Para Machinegun "buckshot", // M3 Super 90 "556nato", // M4A1 Carbine "9mm", // Schmidt TMP "762nato", // G3SG1 Auto-Sniper "", "50ae", // Desert Eagle .50 AE "556nato", // SG-552 Commando "762nato", // AK-47 Kalashnikov "", "57mm" // ES P90 } new const COSTAMMO[] = { -1, 2, // P228 Compact -1, 4, // Schmidt Scout -1, 6, // XM1014 M4 -1, 8, // Ingram MAC-10 9, // Steyr AUG A1 -1, 11, // Dual Elite Berettas 12, // FiveseveN 13, // UMP 45 14, // SG-550 Auto-Sniper 15, // IMI Galil 16, // Famas 17, // USP .45 ACP Tactical 18, // Glock 18C 19, // AWP Magnum Sniper 20, // MP5 Navy 21, // M249 Para Machinegun 22, // M3 Super 90 23, // M4A1 Carbine 24, // Schmidt TMP 25, // G3SG1 Auto-Sniper -1, 27, // Desert Eagle .50 AE 28, // SG-552 Commando 29, // AK-47 Kalashnikov -1, 31, // ES P90 } new const g_buy_commands[][] = { "usp", "glock", "deagle", "p228", "elites", "fn57", "m3", "xm1014", "mp5", "tmp", "p90", "mac10", "ump45", "ak47", "galil", "famas", "sg552", "m4a1", "aug", "scout", "awp", "g3sg1", "sg550", "m249", "vest", "vesthelm", "flash", "hegren", "sgren", "defuser", "nvgs", "shield", "primammo", "secammo", "km45", "9x19mm", "nighthawk", "228compact", "fiveseven", "12gauge", "autoshotgun", "mp", "c90", "cv47", "defender", "clarion", "krieg552", "bullpup", "magnum", "d3au1", "krieg550", "buy", "buyequip", "cl_autobuy", "cl_rebuy", "cl_setautobuy", "cl_setrebuy", "client_buy_open" } public plugin_init() { register_plugin("[ZP] Addon: Buy Menu", "25.06.2015", "ErolD") register_dictionary(TXT) cvar_no_one_win = register_cvar("bm_no_one_win_reward", "1000") cvar_zombies_win = register_cvar("bm_zombies_win_reward", "2500") cvar_zombies_loose = register_cvar("bm_zombies_loose_reward", "500") cvar_zombies_kill = register_cvar("bm_zombies_kill_reward", "500") cvar_humans_win = register_cvar("bm_humans_win_reward", "2500") cvar_humans_loose = register_cvar("bm_humans_loose_reward", "500") cvar_humans_kill = register_cvar("bm_humans_kill_reward", "500") cvar_show_equipments = register_cvar("bm_show_equipments", "1") cvar_ammo_give = register_cvar("bm_ammo_give", "1") cvar_money_max = register_cvar("bm_money_max", "100000") cvar_money_save = register_cvar("bm_money_save", "2") register_cvar("bm_sql_host", "localhost") register_cvar("bm_sql_user", "user") register_cvar("bm_sql_password", "password") register_cvar("bm_sql_db", "db") register_cvar("zp_remove_money", "0") register_event("HLTV", "Event_RoundStart", "a", "1=0", "2=0") RegisterHam(Ham_Player_PreThink, "player", "Ham_Player_PreThink_Pre") RegisterHam(Ham_TakeDamage, "player", "Ham_TakeDamage_Pre") RegisterHam(Ham_Spawn, "player", "Ham_Spawn_Post", 1) RegisterHam(Ham_Killed, "player", "Ham_Killed_Pre") new i, callback, buffer[128], name[64], cost[64], buy_commands = sizeof(g_buy_commands) callback = menu_makecallback("menu_callback") for(i = 0; i < MENU; i++) g_menu[i] = menu_create("BM_MENU", "menu_handler") for(i = 2; i < MENU; i++) { if(i == 7) menu_addblank(g_menu[0], 0) menu_additem(g_menu[0], "BM_ITEM", _, _, callback) } for(i = 0; i < ArraySize(g_pistols); i++) { ArrayGetString(g_pistols, i, buffer, charsmax(buffer)) parse(buffer, name, charsmax(name), buffer, charsmax(buffer), cost, charsmax(cost)) formatex(buffer, charsmax(buffer), "%s \y[%d$]", name, str_to_num(cost)) menu_additem(g_menu[1], buffer, _, _, callback) } for(i = 0; i < ArraySize(g_shotguns); i++) { ArrayGetString(g_shotguns, i, buffer, charsmax(buffer)) parse(buffer, name, charsmax(name), buffer, charsmax(buffer), cost, charsmax(cost)) formatex(buffer, charsmax(buffer), "%s \y[%d$]", name, str_to_num(cost)) menu_additem(g_menu[2], buffer, _, _, callback) } for(i = 0; i < ArraySize(g_submachineguns); i++) { ArrayGetString(g_submachineguns, i, buffer, charsmax(buffer)) parse(buffer, name, charsmax(name), buffer, charsmax(buffer), cost, charsmax(cost)) formatex(buffer, charsmax(buffer), "%s \y[%d$]", name, str_to_num(cost)) menu_additem(g_menu[3], buffer, _, _, callback) } for(i = 0; i < ArraySize(g_rifles); i++) { ArrayGetString(g_rifles, i, buffer, charsmax(buffer)) parse(buffer, name, charsmax(name), buffer, charsmax(buffer), cost, charsmax(cost)) formatex(buffer, charsmax(buffer), "%s \y[%d$]", name, str_to_num(cost)) menu_additem(g_menu[4], buffer, _, _, callback) } for(i = 0; i < ArraySize(g_machineguns); i++) { ArrayGetString(g_machineguns, i, buffer, charsmax(buffer)) parse(buffer, name, charsmax(name), buffer, charsmax(buffer), cost, charsmax(cost)) formatex(buffer, charsmax(buffer), "%s \y[%d$]", name, str_to_num(cost)) menu_additem(g_menu[5], buffer, _, _, callback) } for(i = 0; i < ArraySize(g_equipments_h); i++) { ArrayGetString(g_equipments_h, i, buffer, charsmax(buffer)) parse(buffer, name, charsmax(name), buffer, charsmax(buffer), cost, charsmax(cost)) formatex(buffer, charsmax(buffer), "%s \y[%d$]", name, str_to_num(cost)) menu_additem(g_menu[6], buffer, _, _, callback) } for(i = 0; i < ArraySize(g_equipments_z); i++) { ArrayGetString(g_equipments_z, i, buffer, charsmax(buffer)) parse(buffer, name, charsmax(name), buffer, charsmax(buffer), cost, charsmax(cost)) formatex(buffer, charsmax(buffer), "%s \y[%d$]", name, str_to_num(cost)) menu_additem(g_menu[7], buffer, _, _, callback) } for(i = 0; i < buy_commands; i++) register_clcmd(g_buy_commands[i], "clcmd_menu") register_clcmd("buyammo1", "clcmd_buyammo") register_clcmd("buyammo2", "clcmd_buyammo") g_msg_BuyClose = get_user_msgid("BuyClose") g_msg_StatusIcon = get_user_msgid("StatusIcon") g_msg_Money = get_user_msgid("Money") g_msg_BlinkAcct = get_user_msgid("BlinkAcct") g_maxplayers = get_maxplayers() } public plugin_precache() { g_pistols = ArrayCreate(128, 1) g_shotguns = ArrayCreate(128, 1) g_submachineguns = ArrayCreate(128, 1) g_rifles = ArrayCreate(128, 1) g_machineguns = ArrayCreate(128, 1) g_equipments_h = ArrayCreate(128, 1) g_equipments_z = ArrayCreate(128, 1) new configsdir[64], line[1024], buffer[128], name[64], name2[64], cost[64], flags[64], players[64], section get_configsdir(configsdir, charsmax(configsdir)) format(configsdir, charsmax(configsdir), "%s/%s", configsdir, INI) if(!file_exists(configsdir)) { log_to_file("zp_buymenu.log", "%s not loaded", INI) return; } new file = fopen(configsdir, "rt") while(file && !feof(file)) { fgets(file, line, charsmax(line)) replace(line, charsmax(line), "^n", "") if(!line[0] || line[0] == ';') { continue; } else if(line[0] == '[') { section++ continue; } else if(line[0] == '"') { switch(section) { case SECTION_PISTOLS: { parse(line, name, charsmax(name), name2, charsmax(name2), cost, charsmax(cost), flags, charsmax(flags), players, charsmax(players)) formatex(buffer, charsmax(buffer), "^"%s^" ^"%s^" ^"%s^" ^"%s^" ^"%s^"", name, name2, cost, flags, players) ArrayPushString(g_pistols, buffer) g_count[0]++ } case SECTION_SHOTGUNS: { parse(line, name, charsmax(name), name2, charsmax(name2), cost, charsmax(cost), flags, charsmax(flags), players, charsmax(players)) formatex(buffer, charsmax(buffer), "^"%s^" ^"%s^" ^"%s^" ^"%s^" ^"%s^"", name, name2, cost, flags, players) ArrayPushString(g_shotguns, buffer) g_count[1]++ } case SECTION_SUBMACHINEGUNS: { parse(line, name, charsmax(name), name2, charsmax(name2), cost, charsmax(cost), flags, charsmax(flags), players, charsmax(players)) formatex(buffer, charsmax(buffer), "^"%s^" ^"%s^" ^"%s^" ^"%s^" ^"%s^"", name, name2, cost, flags, players) ArrayPushString(g_submachineguns, buffer) g_count[2]++ } case SECTION_RIFLES: { parse(line, name, charsmax(name), name2, charsmax(name2), cost, charsmax(cost), flags, charsmax(flags), players, charsmax(players)) formatex(buffer, charsmax(buffer), "^"%s^" ^"%s^" ^"%s^" ^"%s^" ^"%s^"", name, name2, cost, flags, players) ArrayPushString(g_rifles, buffer) g_count[3]++ } case SECTION_MACHINEGUNS: { parse(line, name, charsmax(name), name2, charsmax(name2), cost, charsmax(cost), flags, charsmax(flags), players, charsmax(players)) formatex(buffer, charsmax(buffer), "^"%s^" ^"%s^" ^"%s^" ^"%s^" ^"%s^"", name, name2, cost, flags, players) ArrayPushString(g_machineguns, buffer) g_count[4]++ } case SECTION_EQUIPMENTS_H: { parse(line, name, charsmax(name), name2, charsmax(name2), cost, charsmax(cost), flags, charsmax(flags), players, charsmax(players)) formatex(buffer, charsmax(buffer), "^"%s^" ^"%s^" ^"%s^" ^"%s^" ^"%s^"", name, name2, cost, flags, players) ArrayPushString(g_equipments_h, buffer) g_count[5]++ } case SECTION_EQUIPMENTS_Z: { parse(line, name, charsmax(name), name2, charsmax(name2), cost, charsmax(cost), flags, charsmax(flags), players, charsmax(players)) formatex(buffer, charsmax(buffer), "^"%s^" ^"%s^" ^"%s^" ^"%s^" ^"%s^"", name, name2, cost, flags, players) ArrayPushString(g_equipments_z, buffer) g_count[6]++ } } } } if(file) fclose(file) } public plugin_natives() { register_native("zp_cs_get_user_money", "native_get_user_money", 1) register_native("zp_cs_set_user_money", "native_set_user_money", 1) } public plugin_cfg() { new configsdir[32], errnum, error[128], Handle:query, host[32], user[32], password[32], db[32] get_configsdir(configsdir, charsmax(configsdir)) server_cmd("exec %s/%s", configsdir, CFG) if(!get_pcvar_num(cvar_money_save)) return; get_cvar_string("bm_sql_host", host, charsmax(host)) get_cvar_string("bm_sql_user", user, charsmax(user)) get_cvar_string("bm_sql_password", password, charsmax(password)) get_cvar_string("bm_sql_db", db, charsmax(db)) SQL_Tuple = SQL_MakeDbTuple(host, user, password, db) SQL_Connection = SQL_Connect(SQL_Tuple, errnum, error, charsmax(error)) if(SQL_Connection == Empty_Handle) { server_print("ERROR #%d: %s", errnum, error) g_connected = false } else { query = SQL_PrepareQuery(SQL_Connection, "CREATE TABLE IF NOT EXISTS `zp_buymenu`(`player` VARCHAR(32) NOT NULL PRIMARY KEY, `money` INTEGER NOT NULL)") SQL_Execute(query) SQL_FreeHandle(query) g_connected = true } } public client_connect(id) { client_cmd(id, "setinfo _vgui_menus 0") if(g_connected) { static player[32], Handle:query switch(get_pcvar_num(cvar_money_save)) { case 1: get_user_name(id, player, charsmax(player)) case 2: get_user_authid(id, player, charsmax(player)) case 3: get_user_ip(id, player, charsmax(player)) } query = SQL_PrepareQuery(SQL_Connection, "SELECT * FROM `zp_buymenu` WHERE `player`='%s'", player) SQL_Execute(query) g_money[id] = SQL_ReadResult(query, 1) SQL_FreeHandle(query) } } public client_disconnect(id) { if(g_connected) { static player[32], Handle:query switch(get_pcvar_num(cvar_money_save)) { case 1: get_user_name(id, player, charsmax(player)) case 2: get_user_authid(id, player, charsmax(player)) case 3: get_user_ip(id, player, charsmax(player)) } query = SQL_PrepareQuery(SQL_Connection, "REPLACE INTO `zp_buymenu`(`player`, `money`) VALUES ('%s', '%d')", player, g_money[id]) SQL_Execute(query) SQL_FreeHandle(query) } } public plugin_end() { if(g_connected) { SQL_FreeHandle(SQL_Connection) SQL_FreeHandle(SQL_Tuple) } } public clcmd_menu(id) { if(!is_user_alive(id)) return PLUGIN_HANDLED; message_begin(MSG_ONE, g_msg_BuyClose, _, id) message_end() static buffer[128] formatex(buffer, charsmax(buffer), "%L", LANG_PLAYER, "BM_TITLE") menu_setprop(g_menu[0], MPROP_TITLE, buffer) formatex(buffer, charsmax(buffer), "%L", LANG_PLAYER, "BM_PISTOLS") menu_item_setname(g_menu[0], 0, buffer) menu_setprop(g_menu[1], MPROP_TITLE, buffer) formatex(buffer, charsmax(buffer), "%L", LANG_PLAYER, "BM_SHOTGUNS") menu_item_setname(g_menu[0], 1, buffer) menu_setprop(g_menu[2], MPROP_TITLE, buffer) formatex(buffer, charsmax(buffer), "%L", LANG_PLAYER, "BM_SUBMACHINEGUNS") menu_item_setname(g_menu[0], 2, buffer) menu_setprop(g_menu[3], MPROP_TITLE, buffer) formatex(buffer, charsmax(buffer), "%L", LANG_PLAYER, "BM_RIFLES") menu_item_setname(g_menu[0], 3, buffer) menu_setprop(g_menu[4], MPROP_TITLE, buffer) formatex(buffer, charsmax(buffer), "%L", LANG_PLAYER, "BM_MACHINEGUNS") menu_item_setname(g_menu[0], 4, buffer) menu_setprop(g_menu[5], MPROP_TITLE, buffer) if(zp_get_user_zombie(id)) { formatex(buffer, charsmax(buffer), "%L", LANG_PLAYER, "BM_EQUIPMENTS_ZOMBIES") menu_item_setname(g_menu[0], 5, buffer) menu_setprop(g_menu[7], MPROP_TITLE, buffer) if(get_pcvar_num(cvar_show_equipments)) menu_display(id, g_menu[7]) else menu_display(id, g_menu[0]) } else { formatex(buffer, charsmax(buffer), "%L", LANG_PLAYER, "BM_EQUIPMENTS_HUMANS") menu_item_setname(g_menu[0], 5, buffer) menu_setprop(g_menu[6], MPROP_TITLE, buffer) menu_display(id, g_menu[0]) } return PLUGIN_HANDLED; } public clcmd_buyammo(id) { if(!is_user_alive(id) || zp_get_user_zombie(id)) return PLUGIN_HANDLED; static ammo, weapon weapon = get_user_weapon(id, _, ammo) if(g_money[id] < COSTAMMO[weapon]) { message_begin(MSG_ONE_UNRELIABLE, g_msg_BlinkAcct, _, id) write_byte(5) message_end() } else if(ammo < MAXAMMO[weapon]) { ExecuteHam(Ham_GiveAmmo, id, BUYAMMO[weapon], TYPEAMMO[weapon], MAXAMMO[weapon]) set_user_money(id, g_money[id] - COSTAMMO[weapon]) emit_sound(id, CHAN_ITEM, WAV, 1.0, ATTN_NORM, 0, PITCH_NORM) } return PLUGIN_HANDLED; } public menu_handler(id, menu, item) { static buffer[128], name2[64], cost[64], weaponid if(item == MENU_EXIT) return; switch(menu) { case 0: { switch(item) { case 5: { if(zp_get_user_zombie(id)) menu_display(id, g_menu[7], 0) else menu_display(id, g_menu[6], 0) } default: menu_display(id, g_menu[item + 1], 0) } } case 1: { ArrayGetString(g_pistols, item, buffer, charsmax(buffer)) parse(buffer, buffer, charsmax(buffer), name2, charsmax(name2), cost, charsmax(cost)) weaponid = get_weaponid(name2) if(equal(name2, "weapon_", 7)) { drop_weapons(id, DROP_SECONDARY) fm_give_item(id, name2) if(get_pcvar_num(cvar_ammo_give)) ExecuteHam(Ham_GiveAmmo, id, MAXAMMO[weaponid], TYPEAMMO[weaponid], MAXAMMO[weaponid]) } else { zp_force_buy_extra_item(id, zp_get_extra_item_id(name2), 1) } set_user_money(id, g_money[id] - str_to_num(cost)) g_limit_round[item][id] = g_limit[item][id] = true } case 2: { ArrayGetString(g_shotguns, item, buffer, charsmax(buffer)) parse(buffer, buffer, charsmax(buffer), name2, charsmax(name2), cost, charsmax(cost)) weaponid = get_weaponid(name2) if(equal(name2, "weapon_", 7)) { drop_weapons(id, DROP_PRIMARY) fm_give_item(id, name2) if(get_pcvar_num(cvar_ammo_give)) ExecuteHam(Ham_GiveAmmo, id, MAXAMMO[weaponid], TYPEAMMO[weaponid], MAXAMMO[weaponid]) } else { zp_force_buy_extra_item(id, zp_get_extra_item_id(name2), 1) } set_user_money(id, g_money[id] - str_to_num(cost)) g_limit_round[item][id] = g_limit[item][id] = true } case 3: { ArrayGetString(g_submachineguns, item, buffer, charsmax(buffer)) parse(buffer, buffer, charsmax(buffer), name2, charsmax(name2), cost, charsmax(cost)) weaponid = get_weaponid(name2) if(equal(name2, "weapon_", 7)) { drop_weapons(id, DROP_PRIMARY) fm_give_item(id, name2) if(get_pcvar_num(cvar_ammo_give)) ExecuteHam(Ham_GiveAmmo, id, MAXAMMO[weaponid], TYPEAMMO[weaponid], MAXAMMO[weaponid]) } else { zp_force_buy_extra_item(id, zp_get_extra_item_id(name2), 1) } set_user_money(id, g_money[id] - str_to_num(cost)) g_limit_round[item][id] = g_limit[item][id] = true } case 4: { ArrayGetString(g_rifles, item, buffer, charsmax(buffer)) parse(buffer, buffer, charsmax(buffer), name2, charsmax(name2), cost, charsmax(cost)) weaponid = get_weaponid(name2) if(equal(name2, "weapon_", 7)) { drop_weapons(id, DROP_PRIMARY) fm_give_item(id, name2) if(get_pcvar_num(cvar_ammo_give)) ExecuteHam(Ham_GiveAmmo, id, MAXAMMO[weaponid], TYPEAMMO[weaponid], MAXAMMO[weaponid]) } else { zp_force_buy_extra_item(id, zp_get_extra_item_id(name2), 1) } set_user_money(id, g_money[id] - str_to_num(cost)) g_limit_round[item][id] = g_limit[item][id] = true } case 5: { ArrayGetString(g_machineguns, item, buffer, charsmax(buffer)) parse(buffer, buffer, charsmax(buffer), name2, charsmax(name2), cost, charsmax(cost)) weaponid = get_weaponid(name2) if(equal(name2, "weapon_", 7)) { drop_weapons(id, DROP_PRIMARY) fm_give_item(id, name2) if(get_pcvar_num(cvar_ammo_give)) ExecuteHam(Ham_GiveAmmo, id, MAXAMMO[weaponid], TYPEAMMO[weaponid], MAXAMMO[weaponid]) } else { zp_force_buy_extra_item(id, zp_get_extra_item_id(name2), 1) } set_user_money(id, g_money[id] - str_to_num(cost)) g_limit_round[item][id] = g_limit[item][id] = true } case 6: { ArrayGetString(g_equipments_h, item, buffer, charsmax(buffer)) parse(buffer, buffer, charsmax(buffer), name2, charsmax(name2), cost, charsmax(cost)) if(equal(name2, "weapon_", 7)) fm_give_item(id, name2) else zp_force_buy_extra_item(id, zp_get_extra_item_id(name2), 1) set_user_money(id, g_money[id] - str_to_num(cost)) g_limit_round[item][id] = g_limit[item][id] = true } case 7: { ArrayGetString(g_equipments_z, item, buffer, charsmax(buffer)) parse(buffer, buffer, charsmax(buffer), name2, charsmax(name2), cost, charsmax(cost)) if(equal(name2, "weapon_", 7)) fm_give_item(id, name2) else zp_force_buy_extra_item(id, zp_get_extra_item_id(name2), 1) set_user_money(id, g_money[id] - str_to_num(cost)) g_limit_round[item][id] = g_limit[item][id] = true } } } public menu_callback(id, menu, item) { static buffer[128], name2[64], cost[64], flags[64], players[64], flag switch(menu) { case 0: { switch(item) { case 5: return ITEM_ENABLED; default: { if(zp_get_user_zombie(id) || !g_count[item]) return ITEM_DISABLED; } } } case 1: { ArrayGetString(g_pistols, item, buffer, charsmax(buffer)) parse(buffer, buffer, charsmax(buffer), buffer, charsmax(buffer), cost, charsmax(cost), flags, charsmax(flags), players, charsmax(players)) flag = read_flags(flags) if(zp_get_user_zombie(id) || g_money[id] < str_to_num(cost) || (!g_gamemode && flag & FLAG_A) || (g_gamemode && flag & FLAG_B) || (zp_get_user_last_zombie(id) && flag & FLAG_C) || (zp_get_user_last_human(id) && flag & FLAG_D) || (g_gamemode == MODE_NEMESIS && flag & FLAG_E) || (g_gamemode == MODE_SURVIVOR && flag & FLAG_F) || (g_gamemode == MODE_SWARM && flag & FLAG_G) || (g_gamemode == MODE_PLAGUE && flag & FLAG_H) || (!(get_user_flags(id) & ADMIN_BAN) && flag & FLAG_I) || ((g_limit_round[item][id]) && flag & FLAG_J) || ((g_limit[item][id]) && flag & FLAG_K) || get_playersnum() < str_to_num(players)) return ITEM_DISABLED; } case 2: { ArrayGetString(g_shotguns, item, buffer, charsmax(buffer)) parse(buffer, buffer, charsmax(buffer), buffer, charsmax(buffer), cost, charsmax(cost), flags, charsmax(flags), players, charsmax(players)) flag = read_flags(flags) if(zp_get_user_zombie(id) || g_money[id] < str_to_num(cost) || (!g_gamemode && flag & FLAG_A) || (g_gamemode && flag & FLAG_B) || (zp_get_user_last_zombie(id) && flag & FLAG_C) || (zp_get_user_last_human(id) && flag & FLAG_D) || (g_gamemode == MODE_NEMESIS && flag & FLAG_E) || (g_gamemode == MODE_SURVIVOR && flag & FLAG_F) || (g_gamemode == MODE_SWARM && flag & FLAG_G) || (g_gamemode == MODE_PLAGUE && flag & FLAG_H) || (!(get_user_flags(id) & ADMIN_BAN) && flag & FLAG_I) || ((g_limit_round[item][id]) && flag & FLAG_J) || ((g_limit[item][id]) && flag & FLAG_K) || get_playersnum() < str_to_num(players)) return ITEM_DISABLED; } case 3: { ArrayGetString(g_submachineguns, item, buffer, charsmax(buffer)) parse(buffer, buffer, charsmax(buffer), buffer, charsmax(buffer), cost, charsmax(cost), flags, charsmax(flags), players, charsmax(players)) flag = read_flags(flags) if(zp_get_user_zombie(id) || g_money[id] < str_to_num(cost) || (!g_gamemode && flag & FLAG_A) || (g_gamemode && flag & FLAG_B) || (zp_get_user_last_zombie(id) && flag & FLAG_C) || (zp_get_user_last_human(id) && flag & FLAG_D) || (g_gamemode == MODE_NEMESIS && flag & FLAG_E) || (g_gamemode == MODE_SURVIVOR && flag & FLAG_F) || (g_gamemode == MODE_SWARM && flag & FLAG_G) || (g_gamemode == MODE_PLAGUE && flag & FLAG_H) || (!(get_user_flags(id) & ADMIN_BAN) && flag & FLAG_I) || ((g_limit_round[item][id]) && flag & FLAG_J) || ((g_limit[item][id]) && flag & FLAG_K) || get_playersnum() < str_to_num(players)) return ITEM_DISABLED; } case 4: { ArrayGetString(g_rifles, item, buffer, charsmax(buffer)) parse(buffer, buffer, charsmax(buffer), buffer, charsmax(buffer), cost, charsmax(cost), flags, charsmax(flags), players, charsmax(players)) flag = read_flags(flags) if(zp_get_user_zombie(id) || g_money[id] < str_to_num(cost) || (!g_gamemode && flag & FLAG_A) || (g_gamemode && flag & FLAG_B) || (zp_get_user_last_zombie(id) && flag & FLAG_C) || (zp_get_user_last_human(id) && flag & FLAG_D) || (g_gamemode == MODE_NEMESIS && flag & FLAG_E) || (g_gamemode == MODE_SURVIVOR && flag & FLAG_F) || (g_gamemode == MODE_SWARM && flag & FLAG_G) || (g_gamemode == MODE_PLAGUE && flag & FLAG_H) || (!(get_user_flags(id) & ADMIN_BAN) && flag & FLAG_I) || ((g_limit_round[item][id]) && flag & FLAG_J) || ((g_limit[item][id]) && flag & FLAG_K) || get_playersnum() < str_to_num(players)) return ITEM_DISABLED; } case 5: { ArrayGetString(g_machineguns, item, buffer, charsmax(buffer)) parse(buffer, buffer, charsmax(buffer), buffer, charsmax(buffer), cost, charsmax(cost), flags, charsmax(flags), players, charsmax(players)) flag = read_flags(flags) if(zp_get_user_zombie(id) || g_money[id] < str_to_num(cost) || (!g_gamemode && flag & FLAG_A) || (g_gamemode && flag & FLAG_B) || (zp_get_user_last_zombie(id) && flag & FLAG_C) || (zp_get_user_last_human(id) && flag & FLAG_D) || (g_gamemode == MODE_NEMESIS && flag & FLAG_E) || (g_gamemode == MODE_SURVIVOR && flag & FLAG_F) || (g_gamemode == MODE_SWARM && flag & FLAG_G) || (g_gamemode == MODE_PLAGUE && flag & FLAG_H) || (!(get_user_flags(id) & ADMIN_BAN) && flag & FLAG_I) || ((g_limit_round[item][id]) && flag & FLAG_J) || ((g_limit[item][id]) && flag & FLAG_K) || get_playersnum() < str_to_num(players)) return ITEM_DISABLED; } case 6: { ArrayGetString(g_equipments_h, item, buffer, charsmax(buffer)) parse(buffer, buffer, charsmax(buffer), name2, charsmax(name2), cost, charsmax(cost), flags, charsmax(flags), players, charsmax(players)) flag = read_flags(flags) if(zp_get_user_zombie(id) || g_money[id] < str_to_num(cost) || (!g_gamemode && flag & FLAG_A) || (g_gamemode && flag & FLAG_B) || (zp_get_user_last_zombie(id) && flag & FLAG_C) || (zp_get_user_last_human(id) && flag & FLAG_D) || (g_gamemode == MODE_NEMESIS && flag & FLAG_E) || (g_gamemode == MODE_SURVIVOR && flag & FLAG_F) || (g_gamemode == MODE_SWARM && flag & FLAG_G) || (g_gamemode == MODE_PLAGUE && flag & FLAG_H) || (!(get_user_flags(id) & ADMIN_BAN) && flag & FLAG_I) || ((g_limit_round[item][id]) && flag & FLAG_J) || ((g_limit[item][id]) && flag & FLAG_K) || get_playersnum() < str_to_num(players) || (equal(name2, "weapon_hegrenade") && cs_get_user_bpammo(id, CSW_HEGRENADE) >= 1) || (equal(name2, "weapon_flashbang") && cs_get_user_bpammo(id, CSW_FLASHBANG) >= 2) || (equal(name2, "weapon_smokegrenade") && cs_get_user_bpammo(id, CSW_SMOKEGRENADE) >= 1)) return ITEM_DISABLED; } case 7: { ArrayGetString(g_equipments_z, item, buffer, charsmax(buffer)) parse(buffer, buffer, charsmax(buffer), buffer, charsmax(buffer), cost, charsmax(cost), flags, charsmax(flags), players, charsmax(players)) flag = read_flags(flags) if(g_money[id] < str_to_num(cost) || (!g_gamemode && flag & FLAG_A) || (g_gamemode && flag & FLAG_B) || (zp_get_user_last_zombie(id) && flag & FLAG_C) || (zp_get_user_last_human(id) && flag & FLAG_D) || (g_gamemode == MODE_NEMESIS && flag & FLAG_E) || (g_gamemode == MODE_SURVIVOR && flag & FLAG_F) || (g_gamemode == MODE_SWARM && flag & FLAG_G) || (g_gamemode == MODE_PLAGUE && flag & FLAG_H) || (!(get_user_flags(id) & ADMIN_BAN) && flag & FLAG_I) || ((g_limit_round[item][id]) && flag & FLAG_J) || ((g_limit[item][id]) && flag & FLAG_K) || get_playersnum() < str_to_num(players)) return ITEM_DISABLED; } } return ITEM_ENABLED; } public zp_round_started(gamemode) g_gamemode = gamemode public zp_round_ended(winteam) { new id for(id = 1; id <= g_maxplayers; id++) { if(!is_user_connected(id)) continue; switch(winteam) { case WIN_NO_ONE: { set_user_money(id, g_money[id] + get_pcvar_num(cvar_no_one_win)) set_dhudmessage(0, 125, 0, 0.08, 0.5, 0, 0.0, 1.0, 3.0, 1.0, false) show_dhudmessage(id, "%L", LANG_PLAYER, "BM_WIN_NO_ONE", get_pcvar_num(cvar_no_one_win)) } case WIN_ZOMBIES: { switch(zp_get_user_zombie(id)) { case 0: { set_user_money(id, g_money[id] + get_pcvar_num(cvar_humans_loose)) set_dhudmessage(200, 0, 0, 0.08, 0.5, 0, 0.0, 1.0, 3.0, 1.0, false) show_dhudmessage(id, "%L", LANG_PLAYER, "BM_LOOSE_HUMANS", get_pcvar_num(cvar_humans_loose)) } case 1: { set_user_money(id, g_money[id] + get_pcvar_num(cvar_zombies_win)) set_dhudmessage(200, 0, 0, 0.08, 0.5, 0, 0.0, 1.0, 3.0, 1.0, false) show_dhudmessage(id, "%L", LANG_PLAYER, "BM_WIN_ZOMBIES", get_pcvar_num(cvar_zombies_win)) } } } case WIN_HUMANS: { switch(zp_get_user_zombie(id)) { case 0: { set_user_money(id, g_money[id] + get_pcvar_num(cvar_humans_win)) set_dhudmessage(0, 0, 200, 0.08, 0.5, 0, 0.0, 1.0, 3.0, 1.0, false) show_dhudmessage(id, "%L", LANG_PLAYER, "BM_WIN_HUMANS", get_pcvar_num(cvar_humans_win)) } case 1: { set_user_money(id, g_money[id] + get_pcvar_num(cvar_zombies_loose)) set_dhudmessage(0, 0, 200, 0.08, 0.5, 0, 0.0, 1.0, 3.0, 1.0, false) show_dhudmessage(id, "%L", LANG_PLAYER, "BM_LOOSE_ZOMBIES", get_pcvar_num(cvar_zombies_loose)) } } } } } } public Event_RoundStart() { new id, item, limit_round = sizeof(g_limit_round) for(id = 1; id <= g_maxplayers; id++) { for(item = 0; item < limit_round; item++) g_limit_round[item][id] = false } } public Ham_Player_PreThink_Pre(id) { if(!is_user_alive(id)) return HAM_IGNORED; message_begin(MSG_ONE, g_msg_StatusIcon, _, id) write_byte(1) write_string("buyzone") write_byte(0) write_byte(0) write_byte(0) message_end() return HAM_IGNORED; } public Ham_TakeDamage_Pre(victim, inflictor, attacker, Float:damage, damage_type) { if(victim == attacker || !is_user_connected(attacker)) return HAM_IGNORED; set_user_money(attacker, g_money[attacker] + floatround(damage)) return HAM_IGNORED; } public Ham_Spawn_Post(id) { set_user_money(id, g_money[id], 0) set_dhudmessage(0, 125, 0, -1.0, 0.75, 0, 0.0, 3.0, 2.0, 1.0, false) show_dhudmessage(id, "%L", LANG_PLAYER, "BM_HUD_INFO") } public Ham_Killed_Pre(victim, attacker, shouldgib) { if(victim == attacker || !is_user_connected(attacker)) return HAM_IGNORED; if(zp_get_user_zombie(attacker)) set_user_money(attacker, g_money[attacker] + get_pcvar_num(cvar_zombies_kill)) else set_user_money(attacker, g_money[attacker] + get_pcvar_num(cvar_humans_kill)) return HAM_IGNORED; } public native_get_user_money(id) return g_money[id]; public native_set_user_money(id, money) set_user_money(id, money) stock set_user_money(id, money, flash=1) { if(!is_user_connected(id)) return; if(money > get_pcvar_num(cvar_money_max)) money = get_pcvar_num(cvar_money_max) g_money[id] = money if(!is_user_alive(id)) return; message_begin(MSG_ONE_UNRELIABLE, g_msg_Money, _, id) write_long(money) write_byte(flash) message_end() } stock drop_weapons(id, slot) { static i, weaponname[32] for(i = CSW_P228; i < CSW_P90; i++) { switch(slot) { case DROP_PRIMARY: { if((1<<i) & PRIMARY_WEAPONS_BIT_SUM) { get_weaponname(i, weaponname, charsmax(weaponname)) engclient_cmd(id, "drop", weaponname) } } case DROP_SECONDARY: { if((1<<i) & SECONDARY_WEAPONS_BIT_SUM) { get_weaponname(i, weaponname, charsmax(weaponname)) engclient_cmd(id, "drop", weaponname) } } } } } Przeczytaj cały wpis
  23. im trying to make a kz server, and i cant seem to find a plugin that makes it so my rounds dont end. im not very good with coding i know the basics when it comes to installing this stuff. i tried infinite round but the cvar plugin required doesnt work on my server(seems to be a common issue now and plugin is no longer supported) so if anyone could point me in the right direction it would be much appreciated thanks in advance:3 Przeczytaj cały wpis
  24. InfoThis is a plugin for L4D2 servers with 10-20 players. It displays a list of speakers in two columns at the bottom right of the screen. The column closer to the edge of the screen is filled first; when there are 5+ speakers talking simultaneously, the second column to the left of the first one is also filled. It does not overlap the game's HUD elements, does not cover the gameplay area, does not distract from the game, and supports sv_alltalk (only 10 speakers will be shown). Displays correctly on all resolutions from 1376x768 to 2560x1440+ SсreenshotsAttached Attached Thumbnails Attached Files Get Plugin or Get Source (l4d2_voice_hud.sp - 7.8 KB) Wyświetl pełny artykuł
  25. Describe: When players dead, they will drop many coins and glowing dropped weapons. Preview: Attachment 203302 Attachment 203303 2 sp file for EN and CN language... CFG: PHP Code: // Enable drop coins when player dead // - // Default: "1" // Minimum: "0.000000" // Maximum: "1.000000" L4D2_Coin_Drop_Switch "1" // Number of dropped coins // - // Default: "10" // Minimum: "0.000000" // Maximum: "999.000000" L4D2_Coin_Drop_Num "10" // Coin model, 0:coin 1:goldBar 2:money 3:random // - // Default: "3" // Minimum: "0.000000" // Maximum: "3.000000" L4D2_Coin_Drop_Model_Case "3" // Clear coin time (Seconds) // - // Default: "10" // Minimum: "0.000000" // Maximum: "999.000000" L4D2_Coin_Drop_Clear_Time "10" // Coin model Alpha // - // Default: "255" // Minimum: "0.000000" // Maximum: "255.000000" L4D2_Coin_Drop_Model_Alpha "255" // Enable coin glowing // - // Default: "1" // Minimum: "0.000000" // Maximum: "1.000000" L4D2_Coin_Glow_Switch "1" // Coin glowing colors (RGB) // - // Default: "255 170 0" L4D2_Coin_Glow_Color "255 170 0" // Coin glowing range // - // Default: "2000" // Minimum: "0.000000" // Maximum: "9999.000000" L4D2_Coin_Glow_Range "2000" // Enable dropped weapons glowing when player dead // - // Default: "1" // Minimum: "0.000000" // Maximum: "1.000000" L4D2_Weapon_Drop_Glow_Switch "1" // Weapons glowing colors (RGB) // - // Default: "255 170 0" L4D2_Weapon_Drop_Glow_Color "255 170 0" // Weapons glowing range // - // Default: "2000" // Minimum: "0.000000" // Maximum: "9999.000000" L4D2_Weapon_Drop_Glow_Range "2000" Translate: I love this game and have spent over 5000 hours since my college years. I really miss the old good time that playing this with my friends. I use my off work time to learn programming and this is my work. I also leaned to use hammer mapping for source games, blender for model, squirrel for vscripts etc Enjoy it.:) Attached Thumbnails Attached Files Get Plugin or Get Source (l4d2_drop_coins_v1.0EN.sp - 8.4 KB) Get Plugin or Get Source (l4d2_drop_coins_v1.0CN.sp - 8.4 KB) Wyświetl pełny artykuł
×
×
  • Dodaj nową pozycję...