Sugestie imbunatatire plugin ?

Tutoriale scripting, cod si portiuni de cod.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Post Reply
User avatar
N3v3rM1nd
Membru, skill +1
Membru, skill +1
Posts: 441
Joined: 06 Oct 2018, 13:41
Detinator Steam: Da
Fond eXtream: 0
Location: La mine in casa :D
Has thanked: 78 times
Been thanked: 17 times

08 Apr 2021, 00:52

Nu am stiu ce titlu sa pun :face_with_monocle: , oricum asta e plg

Code: Select all

#include <amxmodx>
#include <amxmisc>

#define Motive "Use normal Counter-Strike _/_"

public plugin_init()
{
	register_plugin("Kick la valveri", "1.0", "Not N3v3r#")
}

public client_authorized(id)
{
	if(is_user_bot(id) || is_user_hltv(id)) return
		new steamid[33]
		get_user_authid(id, steamid, charsmax(steamid))

		if(equali(steamid,"STEAM:4:0:"))
		{
			set_task(5.0, "KickLaValver", 0, "", 0, "", 0);
		}
		else if(equali(steamid,"STEAM:0:4:"))
		{
			set_task(5.0, "KickLaValver", 0, "", 0, "", 0);
		}

}

public KickLaValver(id)
{
	new steamid[33]
	get_user_authid(id, steamid, charsmax(steamid))	
	server_cmd("kick #%d ^"%s^"", get_user_userid(id), Motive)
}

L-am facut pentru butii care intra cu nvidia si joaca cu coduri , in mod normal le-ar da kick ( nu am testat inca ), vreo sugestie cum l-as putea imbunatati ? Nu sunt asa bun in amxx sa fac vreun miracol :) , dar am deja niste idei..
Aen
lexz
Membru, skill +1
Membru, skill +1
Posts: 122
Joined: 02 Nov 2020, 01:57
Detinator Steam: Da
Fond eXtream: 0
Has thanked: 7 times
Been thanked: 12 times

09 Apr 2021, 03:02

Poti sa faci asa:

Code: Select all

#include <amxmodx>
#include <amxmisc>

#if !MAX_PLAYERS 
	#define MAX_PLAYERS 32
	#define MAX_AUTHID_LENGTH 33
#endif

new const Motive [ ] = "Use normal Counter-Strike _/_"

new iAuthID [ MAX_PLAYERS + 1 ] [ MAX_AUTHID_LENGTH ]

new const IlegalSteamID [ ] [ ] = 
{
	"STEAM:4:0:",
	"STEAM:0:4:",
	"VALVE_ID_LAN",
	"STEAM_ID_LAN"
}

public plugin_init ( )
{
	register_plugin("Kick la valveri", "1.0", "Not N3v3r#")
}

public client_authorized ( id )
{
	if( is_user_bot ( id ) || is_user_hltv ( id ) )
		return PLUGIN_HANDLED

	get_user_authid(id, iAuthID [ id ], charsmax( iAuthID [ ] ))

	for ( new i; i < sizeof ( IlegalSteamID ); i++ )
	{
		if(equali(iAuthID [ id ], IlegalSteamID [ i ]))
		{
			kickvalver ( id )
		}
	}

	return PLUGIN_CONTINUE
}

stock kickvalver ( id )
{
	server_cmd ( "kick #%d ^"%s^"", iAuthID [ id ] , Motive )
}
un nume bun ar fi anti valve players :D
User avatar
robbencsgo
Membru, skill 0
Membru, skill 0
Posts: 92
Joined: 31 Aug 2019, 18:14
Detinator Steam: Da
CS Status: aimer
SteamID: an prevat
Fond eXtream: 0
Has thanked: 8 times
Been thanked: 10 times
Contact:

09 Apr 2021, 10:40

De ce equali si nu containi? de obicei steamid-ul nu e format gen: STEAM:4:0:1231232183 sau ceva de genu gen mai sunt niste numere dupa, nu ar fi mai ok containi?
Daca te-am ajutat, lasa si tu un +1
lexz
Membru, skill +1
Membru, skill +1
Posts: 122
Joined: 02 Nov 2020, 01:57
Detinator Steam: Da
Fond eXtream: 0
Has thanked: 7 times
Been thanked: 12 times

10 Apr 2021, 02:16

da, containi sau contain trebuie folosit, eu doar am dat copy paste si am modificat cum am stiut eu mai bine
ZackChoi
Membru, skill +1
Membru, skill +1
Posts: 150
Joined: 28 Dec 2019, 01:39
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 1 time
Been thanked: 7 times

10 Apr 2021, 19:06

Code: Select all

#include < amxmodx >
#include < amxmisc >

new const g_szIlegalSteamID [ ] =
{
	"STEAM:4:0:",
	"STEAM:0:4:",
	"VALVE_ID_LAN",
	"STEAM_ID_LAN"
};

public client_connect ( iEntity )
{
	if ( is_user_bot ( iEntity ) || is_user_hltv ( iEntity ) )
		return;

	new steamID [ 45 ];
	get_user_authid ( iEntity, steamID, charsmax ( steamID ) );

	for ( new i = 0; i < sizeof g_szIlegalSteamID; i++ )
	{
		if ( containi ( steamID, g_szIlegalSteamID [ i ] ) != -1 )
			server_cmd ( "kick #%d ^"Ilegal SteamID^"", get_user_userid ( iEntity ) );
	}
}
Post Reply

Return to “Scripting”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest