[Pomoc] Pomoc oko VIP Plugina
Results 1 to 10 of 10
  1. #1
    Senior Member Array
    Join Date
    Jan 2016
    Location
    Posusje Bosna i Hercegovina
    Age
    21
    Karma
    0

    Default Pomoc oko VIP Plugina

    Code:
    #include <amxmodx>
    #include <colorchat>
    #include <cstrike>
    #include <fun>
    #include <hamsandwich>
    
    forward amxbans_admin_connect(id);
    
    new Array:g_Array, CsArmorType:armortype, bool:g_Vip[33], g_Hudmsg;
    
    new const g_Langcmd[][]={"say /vips","say_team /vips","say /vipy","say_team /vipy"};
    
    public plugin_init(){
    	register_plugin("VIP Ultimate", "12.3.0.2", "benio101 & speedkill");
    	RegisterHam(Ham_Spawn, "player", "SpawnedEventPre", 1);
    	register_event("DeathMsg", "DeathMsg", "a");
    	g_Array=ArrayCreate(64,32);
    	for(new i;i<sizeof g_Langcmd;i++){
    		register_clcmd(g_Langcmd[i], "ShowVips");
    	}
    	register_clcmd("say /vip", "ShowMotd");
    	register_message(get_user_msgid("SayText"),"handleSayText");
    	g_Hudmsg=CreateHudSyncObj();
    }
    public client_authorized(id){
    	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));
    	
    	new g_Size = ArraySize(g_Array);
    	new szName[64];
    	
    	for(new i = 0; i < g_Size; i++){
    		ArrayGetString(g_Array, i, szName, charsmax(szName));
    		
    		if(equal(g_Name, szName)){
    			return 0;
    		}
    	}
    	ArrayPushString(g_Array,g_Name);
    	set_hudmessage(24, 190, 220, 0.25, 0.2, 0, 6.0, 6.0);
    	ShowSyncHudMsg(0, g_Hudmsg, "VIP %s posecuje nas server! Uzivaj! !",g_Name);
    	
    	return PLUGIN_CONTINUE;
    }
    public client_disconnect(id){
    	if(g_Vip[id]){
    		client_disconnect_vip(id);
    	}
    }
    public client_disconnect_vip(id){
    	g_Vip[id]=false;
    	new Name[64];
    	get_user_name(id,Name,charsmax(Name));
    	
    	new g_Size = ArraySize(g_Array);
    	new g_Name[64];
    	
    	for(new i = 0; i < g_Size; i++){
    		ArrayGetString(g_Array, i, g_Name, charsmax(g_Name));
    		
    		if(equal(g_Name,Name)){
    			ArrayDeleteItem(g_Array,i);
    			break;
    		}
    	}
    }
    public SpawnedEventPre(id){
    	if(g_Vip[id]){
    		if(is_user_alive(id)){
    			SpawnedEventPreVip(id);
    		}
    	}
    }
    public SpawnedEventPreVip(id){
    	set_user_health(id, get_user_health(id)+10);
    	cs_set_user_armor(id, min(cs_get_user_armor(id,armortype)+50, 200), armortype);
    	new henum=(user_has_weapon(id,CSW_HEGRENADE)?cs_get_user_bpammo(id,CSW_HEGRENADE):0);
    	give_item(id, "weapon_hegrenade");
    	++henum;
    }
    public DeathMsg(){
    	new killer=read_data(1);
    	new victim=read_data(2);
    	
    	if(is_user_alive(killer) && g_Vip[killer] && get_user_team(killer) != get_user_team(victim)){
    		DeathMsgVip(killer,victim,read_data(3));
    	}
    }
    public DeathMsgVip(kid,vid,hs){
    	set_user_health(kid, min(get_user_health(kid)+(hs?15:10),130));
    }
    public ShowVips(id){
    	new g_Name[64],g_Message[192];
    	
    	new g_Size=ArraySize(g_Array);
    	
    	for(new i = 0; i < g_Size; i++){
    		ArrayGetString(g_Array, i, g_Name, charsmax(g_Name));
    		
    		add(g_Message, charsmax(g_Message), g_Name);
    		
    		if(i == g_Size - 1){
    			add(g_Message, charsmax(g_Message), ".");
    		}
    		else{
    			add(g_Message, charsmax(g_Message), ", ");
    		}
    	}
    	ColorChat(id,GREEN,"^x03VIP's ^x04na ^x03serveru: ^x04%s", g_Message);
    	return PLUGIN_CONTINUE;
    }
    public client_infochanged(id){
    	if(g_Vip[id]){
    		new szName[64];
    		get_user_info(id,"name",szName,charsmax(szName));
    		
    		new Name[64];
    		get_user_name(id,Name,charsmax(Name));
    		
    		if(!equal(szName,Name)){
    			ArrayPushString(g_Array,szName);
    			
    			new g_Size=ArraySize(g_Array);
    			new g_Name[64];
    			for(new i = 0; i < g_Size; i++){
    				ArrayGetString(g_Array, i, g_Name, charsmax(g_Name));
    				
    				if(equal(g_Name,Name)){
    					ArrayDeleteItem(g_Array,i);
    					break;
    				}
    			}
    		}
    	}
    }
    public plugin_end(){
    	ArrayDestroy(g_Array);
    }
    public ShowMotd(id){
    	show_motd(id, "vip.txt", "Informacje o VIP-u");
    }
    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 amxbans_admin_connect(id){
    	client_authorized(id);
    }


    Steam igraci se zale kad im setujem VIP-a da im umjesto prefixa [VIP] u chatu izbacije S1 S2.
    Hvala svima koji pomognu

  2. #2
    Junior Member Array
    Join Date
    Mar 2018
    Location
    Beograd
    Karma
    0

    Default

    Stavi u kodu da im daje VIP-a na IP adresu, a za prefix kasnije sredi.

  3. #3
    Super Moderator Array klipica's Avatar
    Join Date
    Apr 2010
    Location
    lknet.uk
    Karma
    28

    Default

    Quote Originally Posted by BigDad123 View Post
    Stavi u kodu da im daje VIP-a na IP adresu, a za prefix kasnije sredi.
    1) Kakve veze to ima sa temom?
    2) Zasto bi to radio?
    Code:
    #YoMama {
        width: 200%;
        overflow: visible;
    }

  4. #4
    Junior Member Array
    Join Date
    Mar 2018
    Location
    Beograd
    Karma
    0

    Default

    Pa govorim mu

  5. #5
    Senior Member Array
    Join Date
    Aug 2010
    Location
    Nis, Cair, Jamajka
    Karma
    11

    Default

    klipice kako ne razumes ccc...govori mu

  6. #6

  7. #7
    Senior Member Array
    Join Date
    Jan 2016
    Location
    Posusje Bosna i Hercegovina
    Age
    21
    Karma
    0

    Default

    Da pomoglo je. Hvala ti puno brate na ovom. Moderatori mozete da lockujete ovo jer je pomoglo.

  8. #8
    Senior Member Array
    Join Date
    Jun 2015
    Location
    Belgrade
    Karma
    8

    Default

    Quote Originally Posted by Skubishaa View Post
    mozete da lockujete ovo jer je pomoglo
    Ne razumem zasto ste svi toliko opsednuti tim lockom? Pa poenta foruma je upravo to da sutra ako neko bude imao slican problem moze da pise u ovoj temi i da ne otvara novu...

  9. #9
    Senior Member Array
    Join Date
    Jan 2016
    Location
    Posusje Bosna i Hercegovina
    Age
    21
    Karma
    0

    Default

    Nemoj bolan balasat bezveze bgt,jer vidis doci ce tako neki kao ti i ponudice svoje rjesenje a vec sve rjeseno,zato ne pametuj ako ne mozes pomoci nego prodji temu.

  10. #10
    Senior Member Array
    Join Date
    Jun 2015
    Location
    Belgrade
    Karma
    8

    Default

    Quote Originally Posted by Skubishaa View Post
    Nemoj bolan balasat bezveze bgt,jer vidis doci ce tako neki kao ti i ponudice svoje rjesenje a vec sve rjeseno,zato ne pametuj ako ne mozes pomoci nego prodji temu.
    Nisam te pitao za misljenje uopste, rekao sam sta sam imao.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •