[Propunere] Optimizari

..:: Ai o propunere sau sugestie pentru server? nu o tine pentru tine, aici e solutia! ::..
Post Reply
User avatar
GxCristi
GFX-Team
GFX-Team
Posts: 12
Joined: 2 years ago
Has thanked: 0
Been thanked: 13 times
Status: Offline
Romania

2 years ago

Salutare!
Am venit cu cateva propuneri pentru server, care din perspectiva mea ar fi utile. (Aranjate in functie de importanta lor)

(1) Editarea sistemului /spec & /back astfel incat la folosirea comenzii /back, jucatorul sa primeasca automat respawn sau crearea unei comenzi /respawn. (devine enervant sa tot dai retry)

(2) Daca serverul este 22+ mai mult de 5 minute, mapa este fy_snow si nu este niciun admin on sa se schimbe automat pe dust2 fiind cea mai populara harta si de dimensiuni mai mari. Si vice versa, daca sunt putini playeri si mapa este dust2 sa se schimbe pe fy_snow.

(3) Propun scoaterea hartilor nefolositoare de pe server, spre exemplu "train" doar face playerii sa iasa.

| Daca e nevoie de orice, sunt dispus sa ajut |
User avatar
canceru
Administrator
Administrator
Posts: 2297
Joined: 9 years ago
Location: UK
Has thanked: 15 times
Been thanked: 9 times
Zodiac:
Age: 46
Contact:
Status: Online

2 years ago

:pro: la 1-2 iar la trăim nu mai o puneri la vot
Image
Image
Image


Nu Deschide :45:

[spoiler]Image[/spoiler]
User avatar
Rusu Radu
Super Moderator
Super Moderator
Posts: 2024
Joined: 8 years ago
Location: Dozer
Has thanked: 23 times
Been thanked: 10 times
Zodiac:
Age: 24
Contact:
Status: Offline
Jamaica

1 year ago

GxCristi wrote: 2 years ago (1) Editarea sistemului /spec & /back astfel incat la folosirea comenzii /back, jucatorul sa primeasca automat respawn sau crearea unei comenzi /respawn. (devine enervant sa tot dai retry)

Code: Select all

/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>
#include <cstrike>
#include <fakemeta>
#include <fakemeta_util.inc>

#pragma semicolon 1

#define PLUGIN "Instant Respawn"
#define VERSION "1.0"
#define AUTHOR "xEhsaan"

new cvar_Enabled, cvar_Delay, cvar_LastWeapons;
new bool:g_HasTimer[MAX_PLAYERS];
new g_LastMenu;
new bool:g_PlayerWepSaved[MAX_PLAYERS], g_PlayerWep[MAX_PLAYERS][32], g_PlayerWepNum[MAX_PLAYERS];

new const g_AmmoCount[] = {
	0, 52, 0, 90, 1, 32, 1, 100, 90, 1, 120, 100, 100, 90, 90, 90,
	100, 120, 30, 120, 200, 32, 90, 120, 90, 2, 35, 90, 90, 0, 100
};

/**
 * Instant Respawn
 * By xEhsaan - Version: 1.0 - Release 17-05-2015
 *
 * Really simple plugin for managing respawns and give last used weapons to respawned player
 * Hope you guys enjoy!
 *
 * Client command:
 * 	say[_team] [/]respawn - Respawn player, only usable if plugin malfunctioned
 *
 * Console variables:
 * 	respawn_enabled: Enable respawn?
 * 	respawn_delay: Delay for respawn after death
 * 	respawn_spawn_lastweapon: Open menu for using last weapon?
 */


public plugin_init() {
	register_plugin( PLUGIN, VERSION, AUTHOR );
	
	cvar_Enabled	 	=	register_cvar( "respawn_enabled", "1" );
	cvar_Delay	 	=	register_cvar( "respawn_delay", "1.0" );
	cvar_LastWeapons 	=	register_cvar( "respawn_spawn_lastweapon", "1" );
	if ( get_pcvar_num( cvar_Enabled ) == 1 ) {
		register_clcmd( "say respawn", "Respawn" );
		register_clcmd( "say_team respawn", "Respawn" );
		register_clcmd( "say /respawn", "Respawn" );
		register_clcmd( "say_team /respawn", "Respawn" );
		
		RegisterHamPlayer( Ham_Killed, "On_Death", 1 );
		if ( get_pcvar_num( cvar_LastWeapons ) == 1 ) {
			RegisterHamPlayer( Ham_Killed, "Save_Weapons", 0 );
			RegisterHamPlayer( Ham_Spawn, "On_Spawn", 1 );
			
			g_LastMenu = menu_create( "\yChoose:", "Menu_Handler" );
			menu_additem( g_LastMenu, "\yUse \rLast \ypurchased weapons" );
			menu_additem( g_LastMenu, "\yBuy \rNew \yWeapons" );
			menu_setprop( g_LastMenu, MPROP_EXIT, MEXIT_NEVER );
		}
	}
}

public Index_To_String( wep_index, wep_name[], wep_name_chars, ammo_name[], ammo_name_chars ) {
	new output[64];
	new output2[64];
	switch( wep_index ) {
		case CSW_AK47: {
			formatex( output, charsmax( output ), "weapon_ak47" );
			formatex( output2, charsmax( output2 ), "ammo_762nato" );
		}
		case CSW_AUG: {
			formatex( output, charsmax( output ), "weapon_aug" );
			formatex( output2, charsmax( output2 ), "ammo_556nato" );
		}
		case CSW_AWP: {
			formatex( output, charsmax( output ), "weapon_awp" );
			formatex( output2, charsmax( output2 ), "ammo_338magnum" );
		}
		case CSW_DEAGLE: {
			formatex( output, charsmax( output ), "weapon_deagle" );
			formatex( output2, charsmax( output2 ), "ammo_50ae" );
		}
		case CSW_ELITE: {
			formatex( output, charsmax( output ), "weapon_elite" );
			formatex( output2, charsmax( output2 ), "ammo_9mm" );
		}
		case CSW_FAMAS: {
			formatex( output, charsmax( output ), "weapon_famas" );
			formatex( output2, charsmax( output2 ), "ammo_556nato" );
		}
		case CSW_FIVESEVEN: {
			formatex( output, charsmax( output ), "weapon_fiveseven" );
			formatex( output2, charsmax( output2 ), "ammo_57mm" );
		}
		case CSW_FLASHBANG: {
			formatex( output, charsmax( output ), "weapon_flashbang" );
			formatex( output2, charsmax( output2 ), "ammo_none" );
		}
		case CSW_G3SG1: {
			formatex( output, charsmax( output ), "weapon_g3sg1" );
			formatex( output2, charsmax( output2 ), "ammo_762nato" );
		}
		case CSW_GALIL: {
			formatex( output, charsmax( output ), "weapon_galil" );
			formatex( output2, charsmax( output2 ), "ammo_556nato" );
		}
		case CSW_GLOCK18: {
			formatex( output, charsmax( output ), "weapon_glock18" );
			formatex( output2, charsmax( output2 ), "ammo_9mm" );
		}
		case CSW_HEGRENADE: {
			formatex( output, charsmax( output ), "weapon_hegrenade" );
			formatex( output2, charsmax( output2 ), "ammo_none" );
		}
		case CSW_M249: {
			formatex( output, charsmax( output ), "weapon_m249" );
			formatex( output2, charsmax( output2 ), "ammo_556natobox" );
		}
		case CSW_M3: {
			formatex( output, charsmax( output ), "weapon_m3" );
			formatex( output2, charsmax( output2 ), "ammo_buckshot" );
		}
		case CSW_M4A1: {
			formatex( output, charsmax( output ), "weapon_m4a1" );
			formatex( output2, charsmax( output2 ), "ammo_556nato" );
		}
		case CSW_MAC10: {
			formatex( output, charsmax( output ), "weapon_mac10" );
			formatex( output2, charsmax( output2 ), "ammo_45acp" );
		}
		case CSW_MP5NAVY: {
			formatex( output, charsmax( output ), "weapon_mp5navy" );
			formatex( output2, charsmax( output2 ), "ammo_9mm" );
			
		}
		case CSW_P228: {
			formatex( output, charsmax( output ), "weapon_p228" );
			formatex( output2, charsmax( output2 ), "ammo_357sig" );
		}
		case CSW_P90: {
			formatex( output, charsmax( output ), "weapon_p90" );
			formatex( output2, charsmax( output2 ), "ammo_57mm" );
		}
		case CSW_SCOUT: {
			formatex( output, charsmax( output ), "weapon_scout" );
			formatex( output2, charsmax( output2 ), "ammo_762nato" );
		}
		case CSW_SG550: {
			formatex( output, charsmax( output ), "weapon_sg550" );
			formatex( output2, charsmax( output2 ), "ammo_556nato" );
		}
		case CSW_SG552: {
			formatex( output, charsmax( output ), "weapon_sg552" );
			formatex( output2, charsmax( output2 ), "ammo_556nato" );
		}
		case CSW_SMOKEGRENADE: {
			formatex( output, charsmax( output ), "weapon_smokegrenade" );
			formatex( output2, charsmax( output2 ), "ammo_none" );
		}
		case CSW_TMP: {
			formatex( output, charsmax( output ), "weapon_tmp" );
			formatex( output2, charsmax( output2 ), "ammo_9mm" );
		}
		case CSW_UMP45: {
			formatex( output, charsmax( output ), "weapon_ump45" );
			formatex( output2, charsmax( output2 ), "ammo_45acp" );
		}
		case CSW_USP: {
			formatex( output, charsmax( output ), "weapon_usp" );
			formatex( output2, charsmax( output2 ), "ammo_45acp" );
		}
		case CSW_XM1014: {
			formatex( output, charsmax( output ), "weapon_xm1014" );
			formatex( output2, charsmax( output2 ), "ammo_buckshot" );
		}
	}
	copy( wep_name, wep_name_chars, output );
	copy( ammo_name, ammo_name_chars, output2 );
}

public On_Death( id ) {
	new Delay, HUD_Sync, Params[1];
	Delay = get_pcvar_num( cvar_Delay );
	HUD_Sync = CreateHudSyncObj();
	
	if ( Delay > 0 ) {
		set_hudmessage( 255, 255, 255, -1.0, 0.2 );
		ShowSyncHudMsg( id, HUD_Sync, "You will spawn in %d seconds", Delay );
		Params[0] = id;
		set_task(float( Delay ), "Task_Respawn", id, _, _, "a", 1);
		g_HasTimer[id] = true;
	}
}

public Task_Respawn( id ) {
	if ( ! is_user_connected( id ) )
		return;
		
	ExecuteHamB( Ham_CS_RoundRespawn, id );
	g_HasTimer[id] = false;
	return;
}

public Respawn( id ) {
	if ( ! is_user_connected( id ) )
		return;
	
	if ( is_user_alive( id ) ) {
		client_print_color( id, id, "^3*** You can't respawn while you're alive!" );
		return;
	}
	
	if ( g_HasTimer[id] == true ) {
		client_print_color( id, id, "^3*** You will respawn when your timer ticks!" );
		return;
	}
	
	ExecuteHamB( Ham_CS_RoundRespawn, id );
	return;
}

public Save_Weapons(id) {
	get_user_weapons( id, g_PlayerWep[id], g_PlayerWepNum[id] ); 
	g_PlayerWepSaved[id] = true;
}

public On_Spawn(id) {
	if ( g_PlayerWepSaved[id] == true ) {
		menu_display( id, g_LastMenu );
	}
}

public Menu_Handler( id, menu, item ) {
	if ( ! is_user_connected( id ) || item == MENU_EXIT ) {
		return PLUGIN_HANDLED;
	}
	
	switch( item ) {
		case 0: {
			Get_Last_Wep( id );
		}
		case 1: {
			client_cmd( id, "buy" );
		}
	}
	
	return PLUGIN_HANDLED;
}


Get_Last_Wep( id ) {
	if ( g_PlayerWepSaved[id] == true ) {
		strip_user_weapons( id );
		give_item( id, "weapon_knife" );
		
		new WepNum = g_PlayerWepNum[id];
		
		for( new i = 0; i < WepNum; i++ ) {
			new WepName[64], Cur_Index;
			new AmmoName[64];
			Cur_Index = g_PlayerWep[id][i];
			Index_To_String( Cur_Index, WepName, charsmax( WepName ), AmmoName, charsmax( AmmoName ) );
			
			give_item( id, WepName );
			if ( g_AmmoCount[Cur_Index] > 1 )
				cs_set_user_bpammo( id, Cur_Index, g_AmmoCount[Cur_Index] );
			
		}
		
		g_PlayerWepSaved[id] = false;
	}
}










GxCristi wrote: 2 years ago (2) Daca serverul este 22+ mai mult de 5 minute, mapa este fy_snow si nu este niciun admin on sa se schimbe automat pe dust2 fiind cea mai populara harta si de dimensiuni mai mari. Si vice versa, daca sunt putini playeri si mapa este dust2 sa se schimbe pe fy_snow.

Code: Select all

#include <amxmodx>
#include <colorchat>

#define PLUGIN "MinPlayersMapChanger"
#define VERSION "1.0"
#define AUTHOR "ExoTiQ"

new mpm_map, mpm_players
new vote_yes, vote_no
new mmp_on = 1
new menu

public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	mpm_map = register_cvar("amx_mpm_map", "de_dust2_2x2")
	mpm_players = register_cvar("amx_mpm_players", "10")
}

public mpm(id) {
	if(get_playersnum() <= get_pcvar_num(mpm_players)) {
		new mpm_map_str[32], nameMap[128]
		get_pcvar_string(mpm_map, mpm_map_str, charsmax(mpm_map_str))
		format(nameMap, 127, "\ySchimbam Harta pe %s?", mpm_map_str)
		menu=menu_create(nameMap,"mpm_menu")
		menu_additem(menu,"\wDa","1")
		menu_additem(menu,"\wNu","2")
		menu_setprop(menu,MPROP_EXIT,MEXIT_NEVER)
	
		menu_display(id,menu,0)
		
		
		set_task(get_cvar_float("amx_vote_time"), "mpm_result")
	}
}

public mpm_menu(id,menu,item) {
	new data[6],iName[64],access, callback, Name[32]
	get_user_name(id, Name, charsmax(Name))
 	menu_item_getinfo(menu,item,access,data,5,iName,63,callback)
	new key = str_to_num(data)
	
	switch(key) {
		case 1:{
			vote_yes = vote_yes + 1
			ColorChat(0, BLUE, "^01[^04Map Changer Information^01] Jucatorul ^03%s ^01a votat ^04[Pentru].", Name)
		}
		case 2:{
			vote_no = vote_no + 1
			ColorChat(0, RED, "^01[^04Map Changer Information^01] Jucatorul ^03%s ^01a votat ^04[Contra].", Name)
		}
	}
	return PLUGIN_HANDLED
}

public mpm_result() {
	new Map[32], mpm_map_str[32]
	menu_destroy(menu)
	get_mapname(Map, charsmax(Map)) 
	get_pcvar_string(mpm_map, mpm_map_str, charsmax(mpm_map_str)) 
	if(vote_yes >= vote_no) {
		ColorChat(0, RED, "^01[^04Map Changer Information^01] Votarea s-a incheiat, urmatoarea harta va fi ^03%s^01.", mpm_map_str)
		set_task(4.0, "mpm_changelevel")
	}
	else {
		ColorChat(0, RED, "^01[^04Map Changer Information^01] Datorita votarii, harta curenta va fi extinsa pentru ^03%d^01 minute.", get_cvar_num("amx_extendmap_step"))
		vote_yes = 0
		vote_no = 0
		set_task((get_cvar_float("amx_extendmap_step")*30), "mpm_extend")
	}
}

public mpm_changelevel() {
	new mpm_map_str[32]
	get_pcvar_string(mpm_map, mpm_map_str, charsmax(mpm_map_str)) 
	server_cmd("changelevel %s", mpm_map_str) 
}

public mpm_extend() {
	mmp_on = 1
}

public client_putinserver(id) {
	if(mmp_on != 1) 
		return PLUGIN_HANDLED

	new Players[32], Map[32], mpm_map_str[32]
	get_mapname(Map, charsmax(Map))
	get_pcvar_string(mpm_map, mpm_map_str, charsmax(mpm_map_str))
	if(equali(Map, mpm_map_str))
		return PLUGIN_HANDLED

	new playerCount, i, player
	get_players(Players, playerCount, "ch") 
	mmp_on = 0
	for (i=0; i<playerCount; i++) {
		player = Players[i]
		
		set_task(20.0, "mpm", player)
	}
	return PLUGIN_CONTINUE
}

public client_disconnect(id) {
	if(mmp_on != 1) 
		return PLUGIN_HANDLED

	new Players[32], Map[32], mpm_map_str[32]
	get_mapname(Map, charsmax(Map))
	get_pcvar_string(mpm_map, mpm_map_str, charsmax(mpm_map_str))
	if(equali(Map, mpm_map_str))
		return PLUGIN_HANDLED

	new playerCount, i, player
	get_players(Players, playerCount, "ch") 
	for (i=0; i<playerCount; i++) {
		player = Players[i]
		
		set_task(20.0, "mpm", player)
	}
	return PLUGIN_CONTINUE
}

Cu punctul 3 sunt CONTRA , las-o acolo ce ai cu de_train ca e cea mai faina :55: :42:
Viaţa însăşi este magie, iar dacă nu crezi asta, măcar încearcă să o trăieşti ca pe ceva magic.


©Rusu Radu

2024 CSGAMERS IS HERE
Post Reply

Return to “Propuneri | Sugestii”