Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

Przerobienie Pluginu 2


  • Zamknięty Temat jest zamknięty
Brak odpowiedzi do tego tematu

#1 Mafioso_PL

    Życzliwy

  • Użytkownik

Reputacja: 2
Nowy

  • Postów:34
  • GG:
  • Lokalizacja:Wrocław
Offline

Napisano 18.10.2008 18:15

Witam, witam. Czy dało by się przerobić TEGO pluga tak aby dodane komuś fragi dodawane były to jego Statystyk? (/rank /top15 /rankstats)

Zamieszam .sma żeby było szybciej ;)

/***********************************************************************************
 *                                                                                   *
 *  Custom Frags And Deaths                                                          *
 *  by Arion                   http://forums.alliedmods.net/member.php?u=26333       *
 *                                                                                   *
 *  e-Mail/MSN: [email protected]                                                *
 *                                                                                   *
 *  Thread:		       http://forums.alliedmods.net/showthread.php?p=521631  *
 *                                                                                   *
 *                                                                                   * 
 *                                                                                   *
 *  Description:                                                                     *
 *    This plugin allows admins with the defined access level (Default ADMIN_BAN)    *
 *    to set a player's frags and deaths.                                            *
 *                                                                                   *
 *                                                                                   *
 *                                                                                   *
 *  Commands:                                                                        *
 *                                                                                   *
 *   amx_setfrags <nick> <frags>                                                     *
 *		example: amx_setfrags Arion 47                                       *
 *		Will set Arion's frags to 47                                         *
 *                                                                                   *
 *                                                                                   *
 *   amx_setdeaths <nick> <deaths>                                                   *
 *    		example: amx_setdeaths Arion 28                                      *
 *		Will set Arion's deaths to GUESS WHAT?                               *
 *                                                                                   *
 *                                                                                   *
 *   amx_setscore <nick> <frags> <deaths>                                            *
 *              example: amx_setscore Arion 85 36                                    *
 *		Will set Arion's frags to 85 and deaths to 36                        *
 *                                                                                   *
 *                                                                                   *
 *  To change everyone's frags or deaths, put * instead of the nick/authid:          *
 *   amx_setfrags * <frags>                                                          *
 *     example: amx_setfrags * 11                                                    *
 *     Will set everyone's frags to 11                                               *
 *     You can use * wildcard in all commands                                        *
 *                                                                                   *
 *  To change frags or deaths of one team only:                                      *
 *   amx_setdeaths @T <deaths>                                                       *
 *   amx_setscore @CT <frags> <deaths>                                               *
 *   Self explanatory..                                                              *
 *                                                                                   *
 *  To change frags or deaths of players who have a specific argument on name:       *
 *   amx_setfrags !ARGUMENT <frags>                                                  *
 *     example: amx_setfrags ![No0B] 8                                               *
 *     Will set the frags of all players who have [No0B] in their nick to 8          *
 *                                                                                   *
 *                                                                                   * 
 *  Frags and Deaths could be any integer value between -32768 and 32767             *
 *                                                                                   *
 *		                                                                     * 
 *  Changelog:                                                                       *
 *                                                                                   *
 *    v1.0 [08/22/2007] Initial Release                                              *
 *    v1.1 [08/23/2007] + Added amx_setscore                                         *
 *                      + Added Team-specific changes                                *
 *                      + Added Tag-specific changes                                 *
 *                      $ Code-Optimization                                          *
 *                                                                                   *
 ***********************************************************************************/
 
 
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fun>


#define PLUGIN 		"Custom Frags And Deaths"
#define VERSION 	"1.1"
#define AUTHOR 		"Arion"


#define ACCESS_LEVEL 	ADMIN_BAN


public plugin_init()
{
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_concmd("amx_setfrags", "set_frags", ACCESS_LEVEL, "<nick or #userid> <new user's frags>")
	register_concmd("amx_setdeaths", "set_deaths", ACCESS_LEVEL, "<nick or #userid> <new user's deaths>")	
	register_concmd("amx_setscore", "set_score", ACCESS_LEVEL, "<nick or #userid> <new user's frags> <new user's deaths>")	
}


public set_frags(id, level, cid)
{
	if (!cmd_access(id, level, cid, 3))
		return PLUGIN_HANDLED
		
	new arg1[33], arg2[33], newFrags
	read_argv(1, arg1, 32)
	read_argv(2, arg2, 32)
	newFrags = str_to_num(arg2)
	
	if(arg1[0] == '*')
		{
			new players[32], playersCount, i
			get_players(players, playersCount)
	
			for (i = 0; i < playersCount; i++)
				{
					if(!is_user_connected(players[i]))
					return PLUGIN_CONTINUE

					set_user_frags(players[i], newFrags)
				}
		}
		
	else if (arg1[0] == '@')
		{
			new team[32], teamCount, i
			
			if(equali(arg1[1], "T"))
			get_players(team, teamCount, "e", "TERRORIST")
			
			else if (equali(arg1[1], "CT"))
			get_players(team, teamCount, "e", "CT")
			
			for (i = 0; i < teamCount; i++)
				{
					
					if(!is_user_connected(team[i]))
					return PLUGIN_CONTINUE

					set_user_frags(team[i], newFrags)
				}
		}
		
	else if (arg1[0] == '!')
		{
			new tag[32], tagCount, i
			replace(arg1, 32, "!", "")
			get_players(tag, tagCount, "f", arg1)
			
			for (i = 0; i < tagCount; i++)
				{
					
					if(!is_user_connected(tag[i]))
					return PLUGIN_CONTINUE

					set_user_frags(tag[i], newFrags)
				}
		}

	else
		{
			new target = cmd_target(id, arg1, 3)
	
			if(!is_user_connected(target))
				return PLUGIN_HANDLED

			set_user_frags(target, newFrags)
		}
		
	return PLUGIN_HANDLED
	
}

public set_deaths(id, level, cid)
{
	if (!cmd_access(id, level, cid, 3))
		return PLUGIN_HANDLED
		
	new arg1[33], arg2[33], newDeaths
	read_argv(1, arg1, 32)
	read_argv(2, arg2, 32)
	newDeaths = str_to_num(arg2)
	
	if(arg1[0] == '*')
		{
			new players[32], playersCount, i
			get_players(players, playersCount)
	
			for (i = 0; i < playersCount; i++)
				{
					if(!is_user_connected(players[i]))
					return PLUGIN_CONTINUE

					cs_set_user_deaths(players[i], newDeaths)
				}
		}
		
	else if (arg1[0] == '@')
		{
			new team[32], teamCount, i
			
			if(equali(arg1[1], "T"))
			get_players(team, teamCount, "e", "TERRORIST")
			
			else if (equali(arg1[1], "CT"))
			get_players(team, teamCount, "e", "CT")
			
			for (i = 0; i < teamCount; i++)
				{
					
					if(!is_user_connected(team[i]))
					return PLUGIN_CONTINUE

					cs_set_user_deaths(team[i], newDeaths)
				}
		}
		
	else if (arg1[0] == '!')
		{
			new tag[32], tagCount, i
			replace(arg1, 32, "!", "")
			get_players(tag, tagCount, "f", arg1)
			
			for (i = 0; i < tagCount; i++)
				{
					
					if(!is_user_connected(tag[i]))
					return PLUGIN_CONTINUE

					cs_set_user_deaths(tag[i], newDeaths)
				}
		}

	else
		{
			new target = cmd_target(id, arg1, 3)
	
			if(!is_user_connected(target))
				return PLUGIN_HANDLED

			cs_set_user_deaths(target, newDeaths)	
		}

	return PLUGIN_HANDLED
	
}

public set_score(id, level, cid)
{
	if (!cmd_access(id, level, cid, 4))
		return PLUGIN_HANDLED
		
	new arg1[33], arg2[33], arg3[33], newFrags, newDeaths
	
	read_argv(1, arg1, 32)
	read_argv(2, arg2, 32)
	read_argv(3, arg3, 32)
	newFrags = str_to_num(arg2)
	newDeaths = str_to_num(arg3)

	if(arg1[0] == '*')
		{
			new players[32], playersCount, i
			get_players(players, playersCount)
	
			for (i = 0; i < playersCount; i++)
				{
					if(!is_user_connected(players[i]))
					return PLUGIN_CONTINUE

					set_user_frags(players[i], newFrags)
					cs_set_user_deaths(players[i], newDeaths)
				}
		}
		
	else if (arg1[0] == '@')
		{
			new team[32], teamCount, i
			
			if(equali(arg1[1], "T"))
			get_players(team, teamCount, "e", "TERRORIST")
			
			else if (equali(arg1[1], "CT"))
			get_players(team, teamCount, "e", "CT")
			
			for (i = 0; i < teamCount; i++)
				{
					
					if(!is_user_connected(team[i]))
					return PLUGIN_CONTINUE

					set_user_frags(team[i], newFrags)
					cs_set_user_deaths(team[i], newDeaths)
				}
		}
		
	else if (arg1[0] == '!')
		{
			new tag[32], tagCount, i
			replace(arg1, 32, "!", "")
			get_players(tag, tagCount, "f", arg1)
			
			for (i = 0; i < tagCount; i++)
				{
					
					if(!is_user_connected(tag[i]))
					return PLUGIN_CONTINUE

					set_user_frags(tag[i], newFrags)
					cs_set_user_deaths(tag[i], newDeaths)						
				}
		}

	else
		{
			new target = cmd_target(id, arg1, 3)
	
			if(!is_user_connected(target))
				return PLUGIN_HANDLED

			set_user_frags(target, newFrags)
			cs_set_user_deaths(target, newDeaths)	
		}

	return PLUGIN_HANDLED
}


[ Dodano: 23-10-2008, 23:44 ]
Witam ponownie :P
Żeby nie zakładać juz tematu:

Może ktoś przerobić to tak żeby banowało na 5 minut? Bo na razie tylko kickuje... :/

/* AMX Mod X script. 
* 
* No reconnect
* (c) Copyright 2002, SYZo
* This file is provided as is (no warranties). 
*
* amx_minreconnecttime 20 (in seconds)
*
*  *******************************************************************************
*   
*	Ported By KingPin( [email protected] ). I take no responsibility 
*	for this file in any way. Use at your own risk. No warranties of any kind. 
*
*  *******************************************************************************
*   Updated Feb 14 2006
* 
*/ 

#include <amxmodx> 
#include <engine> 
#define MAX_PLAYERS 32

#define PLUGIN "No reconnect"
#define VERSION "2.11"
#define AUTHOR "SYZo" 

new pip[MAX_PLAYERS][22]
new Float:minreconnecttime

public delayed_kick(user[]) {
    server_cmd("kick #%d",user[0])
}

public clean_blackip(ind[]) {
    pip[ind[0]][0] = 0
}

public client_connect(id) {
    if (!is_user_bot(id)) {
	minreconnecttime = get_cvar_float("amx_minreconnecttime")
	new userip[21+1]
	new uname[33+1]
    get_user_ip(id, userip, 21, 0)
	get_user_name(id, uname, 33)
	for(new i = 1; i <= MAX_PLAYERS; i++) {
	    if (equal(userip, pip[i], 21)) {
		new userid[1]
		userid[0] = get_user_userid(id)
		new authid[32]
		get_user_authid(id,authid,32)
		log_amx("^"%s<%s><%d><%s><>^"", uname, userip, get_user_userid(id), authid)
		if (!(get_user_flags(id)&ADMIN_IMMUNITY)) {
		    new text[128]
		    format(text, 128, "Player %s zostal zbanowany ", uname)
		    set_hudmessage(255, 0, 0, 0.05, 0.70, 0, 5.0, 6.0, 6.0, 0.15, 3)
		    show_hudmessage(0,"%s",text)
		    client_cmd(id,"echo [AMXX] Uzyles komendy RECONNECT within %f, Wroc na SERWER %f sec", minreconnecttime)
		    set_task(1.0,"delayed_kick",0,userid,1)
		}
		return PLUGIN_CONTINUE
	    }
	}
    }
    return PLUGIN_CONTINUE
}

public client_disconnect(id) {
    if (!is_user_bot(id)) {
	for(new i = 1; i <= MAX_PLAYERS; i++) {
	    if(pip[i][0] == 0) {
		new userip[21+1]
		get_user_ip(id, userip, 21, 0)
		copy(pip[i], 21, userip)
		new userid[1]
		userid[0] = i
		set_task(minreconnecttime, "clean_blackip", 0, userid[0], 1)
		return PLUGIN_CONTINUE
	    }
	}
    }
    return PLUGIN_CONTINUE
}

public plugin_init() { 
    register_plugin(PLUGIN, VERSION, AUTHOR)
    register_cvar("amx_minreconnecttime","20")
    return PLUGIN_CONTINUE 
}

  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych