Plugins Snipe.
Dernière réponse : dans Jeux
Yop.
Euh... Je recherche un plugins pour permettre d'autoriser le Snipe à seulement un par équipe.
Si vous le connaissez, veuillez m'en faire part.
Merci!
Euh... Je recherche un plugins pour permettre d'autoriser le Snipe à seulement un par équipe.
Si vous le connaissez, veuillez m'en faire part.
Merci!
Autres pages sur : plugins snipe
Lassé par la pub ? Créez un compte
http://www.cs-amx.com/telecharger-awp-limit-378.htm
Je pense qu'en le modifiant un peu (tu peut trouver un tuto sur le site) tu peut le limiter à 1 par équipe !
Ps: Si ta pas envie de t'inscrire pour DL le truc demande moi par MP je n'utilise pas mon compte ^^
Je pense qu'en le modifiant un peu (tu peut trouver un tuto sur le site) tu peut le limiter à 1 par équipe !
Ps: Si ta pas envie de t'inscrire pour DL le truc demande moi par MP je n'utilise pas mon compte ^^
#include <amxmod>
//This line needs to be uncommented if you are running CS1.6
#define CSTRIKE16
#if defined CSTRIKE16
#define MAXMENUPOS 19
#else
#define MAXMENUPOS 16
#endif
//---------------------- CS 1.6 Buy Alias Menu ---------------------
/*All the CS1.6 buy aliases that purchase things that take a up a
primary slot are listed here. It helps track what primary weapon
clients are trying to buy for later on.*/
#if defined CSTRIKE16
new g_Aliases[MAXMENUPOS][] = {
"shield",//Item
"m3",//Shotguns
"xm1014",
"mp5",//SMG
"tmp",
"p90",
"mac10",
"ump45",
"ak47",//Rifles
"galil",
"famas",
"sg552",
"m4a1",
"aug",
"scout",
"awp",
"g3sg1",
"sg550",
"m249" //Machine Gun
}
new g_Aliases2[MAXMENUPOS][] = {
"shield",//Item
"12gauge",//Shotguns
"autoshotgun",
"smg",//SMG
"mp",
"c90",
"mac10",
"ump45",
"cv47",//Rifles
"defender",
"clarion",
"krieg552",
"m4a1",
"bullpup",
"scout",
"magnum",
"d3au1",
"krieg550",
"m249" //Machine Gun
}
#endif
//---------------- End CS1.6 Specific Globals ---------------------
new g_msg[] = "Your team has enough AWPs!"
new g_blockedCommand[] = "Autobuy and Rebuy is disabled!"
new g_awpNum[3]
new bool:g_hasAwp[33]
public plugin_init() {
register_plugin("AWP Limit","1.4","out}|ast134")
register_cvar("amx_maxawp","1")
#if defined CSTRIKE16
register_menucmd(register_menuid("BuyRifle", 1 ),1<<5,"checkAwpCT")
register_menucmd(-31,1<<5,"checkAwpCT")
register_menucmd(register_menuid("BuyRifle", 1 ),1<<4,"checkAwpT")
register_menucmd(-31,1<<4,"checkAwpT")
register_menucmd(register_menuid("BuyItem", 1 ),511,"menuItem")
register_menucmd(-34,511,"menuItem")
register_clcmd("cl_setautobuy","blockcommand")
register_clcmd("cl_autobuy","blockcommand")
register_clcmd("cl_setrebuy","blockcommand")
register_clcmd("cl_rebuy","blockcommand")
#else
register_menucmd(register_menuid("BuyRifle", 1 ),1<<5,"checkAwp")
register_menucmd(-31,1<<5,"checkAwp")
#endif
register_clcmd("drop","cmdDrop")
register_event("WeapPickup","ePickUp","b","1=18")
register_event("WeapPickup","eBuyOther","b")
register_event("DeathMsg","eDeath","a")
register_event("TextMsg", "eRestart", "a","2&Game_C", "2&Game_w" )
register_event("RoundTime","eNewRound","bc")
register_concmd("amx_awplimit","amx_awplimit",ADMIN_CVAR,"<Max Awps Per Team> - Sets # of awps allowed per team (min=0,max=16)")
/*This little bit of code turns the awp limiter off for "awp_"
style maps so that the plugin does not get in the way of the
gameplay on those maps.*/
new cur_map[5]
get_mapname(cur_map,4)
if ( equali(cur_map,"awp_",4) )
pause("a","awp_limiter.amx")
}
//------------------- CS 1.6 Specific Functions --------------------
/*This checks to see if the awp was bought on the terrorist side in CS 1.6
with the use of the menuselect scripting method of buy scripts.*/
public checkAwpT(id,menu,key) {
new team = get_user_team(id)
new maxAwpnum = get_cvar_num("amx_maxawp")
if (team == 2)
return PLUGIN_CONTINUE
/* If awps are at max for player's team then close the menu and tell
them they cannot have one.*/
if(g_awpNum[team] >= maxAwpnum) {
engclient_cmd(id,"menuselect","10")
client_print(id,print_center,g_msg)
return PLUGIN_HANDLED
/*Allow the awp purchase if the team has less than the max allowed.
And count the awp purchase against the teams total.*/
} else if( g_awpNum[team] < maxAwpnum) {
g_awpNum[team]++
g_hasAwp[id] = true
}
return PLUGIN_CONTINUE
}
/*This checks to see if the awp was bought on the counter-terrorist side in
CS 1.6 with the use of the menuselect scripting method of buy scripts.*/
public checkAwpCT(id,menu,key) {
new team = get_user_team(id)
new maxAwpnum = get_cvar_num("amx_maxawp")
if (team == 1)
return PLUGIN_CONTINUE
/* If awps are at max for player's team then close the menu and tell
them they cannot have one.*/
if(g_awpNum[team] >= maxAwpnum) {
engclient_cmd(id,"menuselect","10")
client_print(id,print_center,g_msg)
return PLUGIN_HANDLED
/*Allow the awp purchase if the team has less than the max allowed.
And count the awp purchase against the teams total.*/
} else if( g_awpNum[team] < maxAwpnum) {
g_awpNum[team]++
g_hasAwp[id] = true
}
return PLUGIN_CONTINUE
}
//Helps handle shield purchase.
public menuItem(id,key) return checkShield(id,6,key)
/*Checks to see if a player actually isn't carrying the awp anymore
after trying to use a new 1.6 hotkey command so that the awp number
is not decreased if the player used the command but did not have
enough money for the other gun and thus still has the awp.*/
#if defined CSTRIKE16
bool:hasAwpStill(id) {
new weaps[32], num
get_user_weapons(id,weaps,num)
for(new i = 0; i < num; i++) {
if( weaps[i] == 18) {
return true
}
}
return false
}
#endif
/*The function that checks weapon purchases with the new hotkey console command
aliases in CS 1.6.*/
#if defined CSTRIKE16
public client_command( id ) {
new arg[10]
read_argv(0,arg,9)
for(new i=0; i<MAXMENUPOS; i++) {
if (equal(arg,g_Aliases[i]) || equal(arg,g_Aliases2[i])) {
/*Compares client command with list if aliases from above. If alias
equals awp then only let them buy it if their team hasn't reached
its max.*/
if (equal(arg,"awp") || equal(arg,"magnum")) {
new team = get_user_team(id)
new maxAwpnum = get_cvar_num("amx_maxawp")
if(g_awpNum[team] < maxAwpnum) {
g_awpNum[team]++
g_hasAwp[id] = true
return PLUGIN_CONTINUE
} else {
client_print( id, print_center , g_msg )
return PLUGIN_HANDLED
}
} else {
/*If the alias is any other than AWP check whether they have
one anymore.*/
if (g_hasAwp[id] == true && !hasAwpStill(id)) {
/*If the player bought a different gun make sure his has_awp
is reset to false and 1 is subtracted from team total only if he
had an awp prior to the new purchase.*/
new team = get_user_team(id)
g_awpNum[team]--
g_hasAwp[id] = false
return PLUGIN_CONTINUE
}
}
}
}
return PLUGIN_CONTINUE
}
#endif
/*This blocks the new autobuy and rebuy functions in CS 1.6 so that
players cannot use it to go around the awp restriction.*/
#if defined CSTRIKE16
public blockcommand(id) {
client_print(id,print_center, g_blockedCommand )
return PLUGIN_HANDLED
}
#endif
/*Checks to see if a player buys shield. If they do then they must
have dropped their awp.*/
public checkShield(id,menu,key) {
if(menu == 6 && key == 8) {
if(g_hasAwp[id] == true) {
new team = get_user_team(id)
g_awpNum[team]--
g_hasAwp[id] = false
return PLUGIN_CONTINUE
}
}
return PLUGIN_CONTINUE
}
//----------------- End CS 1.6 Specific Functions ------------------
/*This checks to see if the awp was bought with the use of the
menuselect scripting method of buy scripts in CS 1.5.*/
public checkAwp(id,menu,key) {
new team = get_user_team(id)
new maxAwpnum = get_cvar_num("amx_maxawp")
/* If awps are at max for player's team then close the menu and tell
them they cannot have one.*/
if(g_awpNum[team] >= maxAwpnum) {
engclient_cmd(id,"menuselect","10")
client_print(id,print_center,g_msg)
return PLUGIN_HANDLED
/*Allow the awp purchase if the team has less than the max allowed.
And count the awp purchase against the teams total.*/
} else if( g_awpNum[team] < maxAwpnum) {
g_awpNum[team]++
g_hasAwp[id] = true
}
return PLUGIN_CONTINUE
}
/*Checks to make sure the user bought a different non secondary weapon.
Also awp is included here because if the user has an awp and buys another
one we still want to count it as having an awp.
The values represent secondary or other weapons in this order...
p228,hegren,c4,smoke,berettas,fiveseven,usp,glock,awp,flash,deagle,knife*/
bool:wIsPrimary(w) {
if(w == 1 || w == 4 || w == 6 || w == 9 || w == 10 ||
w == 11 || w == 16 || w == 17 || w == 18 || w == 25 ||
w == 26 || w == 29) {
return false
}
return true
}
/*Checks to see if player bought a different primary weapon.
If they did and they had an awp we have to register the drop.*/
public eBuyOther(id) {
new weapon = read_data(1)
if ( wIsPrimary(weapon) ) {
if (g_hasAwp[id] == true) {
new team = get_user_team(id)
g_awpNum[team]--
g_hasAwp[id] = false
return PLUGIN_CONTINUE
}
}
return PLUGIN_HANDLED
}
public ePickUp(id) {
new team = get_user_team( id )
new maxAwpnum = get_cvar_num("amx_maxawp")
if (g_hasAwp[id] == false) {
//Only let player pick up an awp if their team hasn't reached its limit.
if (g_awpNum[team] < maxAwpnum) {
g_hasAwp[id] = true
g_awpNum[team]++
return PLUGIN_CONTINUE
//If his team has the max allowed awps force him to throw it.
} else {
new param[1]
param[0] = id
set_task(0.5,"dropWeapon",0,param,1)
client_print( id, print_center , g_msg )
}
}
return PLUGIN_HANDLED
}
//Carries out the forced throw command.
public dropWeapon( param[] ) {
engclient_cmd( param[0] , "weapon_awp" )
engclient_cmd( param[0] , "drop" )
}
//Carries out the awp recount that takes place at round start.
public eNewRound() {
if ( read_data(1) == floatround(get_cvar_float("mp_roundtime") * 60.0) ) {
set_task(0.3,"recountAwp")
}
}
/*Recounts the number of awps carried on each team at round start
to maintain count accuracy that may be messed up by autoteambalance
and other factors*/
public recountAwp() {
new T = 0
new CT = 0
for(new i = 1;i < 33;i++) {
if(g_hasAwp[i] == true) {
new team = get_user_team(i)
if(team == 1) {
T++
} else if(team == 2) {
CT++
}
}
}
g_awpNum[1] = T
g_awpNum[2] = CT
return PLUGIN_CONTINUE
}
/*If a player intentionally throws the awp reset his value to false
and subtract 1 from his teams total.*/
public cmdDrop(id) {
new a,b
new team = get_user_team( id )
if( g_hasAwp[id] ) {
if ( get_user_weapon(id,a,b) == 18 ) {
g_hasAwp[id] = false
g_awpNum[team]--
}
}
return PLUGIN_CONTINUE
}
/*If a player dies while holding an awp reset his value and subtract 1
from his teams total.*/
public eDeath() {
client_disconnect(read_data(2))
}
/*If a player disconnects while holding an awp reset his value and subtract 1
from his teams total.*/
public client_disconnect(id) {
new team = get_user_team(id)
if ( g_hasAwp[id] ) {
g_hasAwp[id] = false
g_awpNum[team]--
}
}
/*Resets all the players to false and counts to zero if map
is restarted or a new map starts.*/
public eRestart() {
g_awpNum[0] = g_awpNum[1] = g_awpNum[2] = 0
for(new a = 1; a < 33; ++a)
g_hasAwp[a] = false
}
/*Function to check a users admin access to see if they have
the proper access to change the max awps allowed per team.*/
public user_check_auth(id) { //Check for proper access level.
if (get_user_flags(id)&ADMIN_RCON)
return 1
return 0
}
/*Function that allows admins to change the number of awps allowed per team
on the current map, and sets it as default for the server.*/
public amx_awplimit(id) {
if (!user_check_auth(id)) {
client_print(id,print_console,"Access denied!")
return PLUGIN_HANDLED
}
new String[12]
read_argv(1,String,12)
if (!String[0]) {
client_print(id,print_console,"Current awps per team: %i",get_cvar_num("amx_maxawp"))
return PLUGIN_HANDLED
}
new Data = str_to_num(String)
if (Data > -1 && Data < 17) {
set_cvar_num("amx_maxawp",Data);
client_print(0,print_chat,"Maximum awps per team: %i",Data)
return PLUGIN_HANDLED
}
else {
client_print(id,print_chat,"Awps can be limited from 1 to 16 per team!")
return PLUGIN_HANDLED
}
return PLUGIN_HANDLED
}
Lassé par la pub ? Créez un compte
- Contenus similaires :
Tags :