Rifles and Pistols icons.

В този раздел можете да подавате всякакви заявки за намиране, изработка или преработка на плъгини/модове.
Аватар
truex_88
Извън линия
Foreigner
Foreigner
Мнения: 33
Регистриран на: 18 Мар 2019, 18:33
Се отблагодари: 11 пъти

Rifles and Pistols icons.

Мнение от truex_88 » 26 Фев 2020, 21:57

Hello. Can anyone help me, that show only rifles and pistols icons? Money, Grenade, Arrow, Armor unnecessary.



Код за потвърждение: Избери целия код

#define DISPLAY_MONEY	0
#define DISPLAY_WEAPONS	0
#define DISPLAY_DOLLARSIGN	0
#define DISPLAY_ARROW	0

by DaniwA					2018
#################################################################################################*/

#include <amxmodx>
#include <fakemeta>
#include <engine>
#include <cstrike>

#define DISPLAY_MONEY	1
#define DISPLAY_WEAPONS	1
#define DISPLAY_DOLLARSIGN	1
#define DISPLAY_ARROW	1

#define	PLUGIN	"SHOWEQUIPS"
#define VERSION	"1.3"
#define AUTHOR	"DaniwA"

#if DISPLAY_MONEY
#define NUMBER_OF_SPRITES	5
new userSpr[33][NUMBER_OF_SPRITES];
new tmpstr[6];
new value[2];
#endif

#if DISPLAY_WEAPONS
#define NUMBER_OF_WEAPTYPES	7
new const Float:Pistols[6] = {1.0,10.0,11.0,16.0,17.0,26.0};
new const Float:Rifles[18] = {3.0,5.0,7.0,8.0,12.0,13.0,14.0,15.0,18.0,19.0,20.0,21.0,22.0,23.0,24.0,27.0,28.0,30.0};
new userWeap[33][NUMBER_OF_WEAPTYPES];
new armor;
new weapons;
#endif

#if DISPLAY_DOLLARSIGN
new userDSign[33];
#endif

#if DISPLAY_ARROW
new userArrow[33];
#endif

new bool:NewRound;
new Float:userOrig[33][3];
new iPlayers[32], count;

public plugin_precache(){
#if DISPLAY_MONEY
	precache_model("sprites/10000.spr");
	precache_model("sprites/1000.spr");
	precache_model("sprites/100.spr");
	precache_model("sprites/10.spr");
	precache_model("sprites/1.spr");
#endif
#if DISPLAY_WEAPONS
	precache_model("sprites/weap.spr");
	precache_model("sprites/weap2.spr");
#endif
#if DISPLAY_DOLLARSIGN
	precache_model("sprites/cash.spr");
#endif
#if DISPLAY_ARROW
	precache_model("sprites/arrow.spr");
#endif
	}

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

public event_new_round(){
	remove_task(9678);
	remove_ents();
	NewRound = true;
	set_task(get_cvar_float("mp_freezetime"),"remove_ents",9678);
	set_task(0.2,"display_info",4563,"",0,"b");
	}

public remove_ents(){
	remove_task(4563);
	for(new i; i<33; i++){
#if DISPLAY_MONEY
		for(new e; e<NUMBER_OF_SPRITES; e++)
			remove_entity(userSpr[i][e]);
#endif
#if DISPLAY_WEAPONS
		for(new e; e<NUMBER_OF_WEAPTYPES; e++)
			remove_entity(userWeap[i][e]);
#endif
#if DISPLAY_DOLLARSIGN
		remove_entity(userDSign[i]);
#endif
#if DISPLAY_ARROW
		remove_entity(userArrow[i]);
#endif
		}
	}

public display_info(){

	if (NewRound){
		get_players(iPlayers, count, "ah");
		}

	for(new c; c<count; c++){

		if(!is_user_alive(iPlayers[c]) || !is_user_connected(iPlayers[c]) || cs_get_user_team(iPlayers[c]) == CS_TEAM_SPECTATOR)
			continue;

		if (NewRound){
#if DISPLAY_MONEY
			for(new i; i<NUMBER_OF_SPRITES; i++)
				userSpr[iPlayers[c]][i]=create_entity("env_sprite");
#endif
#if DISPLAY_WEAPONS
			for(new i; i<NUMBER_OF_WEAPTYPES; i++)
				userWeap[iPlayers[c]][i]=create_entity("env_sprite");
#endif
#if DISPLAY_DOLLARSIGN
			userDSign[iPlayers[c]]=create_entity("env_sprite");
#endif
#if DISPLAY_ARROW
			userArrow[iPlayers[c]]=create_entity("env_sprite");
#endif
			}
	
#if DISPLAY_MONEY
		for (new x; x < NUMBER_OF_SPRITES; x++){
			arrayset(tmpstr, 0, sizeof tmpstr);
			num_to_str(cs_get_user_money(iPlayers[c]), tmpstr, charsmax(tmpstr))
			value[0]=tmpstr[x];
			value[1]=0;
			
			if(!tmpstr[x]){
				switch(x){
					case 0: drawsprite(userSpr[iPlayers[c]][4],iPlayers[c],"sprites/10000.spr",1.0,34.0,0,0,255,0);
					case 1: drawsprite(userSpr[iPlayers[c]][3],iPlayers[c],"sprites/1000.spr",1.0,34.0,0,0,255,0);
					case 2: drawsprite(userSpr[iPlayers[c]][2],iPlayers[c],"sprites/100.spr",1.0,34.0,0,0,255,0);
					case 3: drawsprite(userSpr[iPlayers[c]][1],iPlayers[c],"sprites/10.spr",1.0,34.0,0,0,255,0);
					case 4: drawsprite(userSpr[iPlayers[c]][0],iPlayers[c],"sprites/1.spr",1.0,34.0,0,0,255,0);
					}
				continue;
				}
				
			switch(x){
				case 0: drawsprite(userSpr[iPlayers[c]][4],iPlayers[c],"sprites/10000.spr",floatstr(value),34.0,255,0,255,0);
				case 1: drawsprite(userSpr[iPlayers[c]][3],iPlayers[c],"sprites/1000.spr",floatstr(value),34.0,255,0,255,0);
				case 2: drawsprite(userSpr[iPlayers[c]][2],iPlayers[c],"sprites/100.spr",floatstr(value),34.0,255,0,255,0);
				case 3: drawsprite(userSpr[iPlayers[c]][1],iPlayers[c],"sprites/10.spr",floatstr(value),34.0,255,0,255,0);
				case 4: drawsprite(userSpr[iPlayers[c]][0],iPlayers[c],"sprites/1.spr",floatstr(value),34.0,255,0,255,0);
				}
			}
#endif
#if DISPLAY_DOLLARSIGN
		drawsprite(userDSign[iPlayers[c]],iPlayers[c],"sprites/cash.spr",1.0,34.0,255,0,255,0);
#endif
#if DISPLAY_ARROW
		drawsprite(userArrow[iPlayers[c]],iPlayers[c],"sprites/arrow.spr",1.0,34.0,255,255,255,0);
#endif
#if DISPLAY_WEAPONS
		weapons = pev(iPlayers[c], pev_weapons);
		
		for(new i; i < sizeof Pistols; i++)
			if(weapons & 1<<floatround(Pistols[i])){
				drawsprite(userWeap[iPlayers[c]][0],iPlayers[c],"sprites/weap.spr",Pistols[i],50.0,255,255,255,0);
				goto jmp1;
				}
		drawsprite(userWeap[iPlayers[c]][0],iPlayers[c],"sprites/weap.spr",Pistols[0],50.0,0,255,255,0);
		jmp1:

		for(new i; i < sizeof Rifles; i++)
			if(weapons & 1<<floatround(Rifles[i])){
				drawsprite(userWeap[iPlayers[c]][1],iPlayers[c],"sprites/weap.spr",Rifles[i],50.0,255,255,255,0);
				goto jmp2;
				}
		drawsprite(userWeap[iPlayers[c]][1],iPlayers[c],"sprites/weap.spr",Rifles[0],50.0,0,255,255,0);
		jmp2:
		
		if(weapons & 1<<CSW_HEGRENADE)
			drawsprite(userWeap[iPlayers[c]][2],iPlayers[c],"sprites/weap.spr",4.0,50.0,255,255,255,255);
		else
			drawsprite(userWeap[iPlayers[c]][2],iPlayers[c],"sprites/weap.spr",4.0,50.0,0,255,255,255);
		
		if(weapons & 1<<CSW_FLASHBANG)
			drawsprite(userWeap[iPlayers[c]][3],iPlayers[c],"sprites/weap.spr",25.0,50.0,255,255,255,255);
		else
			drawsprite(userWeap[iPlayers[c]][3],iPlayers[c],"sprites/weap.spr",25.0,50.0,0,255,255,255);
		
		if(weapons & 1<<CSW_SMOKEGRENADE)
			drawsprite(userWeap[iPlayers[c]][4],iPlayers[c],"sprites/weap.spr",9.0,50.0,255,255,255,255);
		else
			drawsprite(userWeap[iPlayers[c]][4],iPlayers[c],"sprites/weap.spr",9.0,50.0,0,255,255,255);

		cs_get_user_armor(iPlayers[c],CsArmorType:armor);
		if(armor == 2)
			drawsprite(userWeap[iPlayers[c]][5],iPlayers[c],"sprites/weap2.spr",2.0,50.0,255,0,0,255);
		else if(armor == 1)
			drawsprite(userWeap[iPlayers[c]][5],iPlayers[c],"sprites/weap2.spr",1.0,50.0,255,0,0,255);
		else
			drawsprite(userWeap[iPlayers[c]][5],iPlayers[c],"sprites/weap2.spr",1.0,50.0,0,0,0,255);

		
		if(weapons & 1<<CSW_C4)
			drawsprite(userWeap[iPlayers[c]][6],iPlayers[c],"sprites/weap2.spr",3.0,50.0,255,0,0,255);
		else if(cs_get_user_defuse(iPlayers[c]))
			drawsprite(userWeap[iPlayers[c]][6],iPlayers[c],"sprites/weap2.spr",4.0,50.0,255,0,0,255);
		else
			drawsprite(userWeap[iPlayers[c]][6],iPlayers[c],"sprites/weap2.spr",3.0,50.0,0,0,0,255);

#endif
		}
	NewRound = false;
	}

drawsprite(ent,player,str[],Float:frame,Float:offset,render,r,g,b){

		if(!is_user_alive(player) || !is_user_connected(player) || cs_get_user_team(player) == CS_TEAM_SPECTATOR)
			return;

		if (NewRound){		
			engfunc(EngFunc_SetModel, ent, str);
			set_pev(ent, pev_movetype, MOVETYPE_NOCLIP);
			set_pev(ent, pev_framerate, 1.0)
			set_pev(ent, pev_scale, 0.3)
			}

		set_pev(ent, pev_frame, frame)
		set_rendering(ent, kRenderFxNone, r, g, b, kRenderTransAdd, render)
		pev(player, pev_origin, userOrig[player]);
		userOrig[player][2] += offset;
		set_pev(ent, pev_origin, userOrig[player]);
		}

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

Rifles and Pistols icons.

Мнение от OciXCrom » 26 Фев 2020, 22:10

Код за потвърждение: Избери целия код

#define DISPLAY_MONEY	1
#define DISPLAY_WEAPONS	1
#define DISPLAY_DOLLARSIGN	1
#define DISPLAY_ARROW	1
0 to disable...

Публикувай отговор
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Заявки за плъгини”

Кой е на линия

Потребители разглеждащи този форум: 0 регистрирани и 7 госта