GOLD System [1.0]

Pluginuri pentru modul AmxModX.

Moderators: Moderatori ajutatori, Moderatori, Echipa eXtreamCS.com

LordOfNothing
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 19 Jul 2013, 14:51
Detinator Steam: Nu
Reputatie: Restrictie PM
Has thanked: 11 times
Been thanked: 34 times

07 Dec 2013, 09:43

Descriere: Acest plugin va ofera gold(Ca pe metin2) la fiecare kill veti primii 600 gold (setat din cvar), nu puteti face nimic cu acest gold dar aveti niste native prin care puteti crea noi plugine folosind gold system , de ex am sa postez o lista cu niste exemple :)

Descarcare:
| Afiseaza codul
#include <amxmodx>
// Some special includes
#include <hamsandwich>
#include <nvault>
#include <colorchat>

new const PLUGIN [] = "Gold System";
new const VERSION [] = "1.1";
new const AUTHOR [] = "LordOfNothing";

/* g var */

new cvar,savegold,gold[33];


public plugin_init()
{
	register_plugin(PLUGIN,VERSION,AUTHOR);
	
	/*	Some Cvars :	*/
	cvar = register_cvar("gold_kill","600");	
	
	/*	Some Events :	*/
	RegisterHam(Ham_Spawn, "player", "GoldKill", 1);
	
	/*	Show Your gold command		*/
	register_clcmd("say /gold","GoldCmd");
	register_clcmd("say_team /gold","GoldCmd");

	/* 	Save Gold	*/
	savegold = nvault_open("goldvault");
}

public plugin_natives()
{
	register_native("get_user_gold","_get_gold");
	register_native("set_user_gold","_set_gold");
}

public _get_gold(plugin, params)
{
	return gold[get_param(1)];
}

public _set_gold(plugin, params)
{
	new client = get_param(1);
	gold[client] = max(0, get_param(2));
	return gold[client];
}


public SaveGold(id)
{
	new PlayerName[35];
	get_user_authid(id,PlayerName,34);
	
	new vaultkey[64],vaultdata[256];
	format(vaultkey,63,"%s",PlayerName);
	format(vaultdata,255,"%i",gold[id]);
	nvault_set(savegold,vaultkey,vaultdata);
	return PLUGIN_CONTINUE;
}

public LoadGold(id)
{
	new PlayerName[35];
	get_user_authid(id,PlayerName,34);
	
	new vaultkey[64],vaultdata[256];
	format(vaultkey,63,"%s",PlayerName);
	nvault_get(savegold,vaultkey,vaultdata,255);
	
	replace_all(vaultdata, 255, " ", " ");
	
	new playerlives[33];
	
	parse(vaultdata, playerlives, 31);
	
	gold[id] = str_to_num(playerlives);
	
	return PLUGIN_CONTINUE;
}

public GoldKill(victim,attacker,shouldgib)
{
	if(!attacker || attacker == victim)
		return PLUGIN_HANDLED;
	
	gold[attacker] += get_pcvar_num(cvar);
	return PLUGIN_CONTINUE
}

public GoldCmd(id)
{
	ColorChat(id, RED, "[GOLD] ^4You have %i gold !",gold[id]);
	return;
}
public client_authorized(id)
{
	LoadGold(id);
}

public client_disconnect(id)
{
	SaveGold(id);
}
Nume: Gold System
Versiune: 1.1
Link oficial: http://www.extreamcs.com/

Instalare:
1. Fisierul gold_system.sma il puneti in addons/amxmodx/scripting
2. Fisierul gold_system.amxx il puneti in addons/amxmodx/plugins
3. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:

Code: Select all

gold_system.amxx

Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
  • gold_kill "600"
Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
  • /gold - afiseaza cat gold ai :D
Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
- HamSandWich
- ColorChat
- Nvault


Exemple plugine
  • /resetgold (setezi gold 0)
    | Afiseaza codul
    #include <amxmodx>
    
    native get_user_gold(id, param);
    native set_user_gold(id, param);
    
    public plugin_init()
    {
    	register_clcmd("say /resetagold", "HookReset");
    }
    
    public HookReset(id)
    {
    	set_user_gold(id, 0);
    	client_print(id, print_chat, "[AMXX] Acum ai 0 gold !");
    }
    /sellgold (vinzi 1000 gold ca sa iei 10 000 $)
    | Afiseaza codul
    #include <amxmodx>
    #include <cstrike>
    
    native get_user_gold(id, param);
    native set_user_gold(id, param);
    
    public plugin_init()
    {
    	register_clcmd("say /sellgold", "HookReset");
    }
    
    public HookReset(id)
    {
    	if(get_user_gold(id) >= 1000)
    	{
    		set_user_gold(id, get_user_gold(id) - 1000);
    		cs_set_user_money(id, get_user_money(id) + 10000);
    		client_print(id, print_chat, "[AMXX] Ai cumparat 10 000 $ pentru 1000 GOLD !");	
    	}
    }
Last edited by LordOfNothing on 10 Dec 2013, 10:43, edited 4 times in total.
User avatar
FaTzZu
Fost moderator
Fost moderator
Posts: 1206
Joined: 22 Dec 2012, 18:37
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 114 times
Been thanked: 168 times
Contact:

07 Dec 2013, 11:36

Interesanta idee :-? gj.
A fool's brain digests philosophy into folly, science into superstition, and art into pedantry.

#RETIRED.
User avatar
satasa
Membru, skill +1
Membru, skill +1
Posts: 371
Joined: 12 Nov 2012, 10:43
Detinator Steam: Nu
CS Status: Ocupat
Reputatie: Membru Club eXtreamCS (2 iun - 2 iul, Acces in Club)
Has thanked: 55 times
Been thanked: 10 times
Contact:

07 Dec 2013, 11:41

mersi,chiar cautam ceva sa modific,ai 1+
OWNX
Utilizator restrictionat
Utilizator restrictionat
Posts: 247
Joined: 23 Aug 2013, 23:09
Detinator Steam: Da
CS Status: dani_ownx@yahoo.com
Detinator server CS: Server Privat
SteamID: Privat
Reputatie: Utilizator Restrictionat: WishExec
Location: Bragadiru
Has thanked: 10 times
Been thanked: 24 times
Contact:

07 Dec 2013, 12:30

e ok ideea bravo
Email :[/color] dani_ownx@yahoo.com


* Privat War3FT V5.0 ( 10 Euro AMXX + SMA ) : http://www.extreamcs.com/forum/anunturi ... 15532.html
DEMO : 93.119.26.151
* Privat UWC3X V4.0 ( 15 Euro AMXX ) : http://www.extreamcs.com/forum/anunturi ... l#p1810595
DEMO : 89.39.13.139

Accept Oferte si Negocieri prin PM
User avatar
DaNNe.
Fost moderator
Fost moderator
Posts: 2808
Joined: 08 Nov 2013, 20:43
Detinator Steam: Da
CS Status: Activitate scăzută
SteamID: /id/FurienMaster
Reputatie: Nick anterior: DnD. Gold, Emrys
0.5/3
Fost moderator ajutator
Fost Membru Club eXtreamCS (doua luni)
Has thanked: 230 times
Been thanked: 128 times
Contact:

07 Dec 2013, 12:32

Mama ce idee mi-ai dat. :o +1 ThX ;)
Contact: Activitate scazuta.
LordOfNothing
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 19 Jul 2013, 14:51
Detinator Steam: Nu
Reputatie: Restrictie PM
Has thanked: 11 times
Been thanked: 34 times

07 Dec 2013, 13:00

va multumesc la toti in sf niste comentarii pe care le citesc cu placere :D
User avatar
DaNNe.
Fost moderator
Fost moderator
Posts: 2808
Joined: 08 Nov 2013, 20:43
Detinator Steam: Da
CS Status: Activitate scăzută
SteamID: /id/FurienMaster
Reputatie: Nick anterior: DnD. Gold, Emrys
0.5/3
Fost moderator ajutator
Fost Membru Club eXtreamCS (doua luni)
Has thanked: 230 times
Been thanked: 128 times
Contact:

07 Dec 2013, 14:06

LordOfNothing wrote:va multumesc la toti in sf niste comentarii pe care le citesc cu placere :D
Sa cresti mare :))) La mai multe ! ! ! ;)
Contact: Activitate scazuta.
User avatar
sN1kkeRs.
Membru, skill +3
Membru, skill +3
Posts: 1058
Joined: 19 Sep 2013, 18:43
Detinator Steam: Da
Detinator server CS: Da
SteamID: bzk15
Location: Brăila
Has thanked: 124 times
Been thanked: 36 times
Contact:

07 Dec 2013, 18:04

Un plugin interesant, felicitări :) +1
User avatar
HamletEagle
Scripter eXtreamCS
Scripter eXtreamCS
Posts: 750
Joined: 21 Sep 2013, 14:05
Detinator Steam: Da
CS Status: Inactiv cateva zile.
SteamID: privat
Reputatie: Scripter eXtreamCS.com
Fost Moderator ajutator
Has thanked: 19 times
Been thanked: 86 times

09 Dec 2013, 19:21

Uite o idee: foloseste modulul regex ca sa verifici daca are steam,atunci faci salvarea pe steam,altfel salvezi pe nume. Daca nu stii cum sa faci,zi si te ajut cu placere.
Daca vreti ajutorul meu, nu dati bump la topic, fara intrebari de genu "cat mai dureaza/mai astept mult?".
LordOfNothing
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 19 Jul 2013, 14:51
Detinator Steam: Nu
Reputatie: Restrictie PM
Has thanked: 11 times
Been thanked: 34 times

10 Dec 2013, 10:33

HamletEagle wrote:Uite o idee: foloseste modulul regex ca sa verifici daca are steam,atunci faci salvarea pe steam,altfel salvezi pe nume. Daca nu stii cum sa faci,zi si te ajut cu placere.
sa primesc ajutor de la incepatori ? , nu mersi !

si nu trebuie regex ca sa fac salvarea pe steam :)))

in functiie LoadGold si SaveGold pot inlocui get_user_name cu get_user_authid :)))
daca era mai avansat poate stiai si tu :))
LordOfNothing
Membru, skill +1
Membru, skill +1
Posts: 387
Joined: 19 Jul 2013, 14:51
Detinator Steam: Nu
Reputatie: Restrictie PM
Has thanked: 11 times
Been thanked: 34 times

10 Dec 2013, 10:38

Update : Acum se salveaza pe steam :)
User avatar
FaTzZu
Fost moderator
Fost moderator
Posts: 1206
Joined: 22 Dec 2012, 18:37
Detinator Steam: Da
Reputatie: Fost moderator ajutator
Has thanked: 114 times
Been thanked: 168 times
Contact:

10 Dec 2013, 11:21

O idee : pune cvar pentru salvare gen save_metode - 1 nume - 2 steam :D
A fool's brain digests philosophy into folly, science into superstition, and art into pedantry.

#RETIRED.
Post Reply

Return to “AmxModX”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests