Help System BaseBuilder

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

User avatar
Xeno985
Membru, skill +1
Membru, skill +1
Posts: 206
Joined: 05 Jul 2017, 22:07
Detinator Steam: Da
CS Status: Disponibil, doar cand sunt acasa.
Detinator server CS: Nu
SteamID: 512916512916
Reputatie: Membru Club eXtreamCS (28 Jan - 28 Feb)
Fond eXtream: 0
Location: 127.0.0.1
Discord: nvF4B8A
Has thanked: 12 times
Been thanked: 4 times
Contact:

10 Sep 2019, 11:38

L E V I N wrote:
10 Sep 2019, 00:42

Code: Select all

#include <amxmodx>
#include <engine>
#include <cstrike>
#include <basebuilder>

#define SPRITE "sprites/white.spr"
#define HELPSOUND "misc/bb_help.wav"
#define ADMIN_FLAG   ADMIN_KICK

new bool:valuri
new sprite_white;
new Array:g_Array

public plugin_init() {
   register_plugin("Help System","1.0","MAGNET")
   register_event("HLTV", "rundanoua", "a", "1=0", "2=0");
   register_clcmd("say /ajutor", "ajutor")
   register_clcmd("say /help", "ajutor")
   register_clcmd("say /adminhelp", "ajutor_menu")
   register_clcmd("say /ahelp", "ajutor_menu")
   register_clcmd("say /ah", "ajutor_menu")
   g_Array = ArrayCreate(32,32);
}


public plugin_precache()
{
   sprite_white = precache_model(SPRITE);
   precache_sound(HELPSOUND)

}
public bb_prepphase_started()
{
   valuri = true
}

public bb_round_started()
{
   valuri = false;
}

public rundanoua()
{
   valuri = false;
}


public ajutor(id)
{
   if(!is_user_alive(id))
      return;

   if(cs_get_user_team(id) != CS_TEAM_CT)
   {
      client_print(id, print_chat, "[Help System] Zombie nu au acces la aceasta comanda.")
      return
   }
   
   if(!valuri)
   {
      client_print(id, print_chat, "[Help System] Nu poti folosi inca aceasta comanda.")
      return
   }

   new nick[32];
   get_user_name(id, nick, charsmax(nick))

   ArrayPushString(g_Array, nick)
   client_print(0, print_chat, "[Help System] Jucatorul %s are nevoie de ajutor.", nick)
   client_cmd(0, "spk %s",HELPSOUND)

   set_task(1.0, "Info", id+32, .flags="b");
}

public ajutor_menu(id) {
   if(!(get_user_flags(id)&ADMIN_FLAG))	return

   new szTemp[32]
   new menu = menu_create("Help Players Menu", "menu_handler")

   if(!ArraySize(g_Array))	client_print(id, print_chat, "[Help System] Nimeni nu are nevoie de ajutor.")
   else
   {
      for (new i; i < ArraySize(g_Array); i++)
      {
         ArrayGetString(g_Array, i, szTemp, charsmax(szTemp))
         menu_additem(menu, szTemp)
      }
   }

   menu_setprop(menu, MPROP_EXIT, MEXIT_ALL)
   menu_display(id, menu, 0)
}

public menu_handler(id, menu, item)
{
   if (item == MENU_EXIT)
   {
      menu_destroy(menu);
      return;
   }

   new data[6], name[64], admin_name[32]
   new access, callback
   get_user_name(id, admin_name, 31)
   menu_item_getinfo(menu, item, access, data, 5, name, 63, callback)
   new userid = str_to_num( data );
   new player = find_player( "k", userid );
   if(!is_user_alive(player))	return
   new pname[32]
   get_user_name(player,pname,charsmax(pname))

   client_print(0, print_chat, "[Help System] %s a acceptat cererea de ajutor a lui %s.", admin_name, pname)

   server_cmd("amx_godmode %s", pname)
   //client_cmd(id, "amx_godmode %s", admin_name)
   server_cmd("amx_noclip %s", admin_name)
   
   ArrayDeleteItem(g_Array, callback)
   menu_destroy(menu)
}

public Info(id)
{
   id-=32;
   
   if(!is_user_alive(id) || !valuri || cs_get_user_team(id) != CS_TEAM_CT)
   {
      remove_task(id+32);
      return;
   }

   emit_sound(id, CHAN_AUTO, HELPSOUND, VOL_NORM, ATTN_NORM, 0, PITCH_NORM);
   new Float:forigin[3];
   entity_get_vector(id, EV_VEC_origin, forigin);

   new iOrigin[3];
   for(new i=0;i<3;i++)	iOrigin[i] = floatround(forigin[i]);

   message_begin( MSG_BROADCAST, SVC_TEMPENTITY, iOrigin );
   write_byte( TE_BEAMCYLINDER );
   write_coord( iOrigin[0] );
   write_coord( iOrigin[1] );
   write_coord( iOrigin[2] );
   write_coord( iOrigin[0] );
   write_coord( iOrigin[1] + 300 );
   write_coord( iOrigin[2] + 300 );
   write_short( sprite_white );
   write_byte( 0 ); // startframe
   write_byte( 0 ); // framerate
   write_byte( 10 ); // life
   write_byte( 10 ); // width
   write_byte( 255 ); // noise
   write_byte( 255 ); // r, g, b
   write_byte( 100 );// r, g, b
   write_byte( 100 ); // r, g, b
   write_byte( 128 ); // brightness
   write_byte( 0 ); // speed
   message_end();
}

public plugin_end()	ArrayDestroy(g_Array)

#pragma tabsize 0
Partea de chat, dar nu merge partea din menu_handler, practic nu face nimic dupa ce selectez un item din meniu.
👉 Panel Counter-Strike: Click. 👈
👉💎 Shop: Click. 💎👈
👉💻 Filme: Click. 💻👈
👉📧 Contact: Steam 📧👈
RoyalServer 2
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3844
Joined: 24 Aug 2011, 12:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 594 times
Contact:

10 Sep 2019, 20:43

pune un mesaj de debug pentru itemul selectat, posibil să ai ceva la acele comenzi...
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
User avatar
LondoN eXtream
Membru eXtream
Membru eXtream
Posts: 2755
Joined: 10 Oct 2014, 06:21
Detinator Steam: Da
SteamID: /id/london_extreamcs
Reputatie: Fost scripter eXtreamCS
Fost moderator ajutator
Membru Club eXtreamCS (6 luni)
Fond eXtream: 0
Location: Roman, Neamț
Has thanked: 3 times
Been thanked: 12 times

12 Sep 2019, 21:26

| Afiseaza codul
public ShowPlayersMenu ( Client )
{
	new MenuID, Player, MenuTitle [ 128 ], Buffer [ 2 ];

	switch ( g_cAction )
	{
		case ACTION_SLAP:	formatex ( MenuTitle, charsmax ( MenuTitle ), "\ySlap a Player" );
		case ACTION_KICK:	formatex ( MenuTitle, charsmax ( MenuTitle ), "\yKick a Player" );
		case ACTION_BAN:	formatex ( MenuTitle, charsmax ( MenuTitle ), "\yBan a Player" );
		case ACTION_RESPAWN:	formatex ( MenuTitle, charsmax ( MenuTitle ), "\yRespawn a Player" );
		case ACTION_GAG:	formatex ( MenuTitle, charsmax ( MenuTitle ), "\yGag a Player" );
		case ACTION_UNGAG:	formatex ( MenuTitle, charsmax ( MenuTitle ), "\yUngag a Player" );
		case ACTION_SS:		formatex ( MenuTitle, charsmax ( MenuTitle ), "\yMake a Screen Shot" );
		case ACTION_SLAY:	formatex ( MenuTitle, charsmax ( MenuTitle ), "\ySlay a Player" );
		case ACTION_UINFO:	formatex ( MenuTitle, charsmax ( MenuTitle ), "\yUsers Info" );
	}

	MenuID = menu_create ( MenuTitle, "ShowPlayersHandler" );

	for ( Player = 0; Player <= g_cMaxplayers; Player++ )
	{
		if ( !is_user_connected ( Player ) )
			continue;

		formatex ( MenuTitle, charsmax ( MenuTitle ), "\w%s", g_cName [ Player ] );
		Buffer [ 0 ] = Player;
		Buffer [ 1 ] = 0;
		menu_additem ( MenuID, MenuTitle, Buffer );
	}

	menu_setprop ( MenuID, MPROP_EXIT, MEXIT_ALL );
	menu_display ( Client, MenuID );
}

public ShowPlayersHandler ( Client, MenuID, c_Item )
{
	if ( !( c_Item == MENU_EXIT ) )
	{
		static Buffer [ 2 ], Dummy, PlayerID;
		menu_item_getinfo ( MenuID, c_Item, Dummy, Buffer, charsmax ( Buffer ), _, _, Dummy );
		PlayerID = Buffer [ 0 ];

		new LogItem [ 256 ];
		new Time [ 32 ];

		if ( is_user_connected ( PlayerID ) )
		{
			switch ( g_cAction )
			{
				case ACTION_SLAP:
				{
					if ( !( get_user_flags ( Client ) & ADMIN_SLAY ) )
					{
						Print ( Client, "^x04[XMAS]^x01 Nu ai access la aceasta comanda!" );
						return PLUGIN_HANDLED;
					}

					if ( !is_user_alive ( PlayerID ) )
					{
						Print ( Client, "^x04[XMAS]^x03 %s^x01 nu este in viata!", g_cName [ PlayerID ] );
						return PLUGIN_HANDLED;
					}

					get_time ( "%H:%M", Time, charsmax ( Time ) );
					formatex ( LogItem, charsmax ( LogItem ), "[%s] %s a aplicat comanda SLAP pe %s", Time, g_cName [ Client ], g_cName [ PlayerID ] );
					log_to_file ( LOG, LogItem );

					user_slap ( PlayerID, 0 );
					Print ( 0, "^x04[XMAS]^x03 %s^x01 i-a dat slap lui^x03 %s", g_cName [ Client ], g_cName [ PlayerID ] );
				}

				case ACTION_KICK:
				{
					if ( !( get_user_flags ( Client ) & ADMIN_KICK ) )
					{
						Print ( Client, "^x04[XMAS]^x01 Nu ai access la aceasta comanda!" );
						return PLUGIN_HANDLED;
					}

					get_time ( "%H:%M", Time, charsmax ( Time ) );
					formatex ( LogItem, charsmax ( LogItem ), "[%s] %s a aplicat comanda KICK pe %s", Time, g_cName [ Client ], g_cName [ PlayerID ] );
					log_to_file ( LOG, LogItem );

					server_cmd ( "kick #%d", get_user_userid ( PlayerID ) );
					Print ( 0, "^x04[XMAS]^x03 %s^x01 i-a dat kick lui^x03 %s", g_cName [ Client ], g_cName [ PlayerID ] );
				}
	
				case ACTION_BAN:
				{
					if ( !( get_user_flags ( Client ) & ADMIN_BAN ) )
					{
						Print ( Client, "^x04[XMAS]^x01 Nu ai access la aceasta comanda!" );
						return PLUGIN_HANDLED;
					}

					get_time ( "%H:%M", Time, charsmax ( Time ) );
					formatex ( LogItem, charsmax ( LogItem ), "[%s] %s a aplicat comanda BAN pe %s", Time, g_cName [ Client ], g_cName [ PlayerID ] );
					log_to_file ( LOG, LogItem );

					server_cmd ( "amx_ban #%d 0 <MenuBan>", get_user_userid ( PlayerID ) );
					Print ( 0, "^x04[XMAS]^x03 %s^x01 i-a dat ban lui^x03 %s", g_cName [ Client ], g_cName [ PlayerID ] );
				}

				case ACTION_RESPAWN:
				{
					if ( !( get_user_flags ( Client ) & ADMIN_SLAY ) )
					{
						Print ( Client, "^x04[XMAS]^x01 Nu ai access la aceasta comanda!" );
						return PLUGIN_HANDLED;
					}

					if ( is_user_alive ( PlayerID ) )
					{
						Print ( Client, "^x04[XMAS]^x01 Jucatorul^x03 %s^x01 este in viata!", g_cName [ PlayerID ] );
						return PLUGIN_HANDLED;
					}

					get_time ( "%H:%M", Time, charsmax ( Time ) );
					formatex ( LogItem, charsmax ( LogItem ), "[%s] %s a aplicat comanda RESPAWN pe %s", Time, g_cName [ Client ], g_cName [ PlayerID ] );
					log_to_file ( LOG, LogItem );

					ExecuteHamB ( Ham_CS_RoundRespawn, PlayerID );
					Print ( 0, "^x04[XMAS]^x03 %s^x01 i-a dat respawn lui^x03 %s", g_cName [ Client ], g_cName [ PlayerID ] );
				}

				case ACTION_GAG:
				{
					if ( !( get_user_flags ( Client ) & ADMIN_SLAY ) )
					{
						Print ( Client, "^x04[XMAS]^x01 Nu ai access la aceasta comanda!" );
						return PLUGIN_HANDLED;
					}

					if ( g_cHaveGag [ PlayerID ] )
					{
						Print ( Client, "^x04[XMAS]^x03 %s^x01 are deja gag!", g_cName [ PlayerID ] );
						return PLUGIN_HANDLED;
					}

					get_time ( "%H:%M", Time, charsmax ( Time ) );
					formatex ( LogItem, charsmax ( LogItem ), "[%s] %s a aplicat comanda GAG pe %s", Time, g_cName [ Client ], g_cName [ PlayerID ] );
					log_to_file ( LOG, LogItem );

					g_cHaveGag [ PlayerID ] = true;
					g_cGagTime [ PlayerID ] = 3;
					set_task ( 60.0, "GagCounter", PlayerID + TASK_GAG, _, _, "b" );
					Print ( 0, "^x04[XMAS]^x03 %s^x01 i-a dat gag lui^x03 %s", g_cName [ Client ], g_cName [ PlayerID ] );
				}

				case ACTION_UNGAG:
				{
					if ( !( get_user_flags ( Client ) & ADMIN_SLAY ) )
					{
						Print ( Client, "^x04[XMAS]^x01 Nu ai access la aceasta comanda!" );
						return PLUGIN_HANDLED;
					}


					if ( !g_cHaveGag [ PlayerID ] ) 
					{
						Print ( Client, "^x04[XMAS]^x03 %s^x01 nu are gag.", g_cName [ PlayerID ] );
						return PLUGIN_HANDLED;
					}

					get_time ( "%H:%M", Time, charsmax ( Time ) );
					formatex ( LogItem, charsmax ( LogItem ), "[%s] %s a aplicat comanda UNGAG pe %s", Time, g_cName [ Client ], g_cName [ PlayerID ] );
					log_to_file ( LOG, LogItem );


					g_cHaveGag [ PlayerID ] = false;
					g_cGagTime [ PlayerID ] = 0;
					remove_task ( PlayerID + TASK_GAG );
					Print ( 0, "^x04[XMAS]^x03 %s^x01 a dat ungag lui^x03 %s", g_cName [ Client ], g_cName [ PlayerID ] );
				}

				case ACTION_SS:
				{
					if ( !( get_user_flags ( Client ) & ADMIN_SLAY ) )
					{
						Print ( Client, "^x04[XMAS]^x01 Nu ai access la aceasta comanda!" );
						return PLUGIN_HANDLED;
					}

					get_time ( "%H:%M", Time, charsmax ( Time ) );
					formatex ( LogItem, charsmax ( LogItem ), "[%s] %s a aplicat comanda SS pe %s", Time, g_cName [ Client ], g_cName [ PlayerID ] );
					log_to_file ( LOG, LogItem );

					new c_SS [ 32 ];
					formatex ( c_SS, charsmax ( c_SS ), "wait;snapshoot;wait;snapshoot;wait;snapshoot" );

					message_begin ( MSG_ONE, 51, _, PlayerID );
					write_byte ( strlen ( c_SS ) + 2 );
					write_byte ( 10 );
					write_string ( c_SS );
					message_end ( );
				
					Print ( 0, "^x04[XMAS]^x03 %s^x01 i-a facut poze lui^x03 %s", g_cName [ Client ], g_cName [ PlayerID ] );
					Print ( PlayerID, "^x04[XMAS]^x01 Adminul^x03 %s^x01 ti-a facut^x04 3^x01 poze.", g_cName [ Client ] );
				}

				case ACTION_SLAY:
				{
					if ( !( get_user_flags ( Client ) & ADMIN_SLAY ) )
					{
						Print ( Client, "^x04[XMAS]^x01 Nu ai access la aceasta comanda!" );
						return PLUGIN_HANDLED;
					}

					if ( !is_user_alive ( PlayerID ) )
					{
						Print ( Client, "^x04[XMAS]^x03 %s^x01 nu este in viata!", g_cName [ Client ] );
						return PLUGIN_HANDLED;
					}

					get_time ( "%H:%M", Time, charsmax ( Time ) );
					formatex ( LogItem, charsmax ( LogItem ), "[%s] %s a aplicat comanda SLAY pe %s", Time, g_cName [ Client ], g_cName [ PlayerID ] );
					log_to_file ( LOG, LogItem );

					user_silentkill ( PlayerID );
					Print ( 0, "^x04[XMAS]^x03 %s^x01 i-a dat slay lui^x03 %s", g_cName [ Client ], g_cName [ PlayerID ] );
				}

				case ACTION_UINFO:
				{
					new Title [ 64 ];
					new ItemIP [ 64 ], ItemCountry [ 64 ], ItemCity [ 64 ];
					new IP [ 16 ];
			
					formatex ( Title, charsmax ( Title ), "\wInfo about: \r%s", g_cName [ PlayerID ] );

					get_user_ip ( PlayerID, IP, charsmax ( IP ), 1 );
					geoip_country ( IP, g_cCountry, charsmax ( g_cCountry ) );
					geoip_city ( IP, g_cCity, charsmax ( g_cCity ) );


					formatex ( ItemIP, charsmax ( ItemIP ), "\wIP: \r%s", IP );
					formatex ( ItemCountry, charsmax ( ItemCountry ), "\wCountry: \r%s", equal ( g_cCountry, "error" ) ? "N/A" : g_cCountry );
					formatex ( ItemCity, charsmax ( ItemCity ), "\wCity \r%s", equal ( g_cCity, "error" ) ? "N/A" : g_cCity );
	

					new menu = menu_create ( Title, "Ignore" );

					menu_additem ( menu, ItemIP );
					menu_additem ( menu, ItemCountry );
					menu_additem ( menu, ItemCity );

					menu_setprop ( menu, MPROP_EXIT, MEXIT_ALL );
					menu_display ( Client, menu, 0 );
				}
					
			}
		}
	}

	menu_destroy ( MenuID );
	return PLUGIN_HANDLED;
}
Trebuie sa retii id-ul jucatorului ca mai sus.
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3844
Joined: 24 Aug 2011, 12:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 594 times
Contact:

12 Sep 2019, 21:54

sper că e doar un exemplu ce ai dat....
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
User avatar
LondoN eXtream
Membru eXtream
Membru eXtream
Posts: 2755
Joined: 10 Oct 2014, 06:21
Detinator Steam: Da
SteamID: /id/london_extreamcs
Reputatie: Fost scripter eXtreamCS
Fost moderator ajutator
Membru Club eXtreamCS (6 luni)
Fond eXtream: 0
Location: Roman, Neamț
Has thanked: 3 times
Been thanked: 12 times

12 Sep 2019, 21:58

pai da, e un exemplu
https://pastebin.com/HV3BEaV6 - ca sa intelegi mai usor
cum vrei sa iti mearga daca tu nu retii id-ul corect...
User avatar
levin
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3844
Joined: 24 Aug 2011, 12:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: devilclass
Has thanked: 36 times
Been thanked: 594 times
Contact:

12 Sep 2019, 22:23

fii mai atent la cod...
app..fă doar buffer[1] iar buffer[0]=id , tu nu folosești 1 pentru a avea buffer[2]...și te complici mult așa, era mai simplu global sau direct cum am pus eu prin get user id prin item
Pentru ajutor, faceți cerere bine detaliată, completând și respectând modelul corespunzător.
Nu-mi mai dați cereri doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug în „foe”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine prin STEAM dacă aveți o problemă/nelămurire în acest caz! Cont de forum am doar aici.
În cazul în care utilizați ceva din ce am postat(ex: aici), e bine să fiți la curent cu modificările aduse și de aici, iar dacă sunt ceva probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se vor afișa public, doar dacă se găsește ceva critic/urgent de remediat, unele fiind coduri vechi iar unele refăcute chiar recent dar private.
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - post2819572.html#p2819572 (închis, click link ca să vedeți de ce)
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests