ConnorMcLeod |
07-26-2009 07:32 |
Re: Jail Mod
Je te donne ce qu'on m'a déjà demandé :
PHP Code:
#include <amxmodx> #include <cstrike> #include <fakemeta> #include <hamsandwich>
#define PLUGIN "Jail FriendlyFire" #define AUTHOR "ConnorMcLeod" #define VERSION "0.0.2"
#define MAX_PLAYERS 32 #define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
new g_iMaxPlayers new g_bIsUserTe[MAX_PLAYERS+1]
public plugin_init() { register_plugin( PLUGIN, VERSION, AUTHOR )
RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1) RegisterHam(Ham_TraceAttack, "player", "Player_TraceAttack_Pre")
g_iMaxPlayers = get_maxplayers() }
public Player_Spawn_Post( id ) { if( is_user_alive(id) ) { g_bIsUserTe[id] = ( cs_get_user_team(id) == CS_TEAM_T ) } }
public Player_TraceAttack_Pre(id, iAttacker) { if( IsPlayer( iAttacker ) && id != iAttacker && g_bIsUserTe[id] && g_bIsUserTe[iAttacker] ) { return HAM_SUPERCEDE } return HAM_IGNORED }
Pour les models, utiliser ce plugin : http://forums.alliedmods.net/showthread.php?p=958925
La config à mettre pour le jail est là : http://forums.alliedmods.net/showthr...220#post960220
Avec le lien pour DL les models.
PHP Code:
#include <amxmodx> #include <engine>
#define VERSION "0.0.1"
public plugin_init() { register_plugin("Jail NoBuy", VERSION, "ConnorMcLeod") }
public plugin_precache() { new iEnt while( iEnt <= 0 ) { iEnt = create_entity("info_map_parameters") } DispatchKeyValue(iEnt, "buying", "3") DispatchSpawn(iEnt) }
public pfn_keyvalue( iEnt ) { new szClassName[32], szCrap[2] copy_keyvalue(szClassName, charsmax(szClassName), szCrap, charsmax(szCrap), szCrap, charsmax(szCrap)) if( equal(szClassName, "info_map_parameters") ) { remove_entity(iEnt) return PLUGIN_HANDLED } return PLUGIN_CONTINUE }
public plugin_cfg() { set_cvar_float("sv_restart", 1.0) }
PHP Code:
#include <amxmodx> #include <cstrike> #include <engine> #include <hamsandwich>
#define PLUGIN "Jail Voices" #define AUTHOR "ConnorMcLeod" #define VERSION "0.0.4"
new const g_iSpeakSettings[] = { SPEAK_LISTENALL, SPEAK_MUTED|SPEAK_LISTENALL, SPEAK_ALL|SPEAK_LISTENALL, SPEAK_LISTENALL }
public plugin_init() { register_plugin(PLUGIN, VERSION, AUTHOR) RegisterHam(Ham_Spawn, "player", "Player_Spawn_Post", 1) }
public Player_Spawn_Post( id ) { is_user_alive(id) { set_speak(id, g_iSpeakSettings[ _:cs_get_user_team(id) ] ) } }
PHP Code:
/* Formatright © 2009, ConnorMcLeod
Jail Rebel is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Jail Rebel; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include <amxmodx> #include <cstrike> #include <hamsandwich>
#define VERSION "0.0.1"
#define MAX_PLAYERS 32 #define IsPlayer(%1) ( 1 <= %1 <= g_iMaxPlayers )
new g_iTKills[MAX_PLAYERS+1] new g_bRebel[MAX_PLAYERS+1]
new g_iMaxPlayers new gmsgSayText
public plugin_init() { register_plugin("Jail Rebel", VERSION, "ConnorMcLeod")
RegisterHam(Ham_Killed, "player", "Player_Killed_Post", 1)
register_event("DeathMsg", "Event_DeathMsg", "a") register_event("Damage", "Event_Damage", "b", "2>0", "3=0")
g_iMaxPlayers = get_maxplayers() gmsgSayText = get_user_msgid("SayText") }
public client_putinserver(id) { g_bRebel[id] = false g_iTKills[id] = 0 }
public Player_Killed_Post( id ) { if( is_user_alive( id ) ) { g_bRebel[id] = false g_iTKills[id] = 0 } }
public Event_DeathMsg() { new iVictim = read_data(2) if( cs_get_user_team( iVictim ) == CS_TEAM_T ) { new iKiller = read_data(1) if( IsPlayer( iKiller ) && cs_get_user_team( iKiller ) == CS_TEAM_CT ) { if( g_bRebel[iVictim] ) { new szVName[32], szKName[32] get_user_name(iVictim, szVName, charsmax(szVName)) get_user_name(iKiller, szKName, charsmax(szKName)) client_print_c(0, "^4[JailBreak] ^1Guard ^4^"%s^"^1 killed rebel ^4^"%s^"", szKName, szKName) } else if( ++g_iTKills[iKiller] > 2 ) { new szKName[32] get_user_name(iKiller, szKName, charsmax(szKName)) user_silentkill( iKiller ) client_print_c(0, "^4[JailBreak] ^1Guard ^4^"%s^"^1 was slayed after killing more than 2 ^4prisoners", szKName) } } } }
public Event_Damage( id ) { if( (read_data(4) || read_data(5) || read_data(6)) && cs_get_user_team(id) == CS_TEAM_CT ) { new iAttacker = get_user_attacker(id) if( IsPlayer(iAttacker) && !g_bRebel[iAttacker] && is_user_alive(iAttacker) && cs_get_user_team(iAttacker) == CS_TEAM_T ) { new szName[32] get_user_name(iAttacker, szName, charsmax(szName)) g_bRebel[iAttacker] = true client_print_c(0, "^4[JailBreak] ^1Prisoner ^4^"%s^" ^1is a ^4rebel!", szName) } } }
client_print_c(const id, const fmt[], any:...) { new szString[128] szString[0] = 4
vformat(szString, sizeof( szString ) - 2, fmt, 2)
message_begin(id ? MSG_ONE_UNRELIABLE : MSG_BROADCAST, gmsgSayText, _, id) write_byte(1) write_string(szString) message_end() }
|