Cerere plugin Money [rezolvat!]

Categoria cu cereri de pluginuri si nu numai.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

Forum rules
Accesează link-ul pentru a putea vedea regulile forumului

Daca doriti sa vi se modifice un plugin, va rugam postati aici .
Post Reply
XerD
Membru, skill 0
Membru, skill 0
Posts: 70
Joined: 11 Jan 2014, 20:14
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 12 times
Contact:

03 Feb 2014, 11:18

  • Nickname:
Xerd
  • Numele pluginului cerut:
Nu stiu sigur cum amx_give_money , amx_take_money
  • Descriere plugin cerut:
amx_give_money nume suma = da bani unui jucator
amx_take_money nume suma = retrage banii unui jucator
  • Alte informatii:
Nu doresc amx_super ... doar asta cu money , Multumesc .
Last edited by RedForce on 03 Feb 2014, 15:00, edited 2 times in total.
Reason: xSpRyTex: Redeschis ! Greseala mea, imi cer scuze | RedForce: [rezolvat!]
| Afiseaza codul
Image
Forum: www.cstopz.ro


Ce contine serverul ?
Sistem de Vieti - Magic Word ;
Shop - Pe bany ;
V.I.P - 3 Euro (4 EVER)
1000FPS ;
700Gravitate ;
LJSTATS - CTs si Ts ;
Skin - Cutit Personalzat DrX;
RESTU DESCOPERITI SINGUREI
RoyalServer
User avatar
RedForce
Fost moderator
Fost moderator
Posts: 1478
Joined: 17 Sep 2007, 18:20
Detinator Steam: Da
SteamID: redforcex
Reputatie: Fost moderator
Membru Club eXtreamCS (2 luni)
0.1/3
Location: Calea Moşilor, Bucureşti
Has thanked: 353 times
Been thanked: 135 times

03 Feb 2014, 11:59

Salut, încearcă asta:
| Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#include <colorchat>
#include <cstrike>
#include <fakemeta>

#define PLUGIN_VERSION		"1.0"

#define ADMIN_ACCESS		ADMIN_RCON

#define MIN_MONEY 	        1		// limita minima la bani
#define MAX_MONEY 	        16000	        // limita maxima la bani

#if cellbits == 32
const OFFSET_CSTEAMS = 114
#else
const OFFSET_CSTEAMS = 139
#endif

const OFFSET_LINUX = 5

// CS Teams
enum
{
	CS_TEAM_UNASSIGNED = 0,
	CS_TEAM_T,
	CS_TEAM_CT,
	CS_TEAM_SPECTATOR
}

new cvar_tag;
new gMaxPlayers;

new const bars[] = "/";

new command[][] =
{
	"/setmoney",
	"/givemoney",
	"/takemoney"
};

new Caccess[] =
{
	ADMIN_ACCESS,
	ADMIN_ACCESS,
         ADMIN_ACCESS
};

public plugin_init() {
	register_plugin("multimoney", PLUGIN_VERSION, "RedForce")
	
	register_clcmd ("say", "hook_say");
	
	register_concmd("amx_setmoney", "cmdSetMoney", ADMIN_ACCESS, "<nume/@CT/@T/@ALL> <money>");
	register_concmd("amx_givemoney", "cmdGiveMoney", ADMIN_ACCESS, "<nume/@CT/@T/@ALL> <money>");
	register_concmd("amx_takemoney", "cmdTakeMoney", ADMIN_ACCESS, "<nume/@CT/@T/@ALL> <money>");

	cvar_tag = register_cvar("money_tag","[AMXX]:");
	gMaxPlayers = get_maxplayers();
}

public hook_say(index)
{
        static arg[192], command2[192];

        read_args(arg, charsmax (arg));
	
        if(!arg[0])
        return PLUGIN_CONTINUE;

        remove_quotes(arg[0]);
	
        for(new x; x < sizeof command; x++)
        {
           if(equal(arg, command[x], strlen(command[x])))
           {
              if(get_user_flags(index) & Caccess[x])
              {

                 replace(arg, charsmax(arg), bars, "");
                 formatex(command2, charsmax(command2), "amx_%s", arg);
                 client_cmd(index, command2);

              }	

              break;

           }
        }
	
        return PLUGIN_CONTINUE;
}

/* SetMoney */
public cmdSetMoney(id, level, cid)
{
	if(!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}
	
	new szArg[32], szMoney[6], money

	read_argv(1, szArg, charsmax(szArg))
	read_argv(2, szMoney, charsmax(szMoney))
	
	new tag[32];
	new gTag = get_pcvar_string(cvar_tag,tag,31);
	
	new szAdminName[40];
	get_user_name(id, szAdminName, charsmax(szAdminName))
	money = str_to_num(szMoney)
	
	if(money < MIN_MONEY)
	{
		ColorChat(id, RED, "%s^x01 Nu ai voie sa pui o valoare mai mica de^x04 1^x01.", gTag)
		return PLUGIN_HANDLED;
	}
	
	if(money > MAX_MONEY)
	{
		ColorChat(id, RED, "%s^x01 Nu ai voie sa pui o valoare mai mare de^x04 16000^x01.", gTag)
		return PLUGIN_HANDLED;
	}

	if(szArg[0] == '@')
	{
		new index;

		if(equali(szArg[1], "ALL"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index))
				{
					cs_set_user_money(index, money)
					ColorChat(index, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a setat banii pe^x03 $%d^x01.", gTag, szAdminName, money)
				}
			}

			ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 a setat tuturor banii pe^x03 $%d^x01.", gTag, szAdminName, money)
		}
		
		else if(equali(szArg[1], "T"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index)
				&& fm_get_user_team(index) == CS_TEAM_T)
				{
					cs_set_user_money(index, money)
					ColorChat(index, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a setat banii pe^x03 $%d^x01.", gTag, szAdminName, money)
				}
			}
			
			ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 a setat echipei Terrorist $ la^x03 %d^x01.", gTag, szAdminName, money)
		}
		
		else if(equali(szArg[1], "CT"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index)
				&& fm_get_user_team(index) == CS_TEAM_CT)
				{
					cs_set_user_money(index, money)
					ColorChat(index, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a setat banii pe^x03 $%d^x01.", gTag, szAdminName, money)
				}
			}

			ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 a setat echipei CT banii pe^x03 $%d^x01.", gTag, szAdminName, money)
		}
	}
	
	else
	{
		new iTarget = cmd_target(id, szArg, CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE)

		if(!iTarget)
		{
			return PLUGIN_HANDLED;
		}
		
		new szTargetName[40];	
		get_user_name(iTarget, szTargetName, charsmax(szTargetName))
		
		cs_set_user_money(iTarget, money)

		ColorChat(iTarget, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a setat banii pe^x03 $%d^x01.", gTag, szAdminName, money)
		ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 i-a setat lui^x04 %s^x01 banii pe^x03 $%d^x01.", gTag, szAdminName, szTargetName, money)
	}
		
	return PLUGIN_HANDLED;
}

/* GiveMoney */
public cmdGiveMoney(id, level, cid)
{
	if(!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}
	
	new szArg[32], szMoney[6], money

	read_argv(1, szArg, charsmax(szArg))
	read_argv(2, szMoney, charsmax(szMoney))
	
	new tag[32];
	new gTag = get_pcvar_string(cvar_tag,tag,31);
	
	new szAdminName[40];
	get_user_name(id, szAdminName, charsmax(szAdminName))
	money = str_to_num(szMoney)
	
	if(money < MIN_MONEY)
	{
		ColorChat(id, RED, "%s^x01 Nu ai voie sa pui o valoare mai mica de^x04 1^x01.", gTag)
		return PLUGIN_HANDLED;
	}
	
	if(money > MAX_MONEY)
	{
		ColorChat(id, RED, "%s^x01 Nu ai voie sa pui o valoare mai mare de^x04 16000^x01.", gTag)
		return PLUGIN_HANDLED;
	}

	if(szArg[0] == '@')
	{
		new index;

		if(equali(szArg[1], "ALL"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index))
				{
					if(cs_get_user_money(index) < MAX_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) + money)
						ColorChat(index, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a dat^x03 $%d^x01.", gTag, szAdminName, money)
					}
					else
					{
						cs_set_user_money(index, MAX_MONEY)
						ColorChat(index, RED, "%s^x01 Ai deja maximul de $.", gTag)
					}
				}
			}

			ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 a dat tuturor^x03 $%d^x01.", gTag, szAdminName, money)
		}
		
		else if(equali(szArg[1], "T"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index)
				&& fm_get_user_team(index) == CS_TEAM_T)
				{
					if(cs_get_user_money(index) < MAX_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) + money)
						ColorChat(index, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a dat^x03 $%d^x01.", gTag, szAdminName, money)
					}
					else
					{
						cs_set_user_money(index, MAX_MONEY)
						ColorChat(index, RED, "%s^x01 Ai deja maximul de $.", gTag)
					}
				}
			}
			
			ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 a dat echipei Terrorist^x03 $%d^x01.", gTag, szAdminName, money)
		}
		
		else if(equali(szArg[1], "CT"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index)
				&& fm_get_user_team(index) == CS_TEAM_CT)
				{
					if(cs_get_user_money(index) < MAX_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) + money)
						ColorChat(index, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a dat^x03 $%d^x01.", gTag, szAdminName, money)
					}
					else
					{
						cs_set_user_money(index, MAX_MONEY)
						ColorChat(index, RED, "%s^x01 Ai deja maximul de $.", gTag)
					}
				}
			}

			ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 a dat echipei Counter-Terrorist^x03 $%d^x01.", gTag, szAdminName, money)
		}
	}
	
	else
	{
		new iTarget = cmd_target(id, szArg, CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE)

		if(!iTarget)
		{
			return PLUGIN_HANDLED;
		}
		
		new szTargetName[40];	
		get_user_name(iTarget, szTargetName, charsmax(szTargetName))
		
		if(cs_get_user_money(iTarget) < MAX_MONEY)
		{
			cs_set_user_money(iTarget, cs_get_user_money(iTarget) + money)
			ColorChat(iTarget, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a dat^x03 $%d^x01.", gTag, szAdminName, money)
		}
		else
		{
			cs_set_user_money(iTarget, MAX_MONEY)
			ColorChat(iTarget, RED, "%s^x01 Ai deja maximul de $.", gTag)
		}

		ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 i-a dat lui^x04 %s^x03 $%d^x01.", gTag, szAdminName, szTargetName, money)
	}
		
	return PLUGIN_HANDLED;
}

/* TakeMoney */
public cmdTakeMoney(id, level, cid)
{
	if(!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}
	
	new szArg[32], szMoney[6], money

	read_argv(1, szArg, charsmax(szArg))
	read_argv(2, szMoney, charsmax(szMoney))
	
	new tag[32];
	new gTag = get_pcvar_string(cvar_tag,tag,31);
	
	new szAdminName[40];
	get_user_name(id, szAdminName, charsmax(szAdminName))
	money = str_to_num(szMoney)
	
	if(money < MIN_MONEY)
	{
		ColorChat(id, RED, "%s^x01 Nu ai voie sa pui o valoare mai mica de^x04 1^x01.", gTag)
		return PLUGIN_HANDLED;
	}
	
	if(money > MAX_MONEY)
	{
		ColorChat(id, RED, "%s^x01 Nu ai voie sa pui o valoare mai mare de^x04 16000^x01.", gTag)
		return PLUGIN_HANDLED;
	}

	if(szArg[0] == '@')
	{
		new index;

		if(equali(szArg[1], "ALL"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index))
				{
					if(cs_get_user_money(index) > MIN_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) - money)
						ColorChat(index, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a redus banii cu^x03 $%d^x01.", gTag, szAdminName, money)
					}
					else
					{
						cs_set_user_money(index, MIN_MONEY)
						ColorChat(index, RED, "%s^x01 Ai deja minimul de $.", gTag)
					}
				}
			}

			ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 a luat tuturor^x03 %d^x01$.", gTag, szAdminName, money)
		}
		
		else if(equali(szArg[1], "T"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index)
				&& fm_get_user_team(index) == CS_TEAM_T)
				{
					if(cs_get_user_money(index) > MIN_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) - money)
						ColorChat(index, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a redus banii cu^x03 $%d^x01.", gTag, szAdminName, money)
					}
					else
					{
						cs_set_user_money(index, MIN_MONEY)
						ColorChat(index, RED, "%s^x01 Ai deja minimul de $.", gTag)
					}
				}
			}
			
			ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 a redus banii echipei Terrorist cu^x03 $%d^x01.", gTag, szAdminName, money)
		}
		
		else if(equali(szArg[1], "CT"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index)
				&& fm_get_user_team(index) == CS_TEAM_CT)
				{
					if(cs_get_user_money(index) > MIN_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) - money)
						ColorChat(index, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a redus banii cu^x03 $%d^x01.", gTag, szAdminName, money)
					}
					else
					{
						cs_set_user_money(index, MIN_MONEY)
						ColorChat(index, RED, "%s^x01 Ai deja minimul de $.", gTag)
					}
				}
			}

			ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 a redus banii echipei CT cu^x03 $%d^x01.", gTag, szAdminName, money)
		}
	}
	
	else
	{
		new iTarget = cmd_target(id, szArg, CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE)

		if(!iTarget)
		{
			return PLUGIN_HANDLED;
		}
		
		new szTargetName[40];	
		get_user_name(iTarget, szTargetName, charsmax(szTargetName))
		
		if(cs_get_user_money(iTarget) > MIN_MONEY)
		{
			cs_set_user_money(iTarget, cs_get_user_money(iTarget) - money)
			ColorChat(iTarget, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a redus banii cu^x03 $%d^x01.", gTag, szAdminName, money)
		}
		else
		{
			cs_set_user_money(iTarget, MIN_MONEY)
			ColorChat(iTarget, RED, "%s^x01 Ai deja minimul de $.", gTag)
		}

		ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 i-a redus banii lui^x04 %s^x01 cu^x03 $%d^x01.", gTag, szAdminName, szTargetName, money)
	}
		
	return PLUGIN_HANDLED;
}

// Pentru eventualele erori in log
stock fm_get_user_team(id)
{
	return get_pdata_int(id, OFFSET_CSTEAMS, OFFSET_LINUX);
}
Şi bagă în include: colorchat.inc (altfel nu se compilează)

Ai următoarele comenzi:
amx_setmoney <nume/@CT/@T/@ALL> <bani>
amx_givemoney <nume/@CT/@T/@ALL> <bani>
amx_takemoney <nume/@CT/@T/@ALL> <bani>
+
cvar-ul "money_tag" care trebuie să-l bagi în amxx.cfg şi pui tu ce tag vrei, default e aşa:

Code: Select all

money_tag "[AMXX]:"
Dacă vrei fără culori bagi repede reply aici.
P.S.: Ţi-am făcut să meargă şi în chat comenzile: /setmoney, /givemoney, /takemoney

Nu l-am testat.
XerD
Membru, skill 0
Membru, skill 0
Posts: 70
Joined: 11 Jan 2014, 20:14
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 12 times
Contact:

03 Feb 2014, 12:34

Poti sterge /setmoney cele din chat si din consola amx_setmoney sa lasi doar give si take ?
| Afiseaza codul
Image
Forum: www.cstopz.ro


Ce contine serverul ?
Sistem de Vieti - Magic Word ;
Shop - Pe bany ;
V.I.P - 3 Euro (4 EVER)
1000FPS ;
700Gravitate ;
LJSTATS - CTs si Ts ;
Skin - Cutit Personalzat DrX;
RESTU DESCOPERITI SINGUREI
User avatar
RedForce
Fost moderator
Fost moderator
Posts: 1478
Joined: 17 Sep 2007, 18:20
Detinator Steam: Da
SteamID: redforcex
Reputatie: Fost moderator
Membru Club eXtreamCS (2 luni)
0.1/3
Location: Calea Moşilor, Bucureşti
Has thanked: 353 times
Been thanked: 135 times

03 Feb 2014, 12:44

? | Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#include <cstrike>
#include <fakemeta>

#define PLUGIN_VERSION		"1.1"

#define ADMIN_ACCESS		ADMIN_RCON

#define MIN_MONEY 	        1		// limita minima la bani
#define MAX_MONEY 	        16000	        // limita maxima la bani

#if cellbits == 32
const OFFSET_CSTEAMS = 114
#else
const OFFSET_CSTEAMS = 139
#endif

const OFFSET_LINUX = 5

// CS Teams
enum
{
	CS_TEAM_UNASSIGNED = 0,
	CS_TEAM_T,
	CS_TEAM_CT,
	CS_TEAM_SPECTATOR
}

new gMaxPlayers;

new const bars[] = "/";

new command[][] =
{
	"/givemoney",
	"/takemoney"
};

new Caccess[] =
{
	ADMIN_ACCESS,
         ADMIN_ACCESS
};

public plugin_init() {
	register_plugin("multimoney", PLUGIN_VERSION, "RedForce")
	
	register_clcmd ("say", "hook_say");
	
	register_concmd("amx_givemoney", "cmdGiveMoney", ADMIN_ACCESS, "<nume/@CT/@T/@ALL> <money>");
	register_concmd("amx_takemoney", "cmdTakeMoney", ADMIN_ACCESS, "<nume/@CT/@T/@ALL> <money>");

	gMaxPlayers = get_maxplayers();
}

public hook_say(index)
{
        static arg[192], command2[192];

        read_args(arg, charsmax (arg));
	
        if(!arg[0])
        return PLUGIN_CONTINUE;

        remove_quotes(arg[0]);
	
        for(new x; x < sizeof command; x++)
        {
           if(equal(arg, command[x], strlen(command[x])))
           {
              if(get_user_flags(index) & Caccess[x])
              {

                 replace(arg, charsmax(arg), bars, "");
                 formatex(command2, charsmax(command2), "amx_%s", arg);
                 client_cmd(index, command2);

              }	

              break;

           }
        }
	
        return PLUGIN_CONTINUE;
}

/* GiveMoney */
public cmdGiveMoney(id, level, cid)
{
	if(!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}
	
	new szArg[32], szMoney[6], money

	read_argv(1, szArg, charsmax(szArg))
	read_argv(2, szMoney, charsmax(szMoney))
	
	new szAdminName[40];
	get_user_name(id, szAdminName, charsmax(szAdminName))
	money = str_to_num(szMoney)
	
	if(money < MIN_MONEY)
	{
		return PLUGIN_HANDLED;
	}
	
	if(money > MAX_MONEY)
	{
		return PLUGIN_HANDLED;
	}

	if(szArg[0] == '@')
	{
		new index;

		if(equali(szArg[1], "ALL"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index))
				{
					if(cs_get_user_money(index) < MAX_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) + money)
					}
					else
					{
						cs_set_user_money(index, MAX_MONEY)
					}
				}
			}
		}
		
		else if(equali(szArg[1], "T"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index)
				&& fm_get_user_team(index) == CS_TEAM_T)
				{
					if(cs_get_user_money(index) < MAX_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) + money)
					}
					else
					{
						cs_set_user_money(index, MAX_MONEY)
					}
				}
			}
		}
		
		else if(equali(szArg[1], "CT"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index)
				&& fm_get_user_team(index) == CS_TEAM_CT)
				{
					if(cs_get_user_money(index) < MAX_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) + money)
					}
					else
					{
						cs_set_user_money(index, MAX_MONEY)
					}
				}
			}
		}
	}
	
	else
	{
		new iTarget = cmd_target(id, szArg, CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE)

		if(!iTarget)
		{
			return PLUGIN_HANDLED;
		}
		
		new szTargetName[40];	
		get_user_name(iTarget, szTargetName, charsmax(szTargetName))
		
		if(cs_get_user_money(iTarget) < MAX_MONEY)
		{
			cs_set_user_money(iTarget, cs_get_user_money(iTarget) + money)
		}
		else
		{
			cs_set_user_money(iTarget, MAX_MONEY)
		}
	}
		
	return PLUGIN_HANDLED;
}

/* TakeMoney */
public cmdTakeMoney(id, level, cid)
{
	if(!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}
	
	new szArg[32], szMoney[6], money

	read_argv(1, szArg, charsmax(szArg))
	read_argv(2, szMoney, charsmax(szMoney))
	
	new szAdminName[40];
	get_user_name(id, szAdminName, charsmax(szAdminName))
	money = str_to_num(szMoney)
	
	if(money < MIN_MONEY)
	{
		return PLUGIN_HANDLED;
	}
	
	if(money > MAX_MONEY)
	{
		return PLUGIN_HANDLED;
	}

	if(szArg[0] == '@')
	{
		new index;

		if(equali(szArg[1], "ALL"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index))
				{
					if(cs_get_user_money(index) > MIN_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) - money)
					}
					else
					{
						cs_set_user_money(index, MIN_MONEY)
					}
				}
			}
		}
		
		else if(equali(szArg[1], "T"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index)
				&& fm_get_user_team(index) == CS_TEAM_T)
				{
					if(cs_get_user_money(index) > MIN_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) - money)
					}
					else
					{
						cs_set_user_money(index, MIN_MONEY)
					}
				}
			}
		}
		
		else if(equali(szArg[1], "CT"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index)
				&& fm_get_user_team(index) == CS_TEAM_CT)
				{
					if(cs_get_user_money(index) > MIN_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) - money)
					}
					else
					{
						cs_set_user_money(index, MIN_MONEY)
					}
				}
			}
		}
	}
	
	else
	{
		new iTarget = cmd_target(id, szArg, CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE)

		if(!iTarget)
		{
			return PLUGIN_HANDLED;
		}
		
		new szTargetName[40];	
		get_user_name(iTarget, szTargetName, charsmax(szTargetName))
		
		if(cs_get_user_money(iTarget) > MIN_MONEY)
		{
			cs_set_user_money(iTarget, cs_get_user_money(iTarget) - money)
		}
		else
		{
			cs_set_user_money(iTarget, MIN_MONEY)
		}
	}
		
	return PLUGIN_HANDLED;
}

// Pentru eventualele erori in log si excluderea modulului cstrike.
stock fm_get_user_team(id)
{
	return get_pdata_int(id, OFFSET_CSTEAMS, OFFSET_LINUX);
}
XerD
Membru, skill 0
Membru, skill 0
Posts: 70
Joined: 11 Jan 2014, 20:14
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 12 times
Contact:

03 Feb 2014, 13:06

De dat da si ia dar mesajele nu apar :P
| Afiseaza codul
Image
Forum: www.cstopz.ro


Ce contine serverul ?
Sistem de Vieti - Magic Word ;
Shop - Pe bany ;
V.I.P - 3 Euro (4 EVER)
1000FPS ;
700Gravitate ;
LJSTATS - CTs si Ts ;
Skin - Cutit Personalzat DrX;
RESTU DESCOPERITI SINGUREI
User avatar
RedForce
Fost moderator
Fost moderator
Posts: 1478
Joined: 17 Sep 2007, 18:20
Detinator Steam: Da
SteamID: redforcex
Reputatie: Fost moderator
Membru Club eXtreamCS (2 luni)
0.1/3
Location: Calea Moşilor, Bucureşti
Has thanked: 353 times
Been thanked: 135 times

03 Feb 2014, 13:16

XerD wrote:De dat da si ia dar mesajele nu apar :P
Din reply-ul tău de mai sus am înţeles că vrei fără mesaje, fii mai coerent data viitoare. :P
poftim | Afiseaza codul
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#include <colorchat>
#include <cstrike>
#include <fakemeta>

#define PLUGIN_VERSION		"1.2"

#define ADMIN_ACCESS		ADMIN_RCON

#define MIN_MONEY 	        1		// limita minima la bani
#define MAX_MONEY 	        16000	        // limita maxima la bani

#if cellbits == 32
const OFFSET_CSTEAMS = 114
#else
const OFFSET_CSTEAMS = 139
#endif

const OFFSET_LINUX = 5

// CS Teams
enum
{
	CS_TEAM_UNASSIGNED = 0,
	CS_TEAM_T,
	CS_TEAM_CT,
	CS_TEAM_SPECTATOR
}

new cvar_tag;
new gMaxPlayers;

new const bars[] = "/";

new command[][] =
{
	"/givemoney",
	"/takemoney"
};

new Caccess[] =
{
	ADMIN_ACCESS,
         ADMIN_ACCESS
};

public plugin_init() {
	register_plugin("multimoney", PLUGIN_VERSION, "RedForce")
	
	register_clcmd ("say", "hook_say");
	
	register_concmd("amx_givemoney", "cmdGiveMoney", ADMIN_ACCESS, "<nume/@CT/@T/@ALL> <money>");
	register_concmd("amx_takemoney", "cmdTakeMoney", ADMIN_ACCESS, "<nume/@CT/@T/@ALL> <money>");

	cvar_tag = register_cvar("money_tag","[AMXX]:");
	gMaxPlayers = get_maxplayers();
}

public hook_say(index)
{
        static arg[192], command2[192];

        read_args(arg, charsmax (arg));
	
        if(!arg[0])
        return PLUGIN_CONTINUE;

        remove_quotes(arg[0]);
	
        for(new x; x < sizeof command; x++)
        {
           if(equal(arg, command[x], strlen(command[x])))
           {
              if(get_user_flags(index) & Caccess[x])
              {

                 replace(arg, charsmax(arg), bars, "");
                 formatex(command2, charsmax(command2), "amx_%s", arg);
                 client_cmd(index, command2);

              }	

              break;

           }
        }
	
        return PLUGIN_CONTINUE;
}

/* GiveMoney */
public cmdGiveMoney(id, level, cid)
{
	if(!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}
	
	new szArg[32], szMoney[6], money

	read_argv(1, szArg, charsmax(szArg))
	read_argv(2, szMoney, charsmax(szMoney))
	
	new tag[32];
	new gTag = get_pcvar_string(cvar_tag,tag,31);
	
	new szAdminName[40];
	get_user_name(id, szAdminName, charsmax(szAdminName))
	money = str_to_num(szMoney)
	
	if(money < MIN_MONEY)
	{
		ColorChat(id, RED, "%s^x01 Nu ai voie sa pui o valoare mai mica de^x04 1^x01.", gTag)
		return PLUGIN_HANDLED;
	}
	
	if(money > MAX_MONEY)
	{
		ColorChat(id, RED, "%s^x01 Nu ai voie sa pui o valoare mai mare de^x04 16000^x01.", gTag)
		return PLUGIN_HANDLED;
	}

	if(szArg[0] == '@')
	{
		new index;

		if(equali(szArg[1], "ALL"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index))
				{
					if(cs_get_user_money(index) < MAX_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) + money)
						ColorChat(index, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a dat^x03 $%d^x01.", gTag, szAdminName, money)
					}
					else
					{
						cs_set_user_money(index, MAX_MONEY)
						ColorChat(index, RED, "%s^x01 Ai deja maximul de $.", gTag)
					}
				}
			}

			ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 a dat tuturor^x03 $%d^x01.", gTag, szAdminName, money)
		}
		
		else if(equali(szArg[1], "T"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index)
				&& fm_get_user_team(index) == CS_TEAM_T)
				{
					if(cs_get_user_money(index) < MAX_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) + money)
						ColorChat(index, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a dat^x03 $%d^x01.", gTag, szAdminName, money)
					}
					else
					{
						cs_set_user_money(index, MAX_MONEY)
						ColorChat(index, RED, "%s^x01 Ai deja maximul de $.", gTag)
					}
				}
			}
			
			ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 a dat echipei Terrorist^x03 $%d^x01.", gTag, szAdminName, money)
		}
		
		else if(equali(szArg[1], "CT"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index)
				&& fm_get_user_team(index) == CS_TEAM_CT)
				{
					if(cs_get_user_money(index) < MAX_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) + money)
						ColorChat(index, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a dat^x03 $%d^x01.", gTag, szAdminName, money)
					}
					else
					{
						cs_set_user_money(index, MAX_MONEY)
						ColorChat(index, RED, "%s^x01 Ai deja maximul de $.", gTag)
					}
				}
			}

			ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 a dat echipei Counter-Terrorist^x03 $%d^x01.", gTag, szAdminName, money)
		}
	}
	
	else
	{
		new iTarget = cmd_target(id, szArg, CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE)

		if(!iTarget)
		{
			return PLUGIN_HANDLED;
		}
		
		new szTargetName[40];	
		get_user_name(iTarget, szTargetName, charsmax(szTargetName))
		
		if(cs_get_user_money(iTarget) < MAX_MONEY)
		{
			cs_set_user_money(iTarget, cs_get_user_money(iTarget) + money)
			ColorChat(iTarget, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a dat^x03 $%d^x01.", gTag, szAdminName, money)
		}
		else
		{
			cs_set_user_money(iTarget, MAX_MONEY)
			ColorChat(iTarget, RED, "%s^x01 Ai deja maximul de $.", gTag)
		}

		ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 i-a dat lui^x04 %s^x03 $%d^x01.", gTag, szAdminName, szTargetName, money)
	}
		
	return PLUGIN_HANDLED;
}

/* TakeMoney */
public cmdTakeMoney(id, level, cid)
{
	if(!cmd_access(id, level, cid, 2))
	{
		return PLUGIN_HANDLED;
	}
	
	new szArg[32], szMoney[6], money

	read_argv(1, szArg, charsmax(szArg))
	read_argv(2, szMoney, charsmax(szMoney))
	
	new tag[32];
	new gTag = get_pcvar_string(cvar_tag,tag,31);
	
	new szAdminName[40];
	get_user_name(id, szAdminName, charsmax(szAdminName))
	money = str_to_num(szMoney)
	
	if(money < MIN_MONEY)
	{
		ColorChat(id, RED, "%s^x01 Nu ai voie sa pui o valoare mai mica de^x04 1^x01.", gTag)
		return PLUGIN_HANDLED;
	}
	
	if(money > MAX_MONEY)
	{
		ColorChat(id, RED, "%s^x01 Nu ai voie sa pui o valoare mai mare de^x04 16000^x01.", gTag)
		return PLUGIN_HANDLED;
	}

	if(szArg[0] == '@')
	{
		new index;

		if(equali(szArg[1], "ALL"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index))
				{
					if(cs_get_user_money(index) > MIN_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) - money)
						ColorChat(index, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a redus banii cu^x03 $%d^x01.", gTag, szAdminName, money)
					}
					else
					{
						cs_set_user_money(index, MIN_MONEY)
						ColorChat(index, RED, "%s^x01 Ai deja minimul de $.", gTag)
					}
				}
			}

			ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 a luat tuturor^x03 %d^x01$.", gTag, szAdminName, money)
		}
		
		else if(equali(szArg[1], "T"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index)
				&& fm_get_user_team(index) == CS_TEAM_T)
				{
					if(cs_get_user_money(index) > MIN_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) - money)
						ColorChat(index, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a redus banii cu^x03 $%d^x01.", gTag, szAdminName, money)
					}
					else
					{
						cs_set_user_money(index, MIN_MONEY)
						ColorChat(index, RED, "%s^x01 Ai deja minimul de $.", gTag)
					}
				}
			}
			
			ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 a redus banii echipei Terrorist cu^x03 $%d^x01.", gTag, szAdminName, money)
		}
		
		else if(equali(szArg[1], "CT"))
		{
			for(index = 1; index <= gMaxPlayers; index++)
			{
				if(is_user_alive(index) 
				&& is_user_connected(index) 
				&& !is_user_bot(index)
				&& fm_get_user_team(index) == CS_TEAM_CT)
				{
					if(cs_get_user_money(index) > MIN_MONEY)
					{
						cs_set_user_money(index, cs_get_user_money(index) - money)
						ColorChat(index, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a redus banii cu^x03 $%d^x01.", gTag, szAdminName, money)
					}
					else
					{
						cs_set_user_money(index, MIN_MONEY)
						ColorChat(index, RED, "%s^x01 Ai deja minimul de $.", gTag)
					}
				}
			}

			ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 a redus banii echipei CT cu^x03 $%d^x01.", gTag, szAdminName, money)
		}
	}
	
	else
	{
		new iTarget = cmd_target(id, szArg, CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE)

		if(!iTarget)
		{
			return PLUGIN_HANDLED;
		}
		
		new szTargetName[40];	
		get_user_name(iTarget, szTargetName, charsmax(szTargetName))
		
		if(cs_get_user_money(iTarget) > MIN_MONEY)
		{
			cs_set_user_money(iTarget, cs_get_user_money(iTarget) - money)
			ColorChat(iTarget, RED, "%s^x01 Administratorul^x04 %s^x01 ti-a redus banii cu^x03 $%d^x01.", gTag, szAdminName, money)
		}
		else
		{
			cs_set_user_money(iTarget, MIN_MONEY)
			ColorChat(iTarget, RED, "%s^x01 Ai deja minimul de $.", gTag)
		}

		ColorChat(0, RED, "%s^x01 Administratorul^x04 %s^x01 i-a redus banii lui^x04 %s^x01 cu^x03 $%d^x01.", gTag, szAdminName, szTargetName, money)
	}
		
	return PLUGIN_HANDLED;
}

// Pentru eventualele erori in log
stock fm_get_user_team(id)
{
	return get_pdata_int(id, OFFSET_CSTEAMS, OFFSET_LINUX);
}
#Vali
Fost moderator
Fost moderator
Posts: 2611
Joined: 24 Jan 2012, 11:00
Detinator Steam: Da
SteamID: id/spryt3
Reputatie: Fost Moderator
Fost Scripter eXtreamCS.com
1.2 / 3
Location: root
Has thanked: 81 times
Been thanked: 144 times
Contact:

03 Feb 2014, 13:17

XerD wrote:De dat da si ia dar mesajele nu apar :P
Ce mesaje vrei?
XerD
Membru, skill 0
Membru, skill 0
Posts: 70
Joined: 11 Jan 2014, 20:14
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 12 times
Contact:

03 Feb 2014, 13:21

MErsi probez si dau edit .

P.S. - Daca mati putea ajuta si aici , am nevoie urgenta http://www.extreamcs.com/forum/modifica ... 33181.html
| Afiseaza codul
Image
Forum: www.cstopz.ro


Ce contine serverul ?
Sistem de Vieti - Magic Word ;
Shop - Pe bany ;
V.I.P - 3 Euro (4 EVER)
1000FPS ;
700Gravitate ;
LJSTATS - CTs si Ts ;
Skin - Cutit Personalzat DrX;
RESTU DESCOPERITI SINGUREI
#Vali
Fost moderator
Fost moderator
Posts: 2611
Joined: 24 Jan 2012, 11:00
Detinator Steam: Da
SteamID: id/spryt3
Reputatie: Fost Moderator
Fost Scripter eXtreamCS.com
1.2 / 3
Location: root
Has thanked: 81 times
Been thanked: 144 times
Contact:

03 Feb 2014, 13:34

Inchis!

Regulamentul:

Code: Select all

1.1. Aveti dreptul numai la o cerere deschisa in care sa cereti maxim un plugin.
XerD
Membru, skill 0
Membru, skill 0
Posts: 70
Joined: 11 Jan 2014, 20:14
Detinator Steam: Nu
CS Status: Citesc forumul eXtreamCS.com...!
Has thanked: 12 times
Contact:

03 Feb 2014, 14:51

SA rezolvat , multumesc
| Afiseaza codul
Image
Forum: www.cstopz.ro


Ce contine serverul ?
Sistem de Vieti - Magic Word ;
Shop - Pe bany ;
V.I.P - 3 Euro (4 EVER)
1000FPS ;
700Gravitate ;
LJSTATS - CTs si Ts ;
Skin - Cutit Personalzat DrX;
RESTU DESCOPERITI SINGUREI
Post Reply

Return to “Cereri”

  • Information