Autoreload after kill

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
abecede
Membru, skill 0
Membru, skill 0
Posts: 5
Joined: 04 Nov 2017, 12:55
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

07 Nov 2017, 23:22

Salut ma ajuta cineva cu o mica schimbare la un plugin...

Code: Select all

//Simple plugin for CS1.5/1.6: Autoreload when player holding mouse1(attacking)... 
//Notice: switch the following definitions(dont use both!) to specify your cs version! 
//If u r using cs1.5, u cine use 2nd def(AUTORELOAD_CS15) for a better effect(1st cine still work), else(1.6) u have to 
//use the 1st(AUTORELOAD_CS16)... 
#define AUTORELOAD_CS16 
//#define AUTORELOAD_CS15 
//CVARS: 
//amx_autoreload <1/0> to active/deactive this plugin 
#include <amxmodx> 
#include <engine> 
new pactive//point to on-off 
public plugin_init(){ 
 register_plugin("Auto Reload", "1.0", "Flea") 
 pactive = register_cvar("amx_autoreload","1")//def: active , 0 to off 
} 
new reloading[33]//store whether player's reloading or not 
public client_PostThink(id){ 
 if(!get_pcvar_num(pactive) || !is_user_alive(id)) return PLUGIN_CONTINUE//plugin unabled o players dead... 
 if( !(get_user_button(id) & IN_ATTACK) ) return PLUGIN_CONTINUE//not attacking 
 new clip,ammo; get_user_weapon(id,clip,ammo)//curwp? don care currently... 
 if(clip || !ammo) return PLUGIN_CONTINUE//Clip positive: ammos remain.../negative(-1):holding knife o nade... 
 //o if no ammos in backpack... 
 if(reloading[id]) return PLUGIN_CONTINUE//Skip if still reloading... 
#if defined AUTORELOAD_CS15 
 client_cmd(id,"+reload;wait;-reload")//For 1.5,Hm,seems better... 
#else 
 client_cmd(id,"-attack")//For 1.6 just release:),by the way, +attack is a terrible cmd in my opinion :( 
#endif 
 reloading[id] = 1 
 set_task(4.0,"reloaddone",id)//Assume 4s to reload,surely not a pefect way but... 
 return PLUGIN_CONTINUE 
} 
public reloaddone(id) reloading[id] = 0 
As vrea sa fie doar pentru admini cu un anumit acces....
RoyalServer 2
User avatar
A k c 3 n 7
Super moderator
Super moderator
Posts: 5138
Joined: 25 Aug 2014, 21:31
Detinator Steam: Da
CS Status: who dares wins
SteamID: Jandarmeria
Reputatie: Super moderator
Moderatorul anului 2023
Fost Membru Club eXtreamCS ( o luna )
Fost eXtream Mod
Fost Intermediar
Nume anterior: Sorinel
Fond eXtream: 0
Location: Unknown
Discord: remusakcent
Has thanked: 4 times
Been thanked: 46 times

07 Nov 2017, 23:29

ti-l am pus pe ADMIN_LEVEL_H
| Afiseaza codul
//Simple plugin for CS1.5/1.6: Autoreload when player holding mouse1(attacking)... 
//Notice: switch the following definitions(dont use both!) to specify your cs version! 
//If u r using cs1.5, u cine use 2nd def(AUTORELOAD_CS15) for a better effect(1st cine still work), else(1.6) u have to 
//use the 1st(AUTORELOAD_CS16)... 
#define AUTORELOAD_CS16 
//#define AUTORELOAD_CS15 
//CVARS: 
//amx_autoreload <1/0> to active/deactive this plugin 
#include <amxmodx> 
#include <engine> 
new pactive//point to on-off 
public plugin_init(){ 
	register_plugin("Auto Reload", "1.0", "Flea") 
	pactive = register_cvar("amx_autoreload","1")//def: active , 0 to off 
} 
new reloading[33]//store whether player's reloading or not 

public client_PostThink(id){ 
	if(!get_pcvar_num(pactive) || !is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H ) return PLUGIN_CONTINUE//plugin unabled o 

players dead... 
	if( !(get_user_button(id) & IN_ATTACK) ) return PLUGIN_CONTINUE//not attacking 
	new clip,ammo; get_user_weapon(id,clip,ammo)//curwp? don care currently... 
	if(clip || !ammo) return PLUGIN_CONTINUE//Clip positive: ammos remain.../negative(-1):holding knife o nade... 
	//o if no ammos in backpack... 
	if(reloading[id]) return PLUGIN_CONTINUE//Skip if still reloading... 
	#if defined AUTORELOAD_CS15 
	client_cmd(id,"+reload;wait;-reload")//For 1.5,Hm,seems better... 
	#else 
	client_cmd(id,"-attack")//For 1.6 just release:),by the way, +attack is a terrible cmd in my opinion :( 
	#endif 
	reloading[id] = 1 
	set_task(4.0,"reloaddone",id)//Assume 4s to reload,surely not a pefect way but... 
	return PLUGIN_CONTINUE 
} 
public reloaddone(id) reloading[id] = 0
abecede
Membru, skill 0
Membru, skill 0
Posts: 5
Joined: 04 Nov 2017, 12:55
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Contact:

07 Nov 2017, 23:45

mersi mult
Post Reply

Return to “Cereri”

  • Information