Cerere modificare vipmenu zm

Modificari necesare ale pluginurilor

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

User avatar
Doctor whO? <3
Membru, skill +2
Membru, skill +2
Posts: 995
Joined: 21 Jun 2013, 11:40
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Reputatie: Fost Membru Club eXtreamCS (doua luni)
Has thanked: 100 times
Been thanked: 33 times
Contact:

12 Jan 2022, 11:45

Salut,
Am si eu un plugin de vipmenu pentru modul cso si as vrea sa fie modificat in totalitate...
vipmenu | Afiseaza codul
#include <amxmodx>
#include <cstrike> 
#include <money>
#include <zombieplague>

public plugin_init()
{
   register_plugin("VIP Menu", "2.0", "S3xTy")
   register_clcmd("vipmenu", "vipmenu", ADMIN_ALL, "vipmenu");
}
public vipmenu( id )
{
	if(!(get_user_flags(id) & ADMIN_LEVEL_A))
	{
		ChatColor(id, "!y[!gDarkCSO!y] You have no access to use the !gVip Menu");
		return PLUGIN_HANDLED
	}
	if(!is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_nemesis(id) || cs_get_user_team(id)==CS_TEAM_SPECTATOR)
	{
		ChatColor(id, "!y[!gDarkCSO!y] !tThis function !yis only valid when you are !gHuman!y/!gAlive")
	}
	else
	{
		new menu = menu_create( "\d-\r[\yDarkCSO\r]\d- | \wVip Weapons", "menu_handler" );
		new weapon_cost = zp_cs_get_user_money(id)
		if(weapon_cost >= 25000)
		{
			menu_additem( menu, "\wRail Cannon - \y25000$", "", 0 );
		}
		else
		{
			menu_additem( menu, "\wRail Cannon - \d25000$", "", 0 );
		}

		if(weapon_cost >= 5000)
		{
			menu_additem( menu, "\wPlasmaGun - \y5000$", "", 0 );
		}
		else
		{
			menu_additem( menu, "\wPlasmaGun - \d5000$", "", 0 );
		}

		if(weapon_cost >= 30000)
		{
			menu_additem( menu, "\wGolden HK416EX - \y30000$", "", 0 );
		}
		else
		{
			menu_additem( menu, "\wGolden HK416EX - \d30000$", "", 0 );
		}

		if(weapon_cost >= 40000)
		{
			menu_additem( menu, "\wNewcomen - \y40000$", "", 0 );
		}
		else
		{
			menu_additem( menu, "\wNewcomen - \d40000$", "", 0 );
		}
		
		if(weapon_cost >= 15000)
		{
			menu_additem( menu, "\wBalrog-III - \y15000$", "", 0 );
		}
		else
		{
			menu_additem( menu, "\wBalrog-III - \d15000$", "", 0 );
		}

		menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
		menu_display( id, menu, 0 );
	}
	return PLUGIN_HANDLED;
}
public menu_handler( id, menu, item )
{
   switch( item )
   {
      case 0:
      {
         new money = zp_cs_get_user_money(id)
   
         if (money >= 25000)
         {
            zp_cs_set_user_money(id, money - 25000)
            //client_cmd(id, "admin_get_rail_codexdrk1rail")
	    zp_force_buy_extra_item(id, zp_get_extra_item_id("Rail Cannon"), 1)
            ChatColor(id,"!y[!gDarkCSO!y] You have bought [!gRail Cannon!y]");
         }
   
         else
         {
            ChatColor(id,"!y[!gDarkCSO!y] You dont have enough !gmoneys !yto buy [!gRail Cannon!y]")
         }
      }
      case 1:
      {
         new money = zp_cs_get_user_money(id)
   
         if (money >= 5000)
         {
            zp_cs_set_user_money(id, money - 5000)
            //client_cmd(id, "admin_get_plasmagun_codexdrk7y0")
	    zp_force_buy_extra_item(id, zp_get_extra_item_id("Spec. PlazmaGun"), 1)
            ChatColor(id,"!y[!gDarkCSO!y] You have bought [!gPlasmaGun!y]");
         }
   
         else
         {
            ChatColor(id,"!y[!gDarkCSO!y] You dont have enough !gmoneys !yto buy [!gPlasmaGun!y]")
         }
     }
     case 2:
     {
         new money = zp_cs_get_user_money(id)
   
         if (money >= 30000)
         {
            zp_cs_set_user_money(id, money - 30000)
            //client_cmd(id, "admin_get_hk416ex_codexdrkmod")
	    zp_force_buy_extra_item(id, zp_get_extra_item_id("H&K416ex"), 1)
            ChatColor(id,"!y[!gDarkCSO!y] You have bought [!gGolden HK416EX!y]");
            return PLUGIN_HANDLED;
         }
   
         else
         {
            ChatColor(id,"!y[!gDarkCSO!y] You dont have enough !gmoneys !yto buy [!gGolden HK416EX!y]")
         }
     }
	 case 3:
     {
         new money = zp_cs_get_user_money(id)
   
         if (money >= 40000)
         {
            zp_cs_set_user_money(id, money - 40000)
            //client_cmd(id, "admin_get_lightelf_codedrk6969")
            zp_force_buy_extra_item(id, zp_get_extra_item_id("Newcomen (Steampunk-3)"), 1)
            ChatColor(id,"!y[!gDarkCSO!y] You have bought [!gNewcomen!y]");
         }
   
         else
         {
            ChatColor(id,"!y[!gDarkCSO!y] You dont have enough !gmoneys !yto buy [!gNewcomen!y]")
         }
      } 
	  
	case 4:
     {
         new money = zp_cs_get_user_money(id)
   
         if (money >= 15000)
         {
            zp_cs_set_user_money(id, money - 15000)
            //client_cmd(id, "admin_get_balrog3_codexblgdrkm")
	    zp_force_buy_extra_item(id, zp_get_extra_item_id("Balrog-III"), 1)
            ChatColor(id,"!y[!gDarkCSO!y] !yYou have bought [!gBalrog-III!y]");
         }
   
         else
         {
            ChatColor(id,"!y[!gDarkCSO!y] You dont have enough moneys !yto buy [!gBalrog-III!y]")
         }
      }  
	  
   }
   menu_destroy( menu );
   return PLUGIN_HANDLED;
}
// Stock: ChatColor!
stock ChatColor(const id, const input[], any:...)
{
   new count = 1, players[32]
   static msg[191]
   vformat(msg, 190, input, 3)
   
   replace_all(msg, 190, "!g", "^4") // Green Color
   replace_all(msg, 190, "!y", "^1") // Default Color
   replace_all(msg, 190, "!t", "^3") // Team Color
   replace_all(msg, 190, "!t2", "^0") // Team2 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();
         }
      }
   }
}


Ce vreau:
Sa fie scoase toate armele si sa se schimbe cu urmatoarele:

+ 75.000$ ( Once per map )
+ 150 Points ( Once per map )
+ 250 Exp ( Once per Map )
+ 250 HP ( Once per round )
+ 150 AP ( Once per round )

Nativele:

Bani ( $ )
zp_cs_set_user_money(id)
zp_cs_get_user_money(id, value)

Exp
native zp_get_user_exp(id)
native zp_set_user_exp(id, value)

Points
get_user_point(id)
set_user_point(id, value)
User avatar
Scooby-Doo
Membru, skill +1
Membru, skill +1
Posts: 237
Joined: 23 Oct 2014, 22:27
Detinator Steam: Da
CS Status: ~Online~
Detinator server CS: ZOMBIE.OLDGODS.RO
SteamID: darian433
Fond eXtream: 0
Location: Romania
Discord: Darian433#0850
Has thanked: 18 times
Been thanked: 14 times
Contact:

15 Jan 2022, 00:03

INC pentru points?

Edit:
Am presupus ca foloseste reHLDS, amx 1.9+. Facut rapid, netestat.

Code: Select all

#include <amxmodx>
#include <cstrike> 
#include <money>
#include <zombieplague>
#include <fun>

new count[33]

public plugin_init()
{
   register_plugin("VIP Menu", "2.0", "S3xTy")
   register_clcmd("vipmenu", "vipmenu", ADMIN_ALL, "vipmenu");
   count[0] = 0 // reset buy count for all players
}
public vipmenu( id )
{
	if(!(get_user_flags(id) & ADMIN_LEVEL_A))
	{
		client_print_color(id, print_team_default, "!y[!gDarkCSO!y] You have no access to use the !gVip Menu");
		return PLUGIN_HANDLED
	}
	if(!is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_nemesis(id) || cs_get_user_team(id)==CS_TEAM_SPECTATOR)
	{
		client_print_color(id, print_team_default, "!y[!gDarkCSO!y] !tThis function !yis only valid when you are !gHuman!y/!gAlive")
	}
	else
	{
		new menu = menu_create( "\d-\r[\yDarkCSO\r]\d- | \wVip Weapons", "menu_handler" );
		{
			menu_additem( menu, "\r+\w75.000\r$", "", 0 );
		}
		{
			menu_additem( menu, "\r+\w150\r points", "", 0 );
		}
		{
			menu_additem( menu, "\r+\250\r exp", "", 0 );
		}
		{
			menu_additem( menu, "\r+\250\r HP", "", 0 );
		}
		{
			menu_additem( menu, "\r+\150\r AP", "", 0 );
		}
		menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
		menu_display( id, menu, 0 );
	}
	return PLUGIN_HANDLED;
}
public menu_handler( id, menu, item )
{
   switch( item )
   {
      case 0:
      {
         new money = zp_cs_get_user_money(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            client_print(id, print_chat, "You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            zp_cs_set_user_money(id, money + 5000)
         }
      }
      case 1:
      {
         new points = get_user_point(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            client_print(id, print_chat, "You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_point(id, points + 150)
         }
      }
      case 2:
      {
         new exp = zp_get_user_exp(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            client_print(id, print_chat, "You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            zp_set_user_exp(id, exp + 150)
         }
      }
      case 3:
      {
         new hp = get_user_health(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            client_print(id, print_chat, "You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_health(id, hp + 250)
         }
      }
      case 4:
      {
         new ap = get_user_armor(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            client_print(id, print_chat, "You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_armor(id, ap + 150)
         }
      }        
   }
   menu_destroy( menu );
   return PLUGIN_HANDLED;
}
Discord: Darian433#0850

User avatar
Doctor whO? <3
Membru, skill +2
Membru, skill +2
Posts: 995
Joined: 21 Jun 2013, 11:40
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Reputatie: Fost Membru Club eXtreamCS (doua luni)
Has thanked: 100 times
Been thanked: 33 times
Contact:

15 Jan 2022, 18:37

Pot sa iau bonusurile in permanenta, nu mi se aplica acele restrictii.. + daca poti ca HP & armura sa se poata lua doar o singura data pe runda si exp / money si points o singura data pe mapa..
L-am mai modificat putin si daca poti sa faci ca armura si viata sa o poti cumpara o singura data pe runda nu pe harta.

Code: Select all

#include <amxmodx>
#include <cstrike> 
#include <money>
#include <zombieplague>
#include <fun>

native zp_get_user_exp(id)
native zp_set_user_exp(id, value)
native get_user_point(id)
native set_user_point(id, value)

new count[33]

public plugin_init()
{
   register_plugin("VIP Menu", "2.0", "S3xTy")
   register_clcmd("vipmenu", "vipmenu", ADMIN_ALL, "vipmenu");
   count[0] = 0 // reset buy count for all players
}
public vipmenu( id )
{
	if(!(get_user_flags(id) & ADMIN_LEVEL_A))
	{
		ChatColor(id, "!y[!gDarkCSO!y] You have no access to use the !gVip Menu");
		return PLUGIN_HANDLED
	}
	if(!is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_nemesis(id) || cs_get_user_team(id)==CS_TEAM_SPECTATOR)
	{
		ChatColor(id, "!y[!gDarkCSO!y] !tThis function !yis only valid when you are !gHuman!y/!gAlive")
	}
	else
	{
		new menu = menu_create( "\d-\r[\yDarkCSO\r]\d- | \wVip Weapons", "menu_handler" );
		{
			menu_additem( menu, "\r+ \w75.000 \r$", "", 0 );
		}
		{
			menu_additem( menu, "\r+ \w150 \rPoints", "", 0 );
		}
		{
			menu_additem( menu, "\r+ \w250 \rExp", "", 0 );
		}
		{
			menu_additem( menu, "\r+ \w250 \rHP", "", 0 );
		}
		{
			menu_additem( menu, "\r+ \w150 \rAP", "", 0 );
		}
		menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
		menu_display( id, menu, 0 );
	}
	return PLUGIN_HANDLED;
}
public menu_handler( id, menu, item )
{
   switch( item )
   {
      case 0:
      {
         new money = zp_cs_get_user_money(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            zp_cs_set_user_money(id, money + 75000)
         }
      }
      case 1:
      {
         new points = get_user_point(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_point(id, points + 150)
         }
      }
      case 2:
      {
         new exp = zp_get_user_exp(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            zp_set_user_exp(id, exp + 250)
         }
      }
      case 3:
      {
         new hp = get_user_health(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_health(id, hp + 250)
         }
      }
      case 4:
      {
         new ap = get_user_armor(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_armor(id, ap + 150)
         }
      }        
   }
   menu_destroy( menu );
   return PLUGIN_HANDLED;
}

// Stock: ChatColor!
stock ChatColor(const id, const input[], any:...)
{
   new count = 1, players[32]
   static msg[191]
   vformat(msg, 190, input, 3)
   
   replace_all(msg, 190, "!g", "^4") // Green Color
   replace_all(msg, 190, "!y", "^1") // Default Color
   replace_all(msg, 190, "!t", "^3") // Team Color
   replace_all(msg, 190, "!t2", "^0") // Team2 Color
   
   if (id) players[0] = id; else get_players(players, count, "ch")
   {
      for (new i = 0; i < count; i++)
      {
         if (is_user_connected(players[i]))
         {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
            write_byte(players[i]);
            write_string(msg);
            message_end();
         }
      }
   }
}
User avatar
Scooby-Doo
Membru, skill +1
Membru, skill +1
Posts: 237
Joined: 23 Oct 2014, 22:27
Detinator Steam: Da
CS Status: ~Online~
Detinator server CS: ZOMBIE.OLDGODS.RO
SteamID: darian433
Fond eXtream: 0
Location: Romania
Discord: Darian433#0850
Has thanked: 18 times
Been thanked: 14 times
Contact:

16 Jan 2022, 00:29

Am continuat pe cel ce ti l-am trimis, il modifici tu pentru 1.8 sau ce folosesti ca tot nu mi-ai spus...

Code: Select all

#include <amxmodx>
#include <cstrike> 
#include <money>
#include <zombieplague>
#include <fun>

new count[33]

new countround[33]

public plugin_init()
{
   register_plugin("VIP Menu", "2.0", "S3xTy")
   register_clcmd("vipmenu", "vipmenu", ADMIN_ALL, "vipmenu");
   count[0] = 0 // reset buy count for all players
}

public Event_NewRound()
{
    countround[0] = 0
}

public vipmenu( id )
{
	if(!(get_user_flags(id) & ADMIN_LEVEL_A))
	{
		client_print_color(id, print_team_default, "!y[!gDarkCSO!y] You have no access to use the !gVip Menu");
		return PLUGIN_HANDLED
	}
	if(!is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_nemesis(id) || cs_get_user_team(id)==CS_TEAM_SPECTATOR)
	{
		client_print_color(id, print_team_default, "!y[!gDarkCSO!y] !tThis function !yis only valid when you are !gHuman!y/!gAlive")
	}
	else
	{
		new menu = menu_create( "\d-\r[\yDarkCSO\r]\d- | \wVip Weapons", "menu_handler" );
		{
			menu_additem( menu, "\r+\w75.000\r$", "", 0 );
		}
		{
			menu_additem( menu, "\r+\w150\r points", "", 0 );
		}
		{
			menu_additem( menu, "\r+\250\r exp", "", 0 );
		}
		{
			menu_additem( menu, "\r+\250\r HP", "", 0 );
		}
		{
			menu_additem( menu, "\r+\150\r AP", "", 0 );
		}
		menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
		menu_display( id, menu, 0 );
	}
	return PLUGIN_HANDLED;
}
public menu_handler( id, menu, item )
{
   switch( item )
   {
      case 0:
      {
         new money = zp_cs_get_user_money(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            client_print(id, print_chat, "You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            zp_cs_set_user_money(id, money + 5000)
         }
         count[id]++
      }
      case 1:
      {
         new points = get_user_point(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            client_print(id, print_chat, "You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_point(id, points + 150)
         }
         count[id]++
      }
      case 2:
      {
         new exp = zp_get_user_exp(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            client_print(id, print_chat, "You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            zp_set_user_exp(id, exp + 150)
         }
         count[id]++
      }
      case 3:
      {
         new hp = get_user_health(id)
         if (countround[id] >= 1)
         {
            client_print(id, print_chat, "You can buy this item only 1 times per round.")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_health(id, hp + 250)
         }
         countround[id]++
      }
      case 4:
      {
         new ap = get_user_armor(id)
         if (countround[id] >= 1)
         {
            client_print(id, print_chat, "You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_armor(id, ap + 150)
         }
         countround[id]++
      }        
   }
   menu_destroy( menu );
   return PLUGIN_HANDLED;
}
+ daca vrei ca viata / hp sa fie numarate separat (adica odata iei viata, odata armura in aceasi runda) ai mai jos. In cel de sus poti alege doar 1 din cele 2.

Code: Select all

#include <amxmodx>
#include <cstrike> 
#include <money>
#include <zombieplague>
#include <fun>

new count[33]

new counthp[33]
new countap[33]

public plugin_init()
{
   register_plugin("VIP Menu", "2.0", "S3xTy")
   register_clcmd("vipmenu", "vipmenu", ADMIN_ALL, "vipmenu");
   count[0] = 0 // reset buy count for all players
}

public Event_NewRound()
{
    counthp[0] = 0
    countap[0] = 0
}

public vipmenu( id )
{
	if(!(get_user_flags(id) & ADMIN_LEVEL_A))
	{
		client_print_color(id, print_team_default, "!y[!gDarkCSO!y] You have no access to use the !gVip Menu");
		return PLUGIN_HANDLED
	}
	if(!is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_nemesis(id) || cs_get_user_team(id)==CS_TEAM_SPECTATOR)
	{
		client_print_color(id, print_team_default, "!y[!gDarkCSO!y] !tThis function !yis only valid when you are !gHuman!y/!gAlive")
	}
	else
	{
		new menu = menu_create( "\d-\r[\yDarkCSO\r]\d- | \wVip Weapons", "menu_handler" );
		{
			menu_additem( menu, "\r+\w75.000\r$", "", 0 );
		}
		{
			menu_additem( menu, "\r+\w150\r points", "", 0 );
		}
		{
			menu_additem( menu, "\r+\250\r exp", "", 0 );
		}
		{
			menu_additem( menu, "\r+\250\r HP", "", 0 );
		}
		{
			menu_additem( menu, "\r+\150\r AP", "", 0 );
		}
		menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
		menu_display( id, menu, 0 );
	}
	return PLUGIN_HANDLED;
}
public menu_handler( id, menu, item )
{
   switch( item )
   {
      case 0:
      {
         new money = zp_cs_get_user_money(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            client_print(id, print_chat, "You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            zp_cs_set_user_money(id, money + 5000)
         }
         count[id]++
      }
      case 1:
      {
         new points = get_user_point(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            client_print(id, print_chat, "You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_point(id, points + 150)
         }
         count[id]++
      }
      case 2:
      {
         new exp = zp_get_user_exp(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            client_print(id, print_chat, "You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            zp_set_user_exp(id, exp + 150)
         }
         count[id]++
      }
      case 3:
      {
         new hp = get_user_health(id)
         if (counthp[id] >= 1)
         {
            client_print(id, print_chat, "You can buy this item only 1 times per round.")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_health(id, hp + 250)
         }
         counthp[id]++
      }
      case 4:
      {
         new ap = get_user_armor(id)
         if (countap[id] >= 1)
         {
            client_print(id, print_chat, "You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_armor(id, ap + 150)
         }
         countap[id]++
      }        
   }
   menu_destroy( menu );
   return PLUGIN_HANDLED;
}
Discord: Darian433#0850

User avatar
Doctor whO? <3
Membru, skill +2
Membru, skill +2
Posts: 995
Joined: 21 Jun 2013, 11:40
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Reputatie: Fost Membru Club eXtreamCS (doua luni)
Has thanked: 100 times
Been thanked: 33 times
Contact:

16 Jan 2022, 11:29

Functioneaza, insa problema este in felul urmator:
Daca cumpar un item pe care il pot cumpara o data pe harta, nu mai cumpara altul. De exemplu, cumpar 75.000$ si vreau sa cumpar si 150 points, nu ma lasa...
Si la HP / Armura pot sa aleg doar o data pe harta nu pe runda.

Folosesc amxx 1.9 si rehdls + am lasat sursa mai jos cu modificarile facute de mine.

Code: Select all

#include <amxmodx>
#include <cstrike> 
#include <money>
#include <zombieplague>
#include <fun>

native zp_get_user_exp(id)
native zp_set_user_exp(id, value)
native get_user_point(id)
native set_user_point(id, value)

new count[33]

new counthp[33]
new countap[33]

public plugin_init()
{
   register_plugin("VIP Menu", "2.0", "S3xTy")
   register_clcmd("vipmenu", "vipmenu", ADMIN_ALL, "vipmenu");
   count[0] = 0 // reset buy count for all players
}

public Event_NewRound()
{
    counthp[0] = 0
    countap[0] = 0
}

public vipmenu( id )
{
	if(!(get_user_flags(id) & ADMIN_LEVEL_A))
	{
		ChatColor(id, "!y[!gDarkCSO!y] You have no access to use the !gVip Menu");
		return PLUGIN_HANDLED
	}
	if(!is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_nemesis(id) || cs_get_user_team(id)==CS_TEAM_SPECTATOR)
	{
		ChatColor(id, "!y[!gDarkCSO!y] !tThis function !yis only valid when you are !gHuman!y/!gAlive")
	}
	else
	{
		new menu = menu_create( "\d-\r[\yDarkCSO\r]\d- | \wVip Weapons", "menu_handler" );
		{
			menu_additem( menu, "\r+ \w75.000 \r$", "", 0 );
		}
		{
			menu_additem( menu, "\r+ \w150 \rPoints", "", 0 );
		}
		{
			menu_additem( menu, "\r+ \w250 \rExp", "", 0 );
		}
		{
			menu_additem( menu, "\r+ \w250 \rHP", "", 0 );
		}
		{
			menu_additem( menu, "\r+ \w150 \rAP", "", 0 );
		}
		menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
		menu_display( id, menu, 0 );
	}
	return PLUGIN_HANDLED;
}
public menu_handler( id, menu, item )
{
   switch( item )
   {
      case 0:
      {
         new money = zp_cs_get_user_money(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            zp_cs_set_user_money(id, money + 75000)
         }
         count[id]++
      }
      case 1:
      {
         new points = get_user_point(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_point(id, points + 150)
         }
         count[id]++
      }
      case 2:
      {
         new exp = zp_get_user_exp(id)
         if (count[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            zp_set_user_exp(id, exp + 250)
         }
         count[id]++
      }
      case 3:
      {
         new hp = get_user_health(id)
         if (counthp[id] >= 1)
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per round.")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_health(id, hp + 250)
         }
         counthp[id]++
      }
      case 4:
      {
         new ap = get_user_armor(id)
         if (countap[id] >= 1)
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per round")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_armor(id, ap + 150)
         }
         countap[id]++
      }        
   }
   menu_destroy( menu );
   return PLUGIN_HANDLED;
}

// Stock: ChatColor!
stock ChatColor(const id, const input[], any:...)
{
   new count = 1, players[32]
   static msg[191]
   vformat(msg, 190, input, 3)
   
   replace_all(msg, 190, "!g", "^4") // Green Color
   replace_all(msg, 190, "!y", "^1") // Default Color
   replace_all(msg, 190, "!t", "^3") // Team Color
   replace_all(msg, 190, "!t2", "^0") // Team2 Color
   
   if (id) players[0] = id; else get_players(players, count, "ch")
   {
      for (new i = 0; i < count; i++)
      {
         if (is_user_connected(players[i]))
         {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
            write_byte(players[i]);
            write_string(msg);
            message_end();
         }
      }
   }
}
User avatar
Scooby-Doo
Membru, skill +1
Membru, skill +1
Posts: 237
Joined: 23 Oct 2014, 22:27
Detinator Steam: Da
CS Status: ~Online~
Detinator server CS: ZOMBIE.OLDGODS.RO
SteamID: darian433
Fond eXtream: 0
Location: Romania
Discord: Darian433#0850
Has thanked: 18 times
Been thanked: 14 times
Contact:

16 Jan 2022, 13:55

Pai daca folosesti amx 1.9 cu reHLDS, la ce mai ai nevoie de chatcolor?
Foloseste > https://www.amxmodx.org/api/amxmodx/client_print_color ; este exact aceasi treaba.
Verifica acum, am uitat niste lucruri..

Code: Select all

#include <amxmodx>
#include <cstrike> 
#include <money>
#include <zombieplague>
#include <fun>

native zp_get_user_exp(id)
native zp_set_user_exp(id, value)
native get_user_point(id)
native set_user_point(id, value)

new countmoney[33]
new countpoints[33]
new countexp[33]
new counthp[33]
new countap[33]

public plugin_init()
{
   register_plugin("VIP Menu", "2.0", "S3xTy")
   register_clcmd("vipmenu", "vipmenu", ADMIN_ALL, "vipmenu");
   register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0")
   
   countmoney[0] = 0 // reset count for money every map
   countpoints[0] = 0 // reset count for points every map
   countexp[0] = 0 // reset count for exp every map
}

public Event_NewRound()
{
    counthp[0] = 0 // reset count hp every round
    countap[0] = 0 // reset count ap every round
}

public vipmenu( id )
{
   if(!(get_user_flags(id) & ADMIN_LEVEL_A))
   {
      ChatColor(id, "!y[!gDarkCSO!y] You have no access to use the !gVip Menu");
      return PLUGIN_HANDLED
   }
   if(!is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_nemesis(id) || cs_get_user_team(id)==CS_TEAM_SPECTATOR)
   {
      ChatColor(id, "!y[!gDarkCSO!y] !tThis function !yis only valid when you are !gHuman!y/!gAlive")
   }
   else
   {
      new menu = menu_create( "\d-\r[\yDarkCSO\r]\d- | \wVip Weapons", "menu_handler" );
      {
         menu_additem( menu, "\r+ \w75.000 \r$", "", 0 );
      }
      {
         menu_additem( menu, "\r+ \w150 \rPoints", "", 0 );
      }
      {
         menu_additem( menu, "\r+ \w250 \rExp", "", 0 );
      }
      {
         menu_additem( menu, "\r+ \w250 \rHP", "", 0 );
      }
      {
         menu_additem( menu, "\r+ \w150 \rAP", "", 0 );
      }
      menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
      menu_display( id, menu, 0 );
   }
   return PLUGIN_HANDLED;
}
public menu_handler( id, menu, item )
{
   switch( item )
   {
      case 0:
      {
         new money = zp_cs_get_user_money(id)
         if (countmoney[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            zp_cs_set_user_money(id, money + 75000)
         }
         countmoney[id]++
      }
      case 1:
      {
         new points = get_user_point(id)
         if (countpoints[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_point(id, points + 150)
         }
         countpoints[id]++
      }
      case 2:
      {
         new exp = zp_get_user_exp(id)
         if (countexp[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            zp_set_user_exp(id, exp + 250)
         }
         countexp[id]++
      }
      case 3:
      {
         new hp = get_user_health(id)
         if (counthp[id] >= 1)
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per round.")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_health(id, hp + 250)
         }
         counthp[id]++
      }
      case 4:
      {
         new ap = get_user_armor(id)
         if (countap[id] >= 1)
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per round")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_armor(id, ap + 150)
         }
         countap[id]++
      }        
   }
   menu_destroy( menu );
   return PLUGIN_HANDLED;
}

// Stock: ChatColor!
stock ChatColor(const id, const input[], any:...)
{
   new count = 1, players[32]
   static msg[191]
   vformat(msg, 190, input, 3)
   
   replace_all(msg, 190, "!g", "^4") // Green Color
   replace_all(msg, 190, "!y", "^1") // Default Color
   replace_all(msg, 190, "!t", "^3") // Team Color
   replace_all(msg, 190, "!t2", "^0") // Team2 Color
   
   if (id) players[0] = id; else get_players(players, count, "ch")
   {
      for (new i = 0; i < count; i++)
      {
         if (is_user_connected(players[i]))
         {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
            write_byte(players[i]);
            write_string(msg);
            message_end();
         }
      }
   }
}
Discord: Darian433#0850

User avatar
Doctor whO? <3
Membru, skill +2
Membru, skill +2
Posts: 995
Joined: 21 Jun 2013, 11:40
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Reputatie: Fost Membru Club eXtreamCS (doua luni)
Has thanked: 100 times
Been thanked: 33 times
Contact:

16 Jan 2022, 14:59

Scooby-Doo wrote:
16 Jan 2022, 13:55
Pai daca folosesti amx 1.9 cu reHLDS, la ce mai ai nevoie de chatcolor?
Foloseste > https://www.amxmodx.org/api/amxmodx/client_print_color ; este exact aceasi treaba.
Verifica acum, am uitat niste lucruri..

Code: Select all

#include <amxmodx>
#include <cstrike> 
#include <money>
#include <zombieplague>
#include <fun>

native zp_get_user_exp(id)
native zp_set_user_exp(id, value)
native get_user_point(id)
native set_user_point(id, value)

new countmoney[33]
new countpoints[33]
new countexp[33]
new counthp[33]
new countap[33]

public plugin_init()
{
   register_plugin("VIP Menu", "2.0", "S3xTy")
   register_clcmd("vipmenu", "vipmenu", ADMIN_ALL, "vipmenu");
   register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0")
   
   countmoney[0] = 0 // reset count for money every map
   countpoints[0] = 0 // reset count for points every map
   countexp[0] = 0 // reset count for exp every map
}

public Event_NewRound()
{
    counthp[0] = 0 // reset count hp every round
    countap[0] = 0 // reset count ap every round
}

public vipmenu( id )
{
   if(!(get_user_flags(id) & ADMIN_LEVEL_A))
   {
      ChatColor(id, "!y[!gDarkCSO!y] You have no access to use the !gVip Menu");
      return PLUGIN_HANDLED
   }
   if(!is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_nemesis(id) || cs_get_user_team(id)==CS_TEAM_SPECTATOR)
   {
      ChatColor(id, "!y[!gDarkCSO!y] !tThis function !yis only valid when you are !gHuman!y/!gAlive")
   }
   else
   {
      new menu = menu_create( "\d-\r[\yDarkCSO\r]\d- | \wVip Weapons", "menu_handler" );
      {
         menu_additem( menu, "\r+ \w75.000 \r$", "", 0 );
      }
      {
         menu_additem( menu, "\r+ \w150 \rPoints", "", 0 );
      }
      {
         menu_additem( menu, "\r+ \w250 \rExp", "", 0 );
      }
      {
         menu_additem( menu, "\r+ \w250 \rHP", "", 0 );
      }
      {
         menu_additem( menu, "\r+ \w150 \rAP", "", 0 );
      }
      menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
      menu_display( id, menu, 0 );
   }
   return PLUGIN_HANDLED;
}
public menu_handler( id, menu, item )
{
   switch( item )
   {
      case 0:
      {
         new money = zp_cs_get_user_money(id)
         if (countmoney[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            zp_cs_set_user_money(id, money + 75000)
         }
         countmoney[id]++
      }
      case 1:
      {
         new points = get_user_point(id)
         if (countpoints[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_point(id, points + 150)
         }
         countpoints[id]++
      }
      case 2:
      {
         new exp = zp_get_user_exp(id)
         if (countexp[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            zp_set_user_exp(id, exp + 250)
         }
         countexp[id]++
      }
      case 3:
      {
         new hp = get_user_health(id)
         if (counthp[id] >= 1)
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per round.")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_health(id, hp + 250)
         }
         counthp[id]++
      }
      case 4:
      {
         new ap = get_user_armor(id)
         if (countap[id] >= 1)
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per round")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_armor(id, ap + 150)
         }
         countap[id]++
      }        
   }
   menu_destroy( menu );
   return PLUGIN_HANDLED;
}

// Stock: ChatColor!
stock ChatColor(const id, const input[], any:...)
{
   new count = 1, players[32]
   static msg[191]
   vformat(msg, 190, input, 3)
   
   replace_all(msg, 190, "!g", "^4") // Green Color
   replace_all(msg, 190, "!y", "^1") // Default Color
   replace_all(msg, 190, "!t", "^3") // Team Color
   replace_all(msg, 190, "!t2", "^0") // Team2 Color
   
   if (id) players[0] = id; else get_players(players, count, "ch")
   {
      for (new i = 0; i < count; i++)
      {
         if (is_user_connected(players[i]))
         {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
            write_byte(players[i]);
            write_string(msg);
            message_end();
         }
      }
   }
}
La hp si armura cred ca e pus sa se poata lua o singura data pe harta ca se schimba runda si nu pot sa iau iar.
User avatar
Scooby-Doo
Membru, skill +1
Membru, skill +1
Posts: 237
Joined: 23 Oct 2014, 22:27
Detinator Steam: Da
CS Status: ~Online~
Detinator server CS: ZOMBIE.OLDGODS.RO
SteamID: darian433
Fond eXtream: 0
Location: Romania
Discord: Darian433#0850
Has thanked: 18 times
Been thanked: 14 times
Contact:

16 Jan 2022, 15:23

Ar fi trebuit sa mearga fara probleme, nu stiu de ce nu functioneaza, totusi, incearca asta >

Code: Select all

#include <amxmodx>
#include <cstrike> 
#include <money>
#include <zombieplague>
#include <fun>

native zp_get_user_exp(id)
native zp_set_user_exp(id, value)
native get_user_point(id)
native set_user_point(id, value)

new countmoney[33]
new countpoints[33]
new countexp[33]
new counthp[33]
new countap[33]

public plugin_init()
{
   register_plugin("VIP Menu", "2.0", "S3xTy")
   register_clcmd("vipmenu", "vipmenu", ADMIN_ALL, "vipmenu");
   register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0")
   
   countmoney[0] = 0 // reset count for money every map
   countpoints[0] = 0 // reset count for points every map
   countexp[0] = 0 // reset count for exp every map
}

public Event_NewRound()
{
   for (new id = 1; id <= get_maxplayers(); id++)
   counthp[0] = 0 // reset count hp every round
   countap[0] = 0 // reset count ap every round
}

public vipmenu( id )
{
   if(!(get_user_flags(id) & ADMIN_LEVEL_A))
   {
      ChatColor(id, "!y[!gDarkCSO!y] You have no access to use the !gVip Menu");
      return PLUGIN_HANDLED
   }
   if(!is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_nemesis(id) || cs_get_user_team(id)==CS_TEAM_SPECTATOR)
   {
      ChatColor(id, "!y[!gDarkCSO!y] !tThis function !yis only valid when you are !gHuman!y/!gAlive")
   }
   else
   {
      new menu = menu_create( "\d-\r[\yDarkCSO\r]\d- | \wVip Weapons", "menu_handler" );
      {
         menu_additem( menu, "\r+ \w75.000 \r$", "", 0 );
      }
      {
         menu_additem( menu, "\r+ \w150 \rPoints", "", 0 );
      }
      {
         menu_additem( menu, "\r+ \w250 \rExp", "", 0 );
      }
      {
         menu_additem( menu, "\r+ \w250 \rHP", "", 0 );
      }
      {
         menu_additem( menu, "\r+ \w150 \rAP", "", 0 );
      }
      menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
      menu_display( id, menu, 0 );
   }
   return PLUGIN_HANDLED;
}
public menu_handler( id, menu, item )
{
   switch( item )
   {
      case 0:
      {
         new money = zp_cs_get_user_money(id)
         if (countmoney[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            zp_cs_set_user_money(id, money + 75000)
         }
         countmoney[id]++
      }
      case 1:
      {
         new points = get_user_point(id)
         if (countpoints[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_point(id, points + 150)
         }
         countpoints[id]++
      }
      case 2:
      {
         new exp = zp_get_user_exp(id)
         if (countexp[id] >= 1) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
            return PLUGIN_HANDLED;
         }
         else
         {
            zp_set_user_exp(id, exp + 250)
         }
         countexp[id]++
      }
      case 3:
      {
         new hp = get_user_health(id)
         if (counthp[id] >= 1)
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per round.")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_health(id, hp + 250)
         }
         counthp[id]++
      }
      case 4:
      {
         new ap = get_user_armor(id)
         if (countap[id] >= 1)
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per round")
            return PLUGIN_HANDLED;
         }
         else
         {
            set_user_armor(id, ap + 150)
         }
         countap[id]++
      }        
   }
   menu_destroy( menu );
   return PLUGIN_HANDLED;
}

// Stock: ChatColor!
stock ChatColor(const id, const input[], any:...)
{
   new count = 1, players[32]
   static msg[191]
   vformat(msg, 190, input, 3)
   
   replace_all(msg, 190, "!g", "^4") // Green Color
   replace_all(msg, 190, "!y", "^1") // Default Color
   replace_all(msg, 190, "!t", "^3") // Team Color
   replace_all(msg, 190, "!t2", "^0") // Team2 Color
   
   if (id) players[0] = id; else get_players(players, count, "ch")
   {
      for (new i = 0; i < count; i++)
      {
         if (is_user_connected(players[i]))
         {
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
            write_byte(players[i]);
            write_string(msg);
            message_end();
         }
      }
   }
}
Discord: Darian433#0850

User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3347
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: Levin#0061
Has thanked: 40 times
Been thanked: 511 times
Contact:

16 Jan 2022, 16:18

code | Afiseaza codul
#include <amxmodx>
#include <cstrike> 
#include <fun>
#include <nvault>
#include <money>
#include <zombieplague>

#pragma tabsize 0

#define VAULT "SALVARE_DATE_MAPA"

native zp_get_user_exp(id)
native zp_set_user_exp(id, value)
native get_user_point(id)
native set_user_point(id, value)

new count[33][5],iVaultHandle,mapname[35]

public plugin_init(){
   register_plugin("VIP Menu", "2.0", "S3xTy")
iVaultHandle = nvault_open( VAULT );
if ( iVaultHandle == INVALID_HANDLE )set_fail_state( "Error opening nVault" ); 
   register_clcmd("vipmenu", "vipmenu", ADMIN_ALL, "vipmenu");
   register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0")
   get_mapname(mapname,charsmax(mapname))
}
public plugin_end() if ( iVaultHandle != INVALID_HANDLE )nvault_close( iVaultHandle ); 

public client_putinserver(id) if(!(is_user_bot(id)||is_user_hltv(id)) LoadData(id)

public Event_NewRound() count[0][0] = count[0][1] = 0 // reset HP(0),AP(1) count on every new round

public vipmenu( id ){
   if(!is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_nemesis(id) || cs_get_user_team(id)==CS_TEAM_SPECTATOR) ChatColor(id, "!y[!gDarkCSO!y] !tThis function !yis only valid when you are !gHuman!y/!gAlive")
   else if(!(get_user_flags(id) & ADMIN_LEVEL_A)) ChatColor(id, "!y[!gDarkCSO!y] You have no access to use the!g Vip Menu");
   else{
      new menu = menu_create( "\d-\r[\yDarkCSO\r]\d- |\w Vip Weapons", "menu_handler" );
         menu_additem( menu, "\r+\w 75.000\r $" );
         menu_additem( menu, "\r+\w 150\r Points" );
         menu_additem( menu, "\r+\w 250\r Exp" );
         menu_additem( menu, "\r+\w 250\r HP" );
         menu_additem( menu, "\r+\w 150\r AP" );
      menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
      menu_display( id, menu, 0 );
   }
   return PLUGIN_HANDLED;
}
public menu_handler( id, menu, item ){
   switch( item ){
      case 0:{
         if (count[id][2]) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
         }else{
		zp_cs_set_user_money(id, zp_cs_get_user_money(id) + 75000)
		count[id][2]=1
		SaveData(id)
	 }
      }
      case 1:{
         if (count[id][3]) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
         }else{
		set_user_point(id, get_user_point(id) + 150)
		count[id][3]=1
		SaveData(id)
	 }
      }
      case 2:{
         if (count[id][4]) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
         } else{
		zp_set_user_exp(id, zp_get_user_exp(id) + 250)
		count[id][4]=1
		SaveData(id)
	 }
      }
      case 3:{
         if (count[id][0]) ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per round.")
         else{
		set_user_health(id, get_user_health(id) + 250)
		count[id][0]=1
	 }
      }
      case 4:{
         if (count[id][1]) ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per round")
         else{
		set_user_armor(id, get_user_armor(id) + 150)
		count[id][1]=1
	 }
      }        
   }
   menu_destroy( menu );
   return PLUGIN_HANDLED;
}

stock SaveData(const id){
	new nick[33],string[45]
	formatex(string,charsmax(string),"%s %d %d %d",mapname,count[id][2],count[id][3],count[id][4]
	nvault_set( iVaultHandle , nick , string );
}
stock LoadData(const id){
	new nick[33],szDataString[45];
	get_user_name(id,nick,charsmax(nick))
	if(nvault_get( iVaultHandle , nick , szDataString , charsmax( szDataString ) )){
		new szcount[3],szmapname[35]
		parse(szDataString,szmapname,charsmax(szmapname),szcount[0],charsmax(szcount[]),szcount[1],charsmax(szcount[]),szcount[2],charsmax(szcount[]))
		if(equali(szmapname,mapname)){
			count[id][2]=str_to_num(szcount[0])
			count[id][3]=str_to_num(szcount[1])
			count[id][4]=str_to_num(szcount[2])
		}else{
			count[id][2]=count[id][3]=count[id][4]=0
			nvault_remove(iVaultHandle,nick)
		}
	}
}

// Stock: ChatColor! nu i bun drc da mna csf
stock ChatColor(const id, const input[], any:...){
   new count = 1, players[32]
   static msg[191];vformat(msg, 190, input, 3)
   
   replace_all(msg, 190, "!g", "^4") // Green Color
   replace_all(msg, 190, "!y", "^1") // Default Color
   replace_all(msg, 190, "!t", "^3") // Team Color
   replace_all(msg, 190, "!t2", "^0") // Team2 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();
         }
      }
}
Faceți cerere bine detaliată aici și respectând modelul dacă vreți ajutor.
Nu-mi mai dați add doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug la lista de „ignore”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine(STEAM sau PM) dacă aveți o problemă/nelămurire în acest caz! (am cont doar aici!!)
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici, iar dacă sunt ceva probleme sau aveți dvs. probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se va posta la actual, doar dacă se găsește ceva critic/urgent de remediat, fiind coduri vechi, iar unele refăcute recent. NU MAI OFER SUPORT PENTRU ELE!(doar dacă nu e ceva critic/plătit)
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - anunturi/lev-shop-t370037.html
User avatar
Doctor whO? <3
Membru, skill +2
Membru, skill +2
Posts: 995
Joined: 21 Jun 2013, 11:40
Detinator Steam: Da
CS Status: Citesc forumul eXtreamCS.com...!
Reputatie: Fost Membru Club eXtreamCS (doua luni)
Has thanked: 100 times
Been thanked: 33 times
Contact:

16 Jan 2022, 19:46

L E V I N wrote:
16 Jan 2022, 16:18

Code: Select all

#include <amxmodx>
#include <cstrike> 
#include <fun>
#include <nvault>
#include <money>
#include <zombieplague>

#pragma tabsize 0

#define VAULT "SALVARE_DATE_MAPA"

native zp_get_user_exp(id)
native zp_set_user_exp(id, value)
native get_user_point(id)
native set_user_point(id, value)

new count[33][5],iVaultHandle,mapname[35]

public plugin_init(){
   register_plugin("VIP Menu", "2.0", "S3xTy")
iVaultHandle = nvault_open( VAULT );
if ( iVaultHandle == INVALID_HANDLE )set_fail_state( "Error opening nVault" ); 
   register_clcmd("vipmenu", "vipmenu", ADMIN_ALL, "vipmenu");
   register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0")
   get_mapname(mapname,charsmax(mapname))
}
public plugin_end() if ( iVaultHandle != INVALID_HANDLE )nvault_close( iVaultHandle ); 

public client_putinserver(id) if(!(is_user_bot(id)||is_user_hltv(id)) LoadData(id)

public Event_NewRound() count[0][0] = count[0][1] = 0 // reset HP(0),AP(1) count on every new round

public vipmenu( id ){
   if(!is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_nemesis(id) || cs_get_user_team(id)==CS_TEAM_SPECTATOR) ChatColor(id, "!y[!gDarkCSO!y] !tThis function !yis only valid when you are !gHuman!y/!gAlive")
   else if(!(get_user_flags(id) & ADMIN_LEVEL_A)) ChatColor(id, "!y[!gDarkCSO!y] You have no access to use the!g Vip Menu");
   else{
      new menu = menu_create( "\d-\r[\yDarkCSO\r]\d- |\w Vip Weapons", "menu_handler" );
         menu_additem( menu, "\r+\w 75.000\r $" );
         menu_additem( menu, "\r+\w 150\r Points" );
         menu_additem( menu, "\r+\w 250\r Exp" );
         menu_additem( menu, "\r+\w 250\r HP" );
         menu_additem( menu, "\r+\w 150\r AP" );
      menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
      menu_display( id, menu, 0 );
   }
   return PLUGIN_HANDLED;
}
public menu_handler( id, menu, item ){
   switch( item ){
      case 0:{
         if (count[id][2]) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
         }else{
		zp_cs_set_user_money(id, zp_cs_get_user_money(id) + 75000)
		count[id][2]=1
		SaveData(id)
	 }
      }
      case 1:{
         if (count[id][3]) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
         }else{
		set_user_point(id, get_user_point(id) + 150)
		count[id][3]=1
		SaveData(id)
	 }
      }
      case 2:{
         if (count[id][4]) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
         } else{
		zp_set_user_exp(id, zp_get_user_exp(id) + 250)
		count[id][4]=1
		SaveData(id)
	 }
      }
      case 3:{
         if (count[id][0]) ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per round.")
         else{
		set_user_health(id, get_user_health(id) + 250)
		count[id][0]=1
	 }
      }
      case 4:{
         if (count[id][1]) ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per round")
         else{
		set_user_armor(id, get_user_armor(id) + 150)
		count[id][1]=1
	 }
      }        
   }
   menu_destroy( menu );
   return PLUGIN_HANDLED;
}

stock SaveData(const id){
	new nick[33],string[45]
	formatex(string,charsmax(string),"%s %d %d %d",mapname,count[id][2],count[id][3],count[id][4]
	nvault_set( iVaultHandle , nick , string );
}
stock LoadData(const id){
	new nick[33],szDataString[45];
	get_user_name(id,nick,charsmax(nick))
	if(nvault_get( iVaultHandle , nick , szDataString , charsmax( szDataString ) )){
		new szcount[3],szmapname[35]
		parse(szDataString,szmapname,charsmax(szmapname),szcount[0],charsmax(szcount[]),szcount[1],charsmax(szcount[]),szcount[2],charsmax(szcount[]))
		if(equali(szmapname,mapname)){
			count[id][2]=str_to_num(szcount[0])
			count[id][3]=str_to_num(szcount[1])
			count[id][4]=str_to_num(szcount[2])
		}else{
			count[id][2]=count[id][3]=count[id][4]=0
			nvault_remove(iVaultHandle,nick)
		}
	}
}

// Stock: ChatColor! nu i bun drc da mna csf
stock ChatColor(const id, const input[], any:...){
   new count = 1, players[32]
   static msg[191];vformat(msg, 190, input, 3)
   
   replace_all(msg, 190, "!g", "^4") // Green Color
   replace_all(msg, 190, "!y", "^1") // Default Color
   replace_all(msg, 190, "!t", "^3") // Team Color
   replace_all(msg, 190, "!t2", "^0") // Team2 Color
   
   if (id) players[0] = id; else get_players(players, count, "ch")
      for (new i = 0; i < count; i++){
         if (is_user_connected(players[i])){
            message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i])
            write_byte(players[i]);
            write_string(msg);
            message_end();
         }
      }
}
Primesc eroare la compilare:

// C:\Users\h\OneDrive\Desktop\scripting clase zm\darkcso_vipmenu_new.sma(29) : error 001: expected token: ")", but found "-identifier-"
// C:\Users\h\OneDrive\Desktop\scripting clase zm\darkcso_vipmenu_new.sma(101 -- 102) : error 001: expected token: ",", but found "-identifier-"
User avatar
The Kalu
Administrator
Administrator
Posts: 13204
Joined: 09 Oct 2010, 11:39
Detinator Steam: Da
CS Status: In grajd!
SteamID: kalulord
Reputatie: Administrator
Fost membru Club eXtreamCS (6 luni)
Nume anterior: Terra
Location: Romania, Ploiesti
Has thanked: 272 times
Been thanked: 518 times
Contact:

16 Jan 2022, 21:04

Doctor whO? <3 wrote:
16 Jan 2022, 19:46
vezi acuma | Afiseaza codul
#include <amxmodx>
#include <cstrike> 
#include <fun>
#include <nvault>
#include <money>
#include <zombieplague>

#pragma tabsize 0

#define VAULT "SALVARE_DATE_MAPA"

native zp_get_user_exp(id)
native zp_set_user_exp(id, value)
native get_user_point(id)
native set_user_point(id, value)

new count[33][5],iVaultHandle,mapname[35]

public plugin_init(){
   register_plugin("VIP Menu", "2.0", "S3xTy")
iVaultHandle = nvault_open( VAULT );
if ( iVaultHandle == INVALID_HANDLE )set_fail_state( "Error opening nVault" ); 
   register_clcmd("vipmenu", "vipmenu", ADMIN_ALL, "vipmenu");
   register_event("HLTV", "Event_NewRound", "a", "1=0", "2=0")
   get_mapname(mapname,charsmax(mapname))
}
public plugin_end() if ( iVaultHandle != INVALID_HANDLE )nvault_close( iVaultHandle ); 

public client_putinserver(id) if(!(is_user_bot(id)||is_user_hltv(id)) LoadData(id))

public Event_NewRound() count[0][0] = count[0][1] = 0 // reset HP(0),AP(1) count on every new round

public vipmenu( id ){
   if(!is_user_alive(id) || zp_get_user_zombie(id) || zp_get_user_survivor(id) || zp_get_user_nemesis(id) || cs_get_user_team(id)==CS_TEAM_SPECTATOR) ChatColor(id, "!y[!gDarkCSO!y] !tThis function !yis only valid when you are !gHuman!y/!gAlive")
   else if(!(get_user_flags(id) & ADMIN_LEVEL_A)) ChatColor(id, "!y[!gDarkCSO!y] You have no access to use the!g Vip Menu");
   else{
      new menu = menu_create( "\d-\r[\yDarkCSO\r]\d- |\w Vip Weapons", "menu_handler" );
         menu_additem( menu, "\r+\w 75.000\r $" );
         menu_additem( menu, "\r+\w 150\r Points" );
         menu_additem( menu, "\r+\w 250\r Exp" );
         menu_additem( menu, "\r+\w 250\r HP" );
         menu_additem( menu, "\r+\w 150\r AP" );
      menu_setprop( menu, MPROP_EXIT, MEXIT_ALL );
      menu_display( id, menu, 0 );
   }
   return PLUGIN_HANDLED;
}
public menu_handler( id, menu, item ){
   switch( item ){
      case 0:{
         if (count[id][2]) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
         }else{
		zp_cs_set_user_money(id, zp_cs_get_user_money(id) + 75000)
		count[id][2]=1
		SaveData(id)
	 }
      }
      case 1:{
         if (count[id][3]) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
         }else{
		set_user_point(id, get_user_point(id) + 150)
		count[id][3]=1
		SaveData(id)
	 }
      }
      case 2:{
         if (count[id][4]) // change 1 to your max purchase per map
         {
            ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per map")
         } else{
		zp_set_user_exp(id, zp_get_user_exp(id) + 250)
		count[id][4]=1
		SaveData(id)
	 }
      }
      case 3:{
         if (count[id][0]) ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per round.")
         else{
		set_user_health(id, get_user_health(id) + 250)
		count[id][0]=1
	 }
      }
      case 4:{
         if (count[id][1]) ChatColor(id, "!y[!gDarkCSO!y] You can buy this item only 1 times per round")
         else{
		set_user_armor(id, get_user_armor(id) + 150)
		count[id][1]=1
	 }
      }        
   }
   menu_destroy( menu );
   return PLUGIN_HANDLED;
}

stock SaveData(const id){
	new nick[33],string[45]
	formatex(string,charsmax(string),"%s %d %d %d",mapname,count[id][2],count[id][3],count[id][4])
	nvault_set( iVaultHandle , nick , string );
}
stock LoadData(const id){
	new nick[33],szDataString[45];
	get_user_name(id,nick,charsmax(nick))
	if(nvault_get( iVaultHandle , nick , szDataString , charsmax( szDataString ) )){
		new szcount[3],szmapname[35]
		parse(szDataString,szmapname,charsmax(szmapname),szcount[0],charsmax(szcount[]),szcount[1],charsmax(szcount[]),szcount[2],charsmax(szcount[]))
		if(equali(szmapname,mapname)){
			count[id][2]=str_to_num(szcount[0])
			count[id][3]=str_to_num(szcount[1])
			count[id][4]=str_to_num(szcount[2])
		}else{
			count[id][2]=count[id][3]=count[id][4]=0
			nvault_remove(iVaultHandle,nick)
		}
	}
}

// Stock: ChatColor! nu i bun drc da mna csf
stock ChatColor(const id, const input[], any:...){
   new count = 1, players[32]
   static msg[191];vformat(msg, 190, input, 3)
   
   replace_all(msg, 190, "!g", "^4") // Green Color
   replace_all(msg, 190, "!y", "^1") // Default Color
   replace_all(msg, 190, "!t", "^3") // Team Color
   replace_all(msg, 190, "!t2", "^0") // Team2 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();
         }
      }
}

Like, share and enjoy!
@citatememorabile
Image
User avatar
L E V I N
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 3347
Joined: 24 Aug 2011, 11:24
Detinator Steam: Da
CS Status:
Detinator server CS: ☯∴
SteamID: riseofevo
Reputatie: Scripter eXtreamCS
Nume anterior: Adryyy
Location: ҳ̸Ҳ̸ҳ
Discord: Levin#0061
Has thanked: 40 times
Been thanked: 511 times
Contact:

16 Jan 2022, 21:09

mai bine rezolvați faza cu clasa .content(line-break: anywhere;) din post și scoateți de tot bb-code pentru 'sursa' că e mai de ***
ÎNAINTE DE F12
Image
DUPĂ F12(adăugare line-break)
Image
Faceți cerere bine detaliată aici și respectând modelul dacă vreți ajutor.
Nu-mi mai dați add doar pentru a mă avea în lista de prieteni.
Dacă te ajut, și mă ignori/etc > te adaug la lista de „ignore”.
Aveți grijă la cei ce încearcă să mă copieze sau să dea drept mine..Puteți lua legătura cu mine(STEAM sau PM) dacă aveți o problemă/nelămurire în acest caz! (am cont doar aici!!)
În cazul în care utilizați ceva din addonsurile postate de mine aici, e bine să fiți la curent cu modificările aduse unor plugine, aici, iar dacă sunt ceva probleme sau aveți dvs. probleme nu ezitați să luați legătura cu mine. Actualizarea unor coduri nu se va posta la actual, doar dacă se găsește ceva critic/urgent de remediat, fiind coduri vechi, iar unele refăcute recent. NU MAI OFER SUPORT PENTRU ELE!(doar dacă nu e ceva critic/plătit)
* Nume pe cs1.6: eVoLuTiOn \ Nume vechi: eVo
* Atelierul meu - anunturi/lev-shop-t370037.html
Post Reply

Return to “Modificari pluginuri”

  • Information