Modificare plugin - depozit

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
User avatar
s0uNNNdx
Membru, skill +1
Membru, skill +1
Posts: 227
Joined: 28 Jul 2013, 22:30
Detinator Steam: Da
CS Status: Joc pe fun.free-play.ro
Detinator server CS: Fun.Free-Play.Ro
Location: Prahova
Has thanked: 32 times
Contact:

07 Dec 2013, 22:28

Salut !
Va rog rezolvati bugul de la sursa de mai joc .. nu il pot compila .

Image
| Afiseaza codul
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <csx>
#include <dhudmessage>
#include <fakemeta>
#include <nvault>

#define PLUGIN  "Depozit Mooney"
#define AUTHOR  "Aragon*"
#define VERSION "1.0"

enum (+= 100)
{
	TASK_MESAJHUD
}

#define ID_HUD (taskid - TASK_MESAJHUD)

new PlayerCredits[10000], retrase[33];
new Vault, SymbolsName, savepoints;

public plugin_init() {         
	register_plugin(PLUGIN,VERSION,AUTHOR)
	register_forward(FM_ClientUserInfoChanged, "ChangeName");
	SymbolsName = register_cvar("fr_name_symbols", "`"); 	//| Symbols Name Restricted |//	biohazardshopmod = register_cvar("bh_shop_mode", "1");		//| Money/Points 0 Money Tax -> 1 Points Tax |//
	savepoints = register_cvar("fr_save_points", "1");	//| Save Points Mode 0 Disable -> 1 Name -> 2 IP -> 3 SteamID |//
	register_clcmd("depozit","Depozit")
	register_logevent("round_start", 2, "1=Round_Start")
	register_clcmd("say /depozit","Depozit")
	register_clcmd("say_team /depozit","Depozit")
	register_clcmd("retrage","Retrage")
	register_clcmd("say /retrage","Retrage")
	register_clcmd("say_team /retrage","Retrage")
	register_clcmd("credite","Show_Credits")
	register_clcmd("credite","Show_Credits")
	register_clcmd("say /credite","Show_Credits")
	register_clcmd("say /credite","Show_Credits")
	register_clcmd("say_team /credite","Show_Credits")
	register_clcmd("say_team /credite","Show_Credits")
	register_concmd("amx_give_credits", "Give_Credits", ADMIN_IMMUNITY, "Name/@T/@CT/@All -> Amount");
	register_concmd("amx_reset_credits", "Reset_Credits", ADMIN_IMMUNITY, "Name/@T/@CT/@All");
	}
public plugin_natives() {
	register_native("get_user_credits", "get_user_credits", 1);
	register_native("set_user_credits", "set_user_credits", 1);
}
public set_user_credits(id, credits) {
	PlayerCredits[id] = credits;
	SaveCredits(id)
	}
public get_user_credits(id) {
	return PlayerCredits[id]
	}
public client_putinserver(id) {
	LoadCredits(id)
	retrase[id] = 0
	set_task(180.0, "give_credits", id, _, _, "b")
	set_task(1.0, "MesajHUD", id+TASK_MESAJHUD, _, _, "b")
	}
public client_authorized(id) {
	LoadCredits(id)
	}
public client_connected(id) {
	LoadCredits(id)
	}
public client_disconnect(id) {
	SaveCredits(id)
	remove_task(id)
	retrase[id] = 0
	remove_task(id+TASK_MESAJHUD)
	}
	
public give_credits(id)
{
	ColorChat(id, "^x03[FURIEN]^x04 Ai primit^x03 15 credite^x04 pentru ca ai jucat 5 minute.");
	ColorChat(id, "^x03[FURIEN]^x04 Joaca cat mai mult si acumulezi credite in prostie.");
	PlayerCredits[id] += 15
}

public bomb_planted(id)
{
	new nume[32];
	get_user_name(id, nume, 31)
	PlayerCredits[id] += 10
	ColorChat(0, "^x03[FURIEN]^x04 Pentru plantarea bombei,^x03 %s^x04 a primit 10 credite.", nume);
}

public bomb_explode(id)
{
	new nume[32];
	get_user_name(id, nume, 31)
	PlayerCredits[id] += 20
	ColorChat(0, "^x03[FURIEN]^x04 Pentru explodarea bombei,^x03 %s^x04 a primit 20 credite.", nume);
}

public bomb_defused(id)
{
	new nume[32];
	get_user_name(id, nume, 31)
	PlayerCredits[id] += 30
	ColorChat(0, "^x03[FURIEN]^x04 Pentru dezamorsarea bombei,^x03 %s^x04 a primit 30 credite.", nume);
}

public round_start()
{
	static id;
	for (id = 1; id <= get_maxplayers(); id++)
	{
		if(is_user_alive(id))
		{
			retrase[id] = 0
		}
	}
}

public MesajHUD(taskid)
{
	static id
	id = ID_HUD;
	
	if(!is_user_alive(id))
	{
		id = pev(id, pev_iuser2)
		
		if(!is_user_alive(id))
			return;
	}
	
	if(id != ID_HUD)
	{
		new nume[32];
		get_user_name(id, nume, 31)
		set_dhudmessage(200, 100, 150, 0.0, 0.52, 0, 6.0, 1.1, 0.0, 0.0)
		show_dhudmessage(ID_HUD, "%s^nViata: %d | Credite: %d", nume, pev(id, pev_health), PlayerCredits[id])
	}
	else
	{
		set_dhudmessage(0, 100, 250, 0.0, 0.885, 0, 6.0, 1.1, 0.0, 0.0)
		show_dhudmessage(ID_HUD, "^nViata: %d | Credite: %d", pev(ID_HUD, pev_health), PlayerCredits[id])
	}
}
	
//------| Change Name |------//
public ChangeName(id, buffer) {
	if(!is_user_connected(id))
	return FMRES_IGNORED;

	static Name[32], Val[32];
	get_user_name(id, Name, sizeof Name - 1);
	engfunc(EngFunc_InfoKeyValue, buffer, "name", Val, sizeof Val - 1);
	
	if(equal(Val, Name))
	return FMRES_IGNORED;
	
	set_task(0.2, "client_connect", id);
	return FMRES_SUPERCEDE;
	}
	
//------| Client connect |------//	
public client_connect(id) {
	static sName[32];
	get_user_name(id, sName, sizeof sName - 1);
	static sChars[32];
	get_pcvar_string(SymbolsName, sChars, sizeof sChars - 1);	
	for(new i = 0 ; i < strlen(sName) ; i++) {
	for(new j = 0 ; j < strlen(sChars) ; j++) {
	if(sName == sChars[j]) {
	server_cmd("kick #%d ^"Numele tau contine caractere nepermise.^"", get_user_userid(id));
	break;
	}
	else {
	LoadCredits(id);
	}
	}
	}
	}
	
public Depozit(id) {
	if(cs_get_user_team(id) == CS_TEAM_SPECTATOR) return PLUGIN_HANDLED;
	
	if(cs_get_user_money(id) == 16000) {
	ColorChat(id, "^x03[FURIEN]^x04 Ai depus^x03 $ 16000^x04 si ai primit^x03 un credit^x04.");
	PlayerCredits[id] += 1;
	cs_set_user_money(id, 0);
	}
	else {
	ColorChat(id, "^x03[FURIEN]^x04 Nu ai^x03 $ 16000^x04.");	
	}
	SaveCredits(id)
	return PLUGIN_HANDLED;
	}
	
public Retrage(id) 
{
	if(cs_get_user_team(id) == CS_TEAM_SPECTATOR)
		return PLUGIN_HANDLED;

	if(cs_get_user_money(id) == 16000) 
	{
		ColorChat(id, "^x03[FURIEN]^x04 Ai deja^x03 $ 16000^x04.");
	}
	else if(PlayerCredits[id]) 
	{
		if(retrase[id] < 3)
		{
			ColorChat(id, "^x03[FURIEN]^x04 Ai retras^x03 un credit^x04 si ai primit^x03 $ 16000^x04.");
			PlayerCredits[id] -= 1;
			cs_set_user_money(id, 16000);
			retrase[id]++
		}
		else
		{
			ColorChat(id, "^x03[FURIEN]^x04 Ai retras runda asta deja^x03 3 credite^x04. Incearca runda viitoare.");
		}
	}
	else 
	{
		ColorChat(id, "^x03[FURIEN]^x04 Ai nevoie de^x03 un credit^x04 pentru a retrage.");	
	}
	SaveCredits(id)
	return PLUGIN_HANDLED;
}
	
public Show_Credits(id) {
	set_hudmessage(0, 128, 0, 0.03, 0.86, 2, 6.0, 5.0);
	show_hudmessage(id, "Ai %d credite.", PlayerCredits[id]);
	ColorChat(id, "^x03[FURIEN]^x04 Ai^x03 %d^x04 credite.", PlayerCredits[id]);
	return PLUGIN_HANDLED;
	}
	
public Give_Credits(id, level, cid) {
	if(!cmd_access(id, level, cid, 2)) {
	return PLUGIN_HANDLED;
	}
	new arg[23], gplayers[32], num, i, players, name[32];
	get_user_name(id, name, 31);
	read_argv(1, arg, 23);
	new give_credits[5];
	read_argv(2, give_credits, charsmax(give_credits));
	new Credits = str_to_num(give_credits);
	if(equali(arg, "@T")) {
	get_players(gplayers, num, "e", "TERRORIST");
	for(i = 0; i < num; i++) {
	players = gplayers;
	if(!is_user_connected(players))
	continue;
	PlayerCredits[players] += Credits;
	SaveCredits(id)
	}
	switch(get_cvar_num("amx_show_activity")) {
	case 1: ColorChat(0, "^x03Adminul^x04 le-a dat^x03 %i credite^x04 tuturor^x03 Furienilor.", Credits);
	case 2: ColorChat(0, "^x03%s^x04 le-a dat^x03 %i credite^x04 tuturor^x03 Furienilor.", name, Credits);
	}
	}
	else if(equali(arg, "@CT")) {
	get_players(gplayers, num, "e", "CT");
	for(i = 0; i < num; i++) {
	players = gplayers;
	if(!is_user_connected(players))
	continue;
	PlayerCredits[players] += Credits;
	SaveCredits(id)
	}
	switch(get_cvar_num("amx_show_activity")) {
	case 1: ColorChat(0, "^x03Adminul^x04 le-a dat^x03 %i credite^x04 tuturor^x03 Anti-Furienilor.", Credits);
	case 2: ColorChat(0, "^x03%s^x04 le-a dat^x03 %i credite^x04 tuturor^x03 Anti-Furienilor.", name, Credits);
	}
	}
	if(equali(arg, "@All")) {
	get_players(gplayers, num, "a");
	for(i = 0; i < num; i++) {
	players = gplayers;
	if(!is_user_connected(players))
	continue;
	PlayerCredits[players] += Credits;
	SaveCredits(id)
	}
	switch(get_cvar_num("amx_show_activity")) {
	case 1: ColorChat(0, "^x03Adminul^x04 le-a dat^x03 %i credite^x04 tuturor^x03 jucatorilor.", Credits);
	case 2: ColorChat(0, "^x03%s^x04 a dat^x03 %i credite ^x03 jucatorilor.", name, Credits);
	}
	}
	new player = cmd_target(id, arg, 11);
	if(!player) {
	return PLUGIN_HANDLED;
	}
	PlayerCredits[player] += Credits;
	SaveCredits(id)
	switch(get_cvar_num("amx_show_activity")) {
	case 1: ColorChat(player, "^x03Adminul^x04 ti-a dat^x03 %i credite.", Credits);
	case 2: ColorChat(player, "^x03%s^x04 ti-a dat^x03 %i credite.", name, Credits);
	}
	return PLUGIN_HANDLED;
	}
	
public Reset_Credits(id, level, cid) {
	if(!cmd_access(id, level, cid, 2)) {
	return PLUGIN_HANDLED;
	}
	new arg[23], gplayers[32], num, i, players, name[32];
	get_user_name(id, name, 31);
	read_argv(1, arg, 23);
	if(equali(arg, "@T")) {
	get_players(gplayers, num, "e", "TERRORIST");
	for(i = 0; i < num; i++) {
	players = gplayers;
	if(!is_user_connected(players))
	continue;
	PlayerCredits[players] = 0;
	SaveCredits(id)
	}
	switch(get_cvar_num("amx_show_activity")) {
	case 1: ColorChat(0, "^x03Adminul^x04 a luat^x03 creditele^x04 tuturor^x03 Furienilor.");
	case 2: ColorChat(0, "^x03%s^x04 a luat^x03 creditele^x04 tuturor^x03 Furienilor.", name);
	}
	}
	
	else if(equali(arg, "@CT")) {
	get_players(gplayers, num, "e", "CT");
	for(i = 0; i < num; i++) {
	players = gplayers;
	if(!is_user_connected(players))
	continue;
	PlayerCredits[players] = 0;
	SaveCredits(id)
	}
	switch(get_cvar_num("amx_show_activity")) {
	case 1: ColorChat(0, "^x03Adminul^x04 a luat^x03 creditele^x04 tuturor^x03 Anti-Furienilor.");
	case 2: ColorChat(0, "^x03%s^x04 a luat^x03 creditele^x04 tuturor^x03 Anti-Furienilor.", name);
	}
	}
	if(equali(arg, "@All")) {
	get_players(gplayers, num, "a");
	for(i = 0; i < num; i++) {
	players = gplayers;
	if(!is_user_connected(players))
	continue;
	PlayerCredits[players] = 0;
	SaveCredits(id)
	}
	switch(get_cvar_num("amx_show_activity")) {
	case 1: ColorChat(0, "^x03Adminul^x04 a luat^x03 creditele^x04 tuturor^x03 jucatorilor.");
	case 2: ColorChat(0, "^x03%s^x04 a luatx03 creditele^x04 tuturor^x03 jucatorilor.", name);
	}
	}
	new player = cmd_target(id, arg, 11);
	if(!player) {
	return PLUGIN_HANDLED;
	}
	PlayerCredits[player] = 0;
	SaveCredits(id)
	switch(get_cvar_num("amx_show_activity")) {
	case 1: ColorChat(player, "^x03Adminul^x04 ti-a luat^x03 creditele.");
	case 2: ColorChat(player, "^x03%s^x04 ti-a luat^x03 creditele.", name);
	}
	return PLUGIN_HANDLED;
	}
	
//------| Save Credits |------//
public SaveCredits(id) {
	Vault = nvault_open("DepozitCredits");
	new data_credits[256], key_credits[64];
	switch( get_pcvar_num(savepoints) ) { 
	case 1:  { 
	new name[33];
	get_user_name(id,name,32);
	format(key_credits, 63, "%s-/", name);
		}
	case 2: {
	new player_ip[33];
	get_user_ip(id,player_ip,32);
	format(key_credits, 63, "%s-/", player_ip);
	}
	case 3: {
	new steam_ID[33];
	get_user_authid(id,steam_ID,32);
	format(key_credits, 63, "%s-/", steam_ID);
	}
	}
	format(data_credits, 255, "%i#", PlayerCredits[id]);
	nvault_set(Vault, key_credits, data_credits);
	return PLUGIN_CONTINUE;
	}
//------| Loading Credits |------//
public LoadCredits(id) {
	Vault = nvault_open("DepozitCredits");
	new data_credits[256], key_credits[64];
	switch( get_pcvar_num(savepoints) )  { 
	case 1:  { 
	new name[33];
	get_user_name(id,name,32);
	format(key_credits, 63, "%s-/", name);
	}
	case 2: {
	new player_ip[33];
	get_user_ip(id,player_ip,32);
	format(key_credits, 63, "%s-/", player_ip);
	}
	case 3: {
	new steam_ID[33];
	get_user_authid(id,steam_ID,32);
	format(key_credits, 63, "%s-/", steam_ID);
	}
	}
	format(data_credits, 255, "%i#", PlayerCredits[id]);
	nvault_get(Vault, key_credits, data_credits, 255);
	replace_all(data_credits, 255, "#", " ");

	new Credits[32];
	parse(data_credits, Credits, 31);
	PlayerCredits[id] = str_to_num(Credits);
	return PLUGIN_CONTINUE;
	} 
	
stock ColorChat(const id, const input[], any:...) {
	new count = 1, players[32];
	static msg[191];
	vformat(msg, 190, input, 3);
 
	replace_all(msg, 190, "!x04", "^4");
	replace_all(msg, 190, "!x01", "^1");
	replace_all(msg, 190, "!x03", "^3");
 
	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();
	}
	}
	} 
	}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1033\\ f0\\ fs16 \n\\ par }
*/
Rapidserver
User avatar
mixatu
Membru, skill +2
Membru, skill +2
Posts: 660
Joined: 26 Apr 2012, 14:47
Detinator Steam: Da
Detinator server CS: ★ PLAY.USP.RO ★
SteamID: kzu1337
Reputatie: Membru Club eXtreamCS (1 luna)
Location: cstrike
Has thanked: 59 times
Been thanked: 28 times
Contact:

07 Dec 2013, 22:34

Foloseste dhudmessage.inc si recompileaza-l local :)
ImageImage
Fondator: ★ PLAY.USP.RO ★ Competitive CS:GO Server [!ws !gloves !knife FREEVIP!]
User avatar
CaTa.
Fost moderator
Fost moderator
Posts: 420
Joined: 28 Jul 2013, 14:06
Detinator Steam: Nu
Detinator server CS: In curand !
Reputatie: Fost Moderator ajutator
Location: Targu-Mures
Has thanked: 99 times
Been thanked: 19 times
Contact:

07 Dec 2013, 22:35

CLICK ! | Afiseaza codul
Ma gasesti pe Messenger la id :[/b] stelyistu_95@yahoo.com
Follow me on Instagram
Fa-ti cunoscut serverul de Counter-Strike pe facebook ! 
Fa-ti reclama gratis aici Click
My Plugin Furien Guns
User avatar
s0uNNNdx
Membru, skill +1
Membru, skill +1
Posts: 227
Joined: 28 Jul 2013, 22:30
Detinator Steam: Da
CS Status: Joc pe fun.free-play.ro
Detinator server CS: Fun.Free-Play.Ro
Location: Prahova
Has thanked: 32 times
Contact:

07 Dec 2013, 22:58

Nu va suparati dar , unde se pune include'ul ? (vreau sa stiu pe viitor)
User avatar
mixatu
Membru, skill +2
Membru, skill +2
Posts: 660
Joined: 26 Apr 2012, 14:47
Detinator Steam: Da
Detinator server CS: ★ PLAY.USP.RO ★
SteamID: kzu1337
Reputatie: Membru Club eXtreamCS (1 luna)
Location: cstrike
Has thanked: 59 times
Been thanked: 28 times
Contact:

07 Dec 2013, 23:00

In compileru local. Vezi unde scrie adauga include si dai acolo.
ImageImage
Fondator: ★ PLAY.USP.RO ★ Competitive CS:GO Server [!ws !gloves !knife FREEVIP!]
User avatar
s0uNNNdx
Membru, skill +1
Membru, skill +1
Posts: 227
Joined: 28 Jul 2013, 22:30
Detinator Steam: Da
CS Status: Joc pe fun.free-play.ro
Detinator server CS: Fun.Free-Play.Ro
Location: Prahova
Has thanked: 32 times
Contact:

07 Dec 2013, 23:05

Multumesc :D
Post Reply

Return to “Cereri”

  • Information
  • Who is online

    Users browsing this forum: Facebook [Bot] and 12 guests