Skocz do zawartości

Witamy w Nieoficjalnym polskim support'cie AMX Mod X

Witamy w Nieoficjalnym polskim support'cie AMX Mod X, jak w większości społeczności internetowych musisz się zarejestrować aby móc odpowiadać lub zakładać nowe tematy, ale nie bój się to jest prosty proces w którym wymagamy minimalnych informacji.
  • Rozpoczynaj nowe tematy i odpowiedaj na inne
  • Zapisz się do tematów i for, aby otrzymywać automatyczne uaktualnienia
  • Dodawaj wydarzenia do kalendarza społecznościowego
  • Stwórz swój własny profil i zdobywaj nowych znajomych
  • Zdobywaj nowe doświadczenia

Dołączona grafika Dołączona grafika

Guest Message by DevFuse
 

Zdjęcie

nie dodaje vipa


  • Nie możesz napisać tematu
  • Zaloguj się, aby dodać odpowiedź
Brak odpowiedzi do tego tematu

#1 NaVv

    Życzliwy

  • Użytkownik

Reputacja: 0
zer0.

  • Postów:33
  • Lokalizacja:Wrocław
Offline

Napisano 18.07.2021 11:58

witam,

 

Otóż mam plugin na losowanie vipa i vip jest z generatora. zrobiłem jak było napisane ale coś tego vipa nie dodaje. 

https://amxx.pl/topi...zy-na-serwerze/

vip.sma

#include <amxmodx>
#include <colorchat>
#include <cstrike>
#include <engine>
#include <fakemeta>
#include <fun>
#include <hamsandwich>

#define IsPlayer(%1) (1<=%1<=maxPlayers)

forward amxbans_admin_connect(id);

new bool:g_FreezeTime, bool:g_Vip[33], g_Hudmsg, ioid, maxPlayers,
menu, menu_callback_handler, skoki[33], gRunda, weapon_id;

new const g_Prefix[] = "Vip Chat";

public plugin_init(){
	register_plugin("VIP Ultimate", "12.3.0.2", "benio101 & speedkill");
	RegisterHam(get_player_resetmaxspeed_func(), "player", "fw_Player_ResetMaxSpeed", 1);
	register_logevent("logevent_round_start", 2, "1=Round_Start");
	register_event("HLTV", "event_new_round", "a", "1=0", "2=0");
	RegisterHam(Ham_Spawn, "player", "SpawnedEventPre", 1);
	register_forward(FM_CmdStart, "CmdStartPre");
	RegisterHam(Ham_TakeDamage, "player", "takeDamage", 0);
	register_message(get_user_msgid("ScoreAttrib"), "VipStatus");
	register_clcmd("say /vip", "ShowMotd");
	register_clcmd("say_team", "VipChat");
	register_message(get_user_msgid("SayText"),"handleSayText");
	g_Hudmsg=CreateHudSyncObj();
	register_forward(FM_SetModel,  "Fw_NadeModel", 1);
	RegisterHam(Ham_Think, "grenade", "Fw_NadeThink");
	register_logevent("Poczatek_Rundy", 2, "1=Round_Start")
}
public client_authorized(id , const authid[]){
	if(get_user_flags(id) & 524288 == 524288){
		client_authorized_vip(id);
	}
}
public client_authorized_vip(id){
	g_Vip[id]=true;
	new g_Name[64];
	get_user_name(id,g_Name,charsmax(g_Name));
	set_hudmessage(24, 190, 220, 0.25, 0.2, 0, 6.0, 6.0);
	ShowSyncHudMsg(0, g_Hudmsg, "Vip %s wbija na serwer !",g_Name);
}
public client_disconnected(id){
	if(g_Vip[id]){
		client_disconnect_vip(id);
	}
}
public client_disconnect_vip(id){
	g_Vip[id]=false;
}
Ham:get_player_resetmaxspeed_func(){
	#if defined Ham_CS_Player_ResetMaxSpeed
	return IsHamValid(Ham_CS_Player_ResetMaxSpeed)?Ham_CS_Player_ResetMaxSpeed:Ham_Item_PreFrame;
	#else
	return Ham_Item_PreFrame;
	#endif
}
public fw_Player_ResetMaxSpeed(id){
	if(g_Vip[id]){
		if(is_user_alive(id)){
			fw_Player_ResetMaxSpeedVip(id);
		}
	}
}
public logevent_round_start(){
	g_FreezeTime=false;
}
public event_new_round(){
	g_FreezeTime=true;
}
public fw_Player_ResetMaxSpeedVip(id){
	if(!g_FreezeTime){
		set_user_maxspeed(id,get_user_maxspeed(id) + 30);
	}
}
public SpawnedEventPre(id){
	if(g_Vip[id]){
		if(is_user_alive(id)){
			SpawnedEventPreVip(id);
		}
	}
}
public SpawnedEventPreVip(id){
	if(get_user_team(id)==1){
		set_user_footsteps(id,1);
	}
	skoki[id]=2;
	show_vip_menu(id);
	if(get_user_team(id)==2){
		set_user_health(id, get_user_health(id)+50);
	}
}
public CmdStartPre(id, uc_handle){
	if(g_Vip[id]){
		if(is_user_alive(id)){
			CmdStartPreVip(id, uc_handle);
		}
	}
}
public CmdStartPreVip(id, uc_handle){
	new flags = pev(id, pev_flags);
	if((get_uc(uc_handle, UC_Buttons) & IN_JUMP) && !(flags & FL_ONGROUND) && !(pev(id, pev_oldbuttons) & IN_JUMP) && skoki[id]>0){
		--skoki[id];
		new Float:velocity[3];
		pev(id, pev_velocity,velocity);
		velocity[2] = random_float(265.0,285.0);
		set_pev(id,pev_velocity,velocity);
	} else if(flags & FL_ONGROUND && skoki[id]!=-1){
		skoki[id] =1 ;
	}
}
public menu_1_handler(id){
	if(get_pdata_cbase(id, 369)==-1){
		give_item(id, "weapon_usp");
		give_item(id, "ammo_45acp");
		weapon_id=find_ent_by_owner(-1, "weapon_usp", id);
		if(weapon_id)cs_set_weapon_ammo(weapon_id, 10);
		cs_set_user_bpammo(id, CSW_USP, 0);
	}
}
public menu_2_handler(id){
	if(get_pdata_cbase(id, 369)==-1){
		give_item(id, "weapon_deagle");
		give_item(id, "ammo_50ae");
		weapon_id=find_ent_by_owner(-1, "weapon_deagle", id);
		if(weapon_id)cs_set_weapon_ammo(weapon_id, 7);
		cs_set_user_bpammo(id, CSW_DEAGLE, 0);
	}
}
public menu_3_handler(id){
	if(get_pdata_cbase(id, 368)==-1){
		give_item(id, "weapon_ak47");
		give_item(id, "ammo_762nato");
		weapon_id=find_ent_by_owner(-1, "weapon_ak47", id);
		if(weapon_id)cs_set_weapon_ammo(weapon_id, 4);
		cs_set_user_bpammo(id, CSW_AK47, 0);
	}
}
public menu_4_handler(id){
	if(get_pdata_cbase(id, 368)==-1){
		give_item(id, "weapon_awp");
		give_item(id, "ammo_338magnum");
		weapon_id=find_ent_by_owner(-1, "weapon_awp", id);
		if(weapon_id)cs_set_weapon_ammo(weapon_id, 2);
		cs_set_user_bpammo(id, CSW_AWP, 0);
	}
}
public plugin_cfg(){
	maxPlayers=get_maxplayers();
}
public takeDamage(this, idinflictor, idattacker, Float:damage, damagebits){
	if(((IsPlayer(idattacker) && is_user_connected(idattacker) && g_Vip[idattacker] && (ioid=idattacker)) ||
	(ioid=pev(idinflictor, pev_owner) && IsPlayer(ioid) && is_user_connected(ioid) && g_Vip[ioid]))){
		if(get_user_team(ioid)==1){
			damage*=(100+10)/100;
		}
	}
}
public show_vip_menu(id){
	menu=menu_create("\rMenu VIPa","menu_handler");
	menu_callback_handler=menu_makecallback("menu_callback");
	new bool:active=false, num=-1;
	menu_additem(menu,"\wUSP z 10 ammo","",0,menu_callback_handler);
	if(menu_callback(id, menu, ++num)==ITEM_ENABLED){
		active=true;
	}
	menu_additem(menu,"\wDeagle z 7 ammo","",0,menu_callback_handler);
	if(menu_callback(id, menu, ++num)==ITEM_ENABLED){
		active=true;
	}
	menu_additem(menu,"\wAK z 4 ammo","",0,menu_callback_handler);
	if(menu_callback(id, menu, ++num)==ITEM_ENABLED){
		active=true;
	}
	menu_additem(menu,"\wAWP z 2 ammo","",0,menu_callback_handler);
	if(menu_callback(id, menu, ++num)==ITEM_ENABLED){
		active=true;
	}
	if(active){
		menu_setprop(menu,MPROP_EXITNAME,"Wyjscie");
		menu_setprop(menu,MPROP_TITLE,"\yMenu Vipa");
		menu_setprop(menu,MPROP_NUMBER_COLOR,"\r");
		menu_display(id, menu);
	} else {
		menu_destroy(menu);
	}
}
public menu_callback(id, menu, item){
	if(is_user_alive(id)){
		if(get_user_team(id)==1){
			if(item==0){
				return ITEM_ENABLED;
			}
			if(item==1){
				return ITEM_ENABLED;
			}
			if(item==2){
				return ITEM_ENABLED;
			}
			if(item==3){
				return ITEM_ENABLED;
			}
		}
	}
	return ITEM_DISABLED;
}
public menu_handler(id, menu, item){
	if(is_user_alive(id)){
		if(get_user_team(id)==1){
			if(item==0){
				menu_1_handler(id);
			}
			if(item==1){
				menu_2_handler(id);
			}
			if(item==2){
				menu_3_handler(id);
			}
			if(item==3){
				menu_4_handler(id);
			}
		}
	}
	menu_destroy(menu);
	return PLUGIN_HANDLED;
}
public VipStatus(){
	new id=get_msg_arg_int(1);
	if(is_user_alive(id) && g_Vip[id]){
		set_msg_arg_int(2, ARG_BYTE, get_msg_arg_int(2)|4);
	}
}
public ShowMotd(id){
	show_motd(id, "vip.txt", "Informacje o vipie");
}
public VipChat(id){
	if(g_Vip[id]){
		new g_Msg[256],
		g_Text[256];
		
		read_args(g_Msg,charsmax(g_Msg));
		remove_quotes(g_Msg);
		
		if(g_Msg[0] == '*' && g_Msg[1]){
			new g_Name[64];
			get_user_name(id,g_Name,charsmax(g_Name));
			
			formatex(g_Text,charsmax(g_Text),"^x01(%s) ^x03%s : ^x04%s",g_Prefix, g_Name, g_Msg[1]);
			
			for(new i=1;i<33;i++){
				if(is_user_connected(i) && g_Vip[i])
				ColorChat(i, GREEN, "%s", g_Text);
			}
			return PLUGIN_HANDLED_MAIN;
		}
	}
	return PLUGIN_CONTINUE;
}
public handleSayText(msgId,msgDest,msgEnt){
	new id = get_msg_arg_int(1);
	
	if(is_user_connected(id) && g_Vip[id]){
		new szTmp[256],szTmp2[256];
		get_msg_arg_string(2,szTmp, charsmax(szTmp))
		
		new szPrefix[64] = "^x04[VIP]";
		
		if(!equal(szTmp,"#Cstrike_Chat_All")){
			add(szTmp2,charsmax(szTmp2),szPrefix);
			add(szTmp2,charsmax(szTmp2)," ");
			add(szTmp2,charsmax(szTmp2),szTmp);
		}
		else{
			add(szTmp2,charsmax(szTmp2),szPrefix);
			add(szTmp2,charsmax(szTmp2),"^x03 %s1^x01 :  %s2");
		}
		set_msg_arg_string(2,szTmp2);
	}
	return PLUGIN_CONTINUE;
}
public Fw_NadeThink(nade){
	if(pev_valid(nade) && grenade_type(nade) == 3){
		set_pev(nade, pev_flags, FL_ONGROUND);
	}
}
stock grenade_type(index){
	new g_Class[9];
	
	pev(index, pev_classname, g_Class, charsmax(g_Class));
	
	if(!equal(g_Class, "grenade") || get_pdata_int(index, 96) & 1 << 8){
		return 0;
	}
	
	new g_Bits = get_pdata_int(index, 114);
	
	if(g_Bits & 1 << 0){
		return 1;
	}
	
	else if(!g_Bits){
		return 2;
	}
	
	else if(g_Bits & 1 << 1){
		return 3;
	}
	
	return 0;
}
public Fw_NadeModel(nade, NadeModel[]){
	if(pev_valid(nade)){
		new g_Nade = grenade_type(nade);
		
		new id = pev(nade,pev_owner);
		
		if(g_Nade && is_user_connected(id) && g_Vip[id]){
			switch(g_Nade){
				case 1:{
					set_pev(nade, pev_dmgtime, get_gametime() + 2.0);
				}
				case 2:{
					set_pev(nade, pev_dmgtime, get_gametime() + 1.0);
				}
				case 3:{
					set_pev(nade, pev_dmgtime, get_gametime() + 2.0);
				}
			}
		}
	}
}
public amxbans_admin_connect(id){
	client_authorized(id,"");
}
public Poczatek_Rundy(){
	if(++gRunda == 3){
		for(new i=1; i<=32; i++){
			if(is_user_connected(i) && !g_Vip[i] && get_user_flags(i) & ADMIN_LEVEL_H)
				g_Vip[i] = true;
		}
	}
}


  • +
  • -
  • 0




Użytkownicy przeglądający ten temat: 0

0 użytkowników, 0 gości, 0 anonimowych


Coinsy CSGOAtse Za SMS, PSC , Przelew - CoinSell.pl