[Modificare Plugin] VIP Base Builder

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori

Post Reply
Ykaru
Membru, skill 0
Membru, skill 0
Posts: 17
Joined: 29 Jul 2019, 00:33
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 1 time

29 Jul 2019, 17:15

Salut, as vrea ca atunci cand scrii /vmenu sa-ti apara :
CT :
Deagle gold
Ak Gold
M4A1 Gold
200 Hp + 100 AP
Viteza
Respawn

T :
Super Knife (sa aibe dmg foarte mare)
5000 HP + 5000 AP
VIteza
Gravitate

Iar armele gold sa aibe dmg mare nu ca si cele simple si modele pe ele si pe Super Knife.
Iar Meniul sa poata fi folosit doar o singura data pe runda.
Si sa aibe si vip.txt .
Multumesc anticipat.
Si flagurile sa fie "bit" .


| Afiseaza codul
#pragma semicolon 1
#include <amxmodx>
#include <cstrike>
#include <engine>
#include <fun>
#include <hamsandwich>

#define ADMIN_JBVIP ADMIN_RESERVATION

// Define the Plugin Version
new const VERSION[] = { "1.0" };

// PREFIX
new const PREFIX[] = { "!g[ Base Builder ]!n" };

new VipUsed[33];
new HasSpeed[33];

new Float:fast_speed = 400.0;
new Float:normal_speed = 250.0;

public plugin_init()
{
	register_plugin("BaseBuilder: VIP Menu", VERSION, "");

	RegisterHam(Ham_Spawn, "player", "FwdHamSpawn_Post", 1);
	RegisterHam(Ham_Item_PreFrame, "player", "FwdPreFrame_Post", 1);
	
	register_clcmd("say vmenu", "cmdVmenu");
	register_clcmd("say /vmenu", "cmdVmenu");
	register_clcmd("say_team vmenu", "cmdVmenu");
	register_clcmd("say_team /vmenu", "cmdVmenu");
}

public FwdPreFrame_Post(id)
{
	if(is_user_alive(id) && HasSpeed[id])
		set_user_maxspeed(id, fast_speed);
}

public FwdHamSpawn_Post(id)
{
	HasSpeed[id] = false;
	VipUsed[id] = false;
	set_user_maxspeed(id, normal_speed);
	set_user_rendering( id, _, 0, 0, 0, _, 0 );  
}

public cmdVmenu(id)
{
	if(!(get_user_flags(id) & ADMIN_JBVIP))
	{
		client_printc(id, "%s Menu apenas para !gVIP !n,Queres ser vip?, Escreve !g/vip !npara comprares.", PREFIX);
		
		return PLUGIN_HANDLED;
	}
	
	if(VipUsed[id])
	{
		client_printc(id, "%s Tu ja usaste !gVIP Menu!n nesta ronda. Por favor, Espera ate proxima ronda", PREFIX);
		
		return PLUGIN_HANDLED;
	}
	
	switch(cs_get_user_team(id))
	{
		case CS_TEAM_T:
			VipTMenu(id);
		
		case CS_TEAM_CT:
			VipCTMenu(id);
	}
	
	return PLUGIN_HANDLED;
}

public VipCTMenu(id)
{
	new menu = menu_create("\yVIP Menu \r(CT):^n", "VipCTMenu_handler");

	menu_additem(menu, "\w150 Hp + 100 AP", "1", 0);
	menu_additem(menu, "\wM249 + Deagle", "2", 0);
	menu_additem(menu, "\wSpeed", "3", 0);
	menu_additem(menu, "\wRevive", "4", 0);
	menu_additem(menu, "\wG3SG1", "5", 0);
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
}

public VipCTMenu_handler(id, menu, item)
{
	if( item == MENU_EXIT )
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}

	new data[6], iName[64];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

	new key = str_to_num(data);

	switch(key)
	{
		case 1:
		{
			set_user_health(id, get_user_health(id) + 150);
			set_user_armor(id, get_user_armor(id) + 100);
			VipUsed[id] = true;
			
			client_printc(id, "%s Tu recebeste !g150 Hp!n + !g100 Colete!n", PREFIX);
		}
		case 2:
		{
            give_item(id, "weapon_m249"); 
            give_item(id, "weapon_deagle"); 
            cs_set_user_bpammo(id, CSW_M249, 200); 
            cs_set_user_bpammo(id, CSW_DEAGLE, 100); 
			
			VipUsed[id] = true;
			
			client_printc(id, "%s Tu recebeste !gM249!n + !gDeagle!n", PREFIX);
		}
		case 3:
		{
			VipUsed[id] = true;
			HasSpeed[id] = true;
			
			set_user_maxspeed(id, fast_speed);
			
			client_printc(id, "%s Tu recebeste !gSpeed!n", PREFIX);
   } 
         
        case 4: 
        { 
               
            ExecuteHamB(Ham_CS_RoundRespawn, id); 
  
            VipUsed[id] = true; 

            client_printc(id, "%s Tu recebeste !gRevive", PREFIX); 
        } 
            
              case 5: 
        { 
            give_item(id, "weapon_g3sg1"); 
            cs_set_user_bpammo(id, CSW_G3SG1, 200); 

            VipUsed[id] = true; 

            client_printc(id, "%s Tu recebeste !gG3sg1", PREFIX); 
		}
	}

	menu_destroy(menu);
	return PLUGIN_HANDLED;
}

public VipTMenu(id)
{
	new menu = menu_create("\yVIP Menu \r(TR):^n", "VipTMenu_handler");

	menu_additem(menu, "\w5000 Hp + 5000 Colete", "1", 0);
	menu_additem(menu, "\wSpeed", "2", 0);
	
	menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);
	menu_display(id, menu, 0);
}

public VipTMenu_handler(id, menu, item)
{
	if( item == MENU_EXIT )
	{
		menu_destroy(menu);
		return PLUGIN_HANDLED;
	}

	new data[6], iName[64];
	new access, callback;
	menu_item_getinfo(menu, item, access, data,5, iName, 63, callback);

	new key = str_to_num(data);

	switch(key)
	{
		case 1:
		{
		      set_user_health(id, get_user_health(id) + 5000); 
                                         set_user_armor(id, get_user_armor(id) + 5000); 
                                         VipUsed[id] = true; 

			
			client_printc(id, "%s Tu recebeste !g5000 HP + !g5000 Colete!n", PREFIX);
			
			VipUsed[id] = true;
		}
		case 2:
		{
			VipUsed[id] = true;
			HasSpeed[id] = true;
			
			set_user_maxspeed(id, fast_speed);
			
			client_printc(id, "%s Tu recebeste !gSpeed!n", PREFIX);
		}
		
		case 3:
		{
			set_user_health(id, get_user_health(id) + 50);
			set_user_armor(id, get_user_armor(id) + 150);
			VipUsed[id] = true;
			
			client_printc(id, "%s Tu recebeste !g50 Hp!n + !g150 Colete!n", PREFIX);
		}
	}

	menu_destroy(menu);
	return PLUGIN_HANDLED;
}

// Colour Chat
stock client_printc(const id, const input[], any:...)
{
    new count = 1, players[32];
    static msg[191];
    vformat(msg, 190, input, 3);
    
    replace_all(msg, 190, "!g", "^x04"); // Green Color
    replace_all(msg, 190, "!n", "^x01"); // Default Color
    replace_all(msg, 190, "!t", "^x03"); // Team Color
    
    if (id) players[0] = id; else get_players(players, count, "ch");
    {
        for (new i = 0; i < count; i++)
        {
            if (is_user_connected(players))
            {
                message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players);
                write_byte(players);
                write_string(msg);
                message_end();
            }
        }
    }
}
IG-BOOST.org - Instagram Followers Best, Cheap, Reliable
Ykaru
Membru, skill 0
Membru, skill 0
Posts: 17
Joined: 29 Jul 2019, 00:33
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 1 time

30 Jul 2019, 18:27

UP !
Ykaru
Membru, skill 0
Membru, skill 0
Posts: 17
Joined: 29 Jul 2019, 00:33
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Fond eXtream: 0
Has thanked: 1 time

31 Jul 2019, 02:25

Cer T/C
Post Reply

Return to “Modificari pluginuri”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests