Page 1 of 1

Weapons plugin

Posted: 06 Feb 2018, 15:32
by EleCtr0zZz
:japanese_ogre: As dorii si eu un plugin care odata la 6 runde sa dea cate o arma tuturor de ex:
-ECHIPA T
5 playeri sa aiba toti de ex m4a1
-ECHIPA CT
5 playeri sa aiba toti de m4a1 ca la cealalta echipa.

Re: Weapons plugin

Posted: 08 Feb 2018, 16:49
by Alexandruu123
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

#define PLUGIN "Plugin de Arme"
#define VERSION "1.0"
#define AUTHOR "Alexandru"

new Float: CurrentRound
new Float: RundaArme = 6.0


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_logevent("event_new_round", 2, "1=Round_Start" );
}

public event_new_round(){
	CurrentRound++
	
	new players[32],i,player,playercount
	get_players(players,playercount,"c")
	
	if(floatround(CurrentRound/RundaArme,floatround_ceil) == floatround(CurrentRound/RundaArme,floatround_floor)) {
		for(i=0;i<playercount;i++) {
			player = players
			if(get_user_team(player) == 1 || get_user_team(player) == 2) {
				if(is_user_alive(player)) {
					give_item(player,"weapon_m4a1")
					cs_set_user_bpammo(player,CSW_M4A1,90)
				}
			}
		}
	}
}


Nu este testat , dar mi-a placut ideea asa ca l-am facut.
Va da o arma peste ceea ce au deja deci vor avea practic 2 arme primary la fiecare 6 runde.

P.S: L-am testat si merge acum!

Re: Weapons plugin

Posted: 08 Feb 2018, 20:17
by EleCtr0zZz
Alexandruu123 wrote:
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>

#define PLUGIN "Plugin de Arme"
#define VERSION "1.0"
#define AUTHOR "Alexandru"

new Float: CurrentRound
new Float: RundaArme = 6.0


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_logevent("event_new_round", 2, "1=Round_Start" );
}

public event_new_round(){
	CurrentRound++
	
	new players[32],i,player,playercount
	get_players(players,playercount,"c")
	
	if(floatround(CurrentRound/RundaArme,floatround_ceil) == floatround(CurrentRound/RundaArme,floatround_floor)) {
		for(i=0;i<playercount;i++) {
			player = players
			if(get_user_team(player) == 1 || get_user_team(player) == 2) {
				if(is_user_alive(player)) {
					give_item(player,"weapon_m4a1")
					cs_set_user_bpammo(player,CSW_M4A1,90)
				}
			}
		}
	}
}


Nu este testat , dar mi-a placut ideea asa ca l-am facut.
Va da o arma peste ceea ce au deja deci vor avea practic 2 arme primary la fiecare 6 runde.

P.S: L-am testat si merge acum!

Nu poti scoata faza cu " vor avea practic 2 arme primary " ?
Si sa scrie in HUD mai sunt " ... " runde pana la eventul m4a1 etc..

Re: Weapons plugin

Posted: 08 Feb 2018, 20:45
by Alexandruu123
https://forums.alliedmods.net/showthread.php?t=170478
Iei .INC de la stripweapons , pui include la el si folosesti functia exact inainte sa ii dea M4A1.

Re: Weapons plugin

Posted: 08 Feb 2018, 20:46
by Alexandruu123
Alexandruu123 wrote:https://forums.alliedmods.net/showthread.php?t=170478
Iei .INC de la stripweapons , pui include la el si folosesti functia exact inainte sa ii dea M4A1.
Nu ma prea intereseaza asa mult partea vizuala la plugin,doar partea tehnica poti sa il faci cum vrei tu cu hud si altele.

P.S: Am facut x2 post din greseala in loc sa dau edit....

Re: Weapons plugin

Posted: 08 Feb 2018, 23:53
by EleCtr0zZz
Alexandruu123 wrote:https://forums.alliedmods.net/showthread.php?t=170478
Iei .INC de la stripweapons , pui include la el si folosesti functia exact inainte sa ii dea M4A1.
Nu ma pricep foarte bine. Il poti face tu?

Re: Weapons plugin

Posted: 09 Feb 2018, 00:34
by Alexandruu123
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <stripweapons>

#define PLUGIN "Plugin de Arme"
#define VERSION "1.0"
#define AUTHOR "Alexandru"

new Float: CurrentRound
new Float: RundaArme = 1.0


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_event("HLTV","event_new_round","a","1=0","2=0")
	register_logevent("LogEvent_RoundStart", 2, "1=Round_Start" );
}

public event_new_round(){
	CurrentRound++
	
	new players[32],i,player,playercount
	get_players(players,playercount,"c")
	
	if(floatround(CurrentRound/1.0,floatround_ceil) == floatround(CurrentRound/1.0,floatround_floor)) {
		for(i=0;i<playercount;i++) {
			player = players
			if(get_user_team(player) == 1 || get_user_team(player) == 2) {
				if(is_user_alive(player)) {
					StripWeapons(player, Primary)
					give_item(player,"weapon_m4a1")
					cs_set_user_bpammo(player,CSW_M4A1,90)
				}
			}
		}
	}
}


Si baga inc-ul din threadul acela ca sa poti compila (local).
Acuma daca are deja o arma primary ii va fi inlocuita cu m4a1.

Re: Weapons plugin

Posted: 22 Feb 2018, 15:21
by EleCtr0zZz
Alexandruu123 wrote:
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>
#include <fun>
#include <cstrike>
#include <stripweapons>

#define PLUGIN "Plugin de Arme"
#define VERSION "1.0"
#define AUTHOR "Alexandru"

new Float: CurrentRound
new Float: RundaArme = 1.0


public plugin_init() {
	register_plugin(PLUGIN, VERSION, AUTHOR)
	register_event("HLTV","event_new_round","a","1=0","2=0")
	register_logevent("LogEvent_RoundStart", 2, "1=Round_Start" );
}

public event_new_round(){
	CurrentRound++
	
	new players[32],i,player,playercount
	get_players(players,playercount,"c")
	
	if(floatround(CurrentRound/1.0,floatround_ceil) == floatround(CurrentRound/1.0,floatround_floor)) {
		for(i=0;i<playercount;i++) {
			player = players
			if(get_user_team(player) == 1 || get_user_team(player) == 2) {
				if(is_user_alive(player)) {
					StripWeapons(player, Primary)
					give_item(player,"weapon_m4a1")
					cs_set_user_bpammo(player,CSW_M4A1,90)
				}
			}
		}
	}
}


Si baga inc-ul din threadul acela ca sa poti compila (local).
Acuma daca are deja o arma primary ii va fi inlocuita cu m4a1.

Poti face ca playerii sa primeasca un vot daca vor sau nu runda cu arma .
Si sa scoti faza cu " sa le dea arme odata la 5 runde " si sa aleaga daca vor sau nu .. si daca mai multi vor sa inceapa runda