Nick: RealWolf. Grad: MembruMesaje : 379 Bani : 2532 Multumiri : 2
| Subiect: [Plugin] GOLD System Joi Iul 09, 2015 5:23 pm | |
| 1.Titlu: [Plugin] GOLD System 2.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 3.Download: - Spoiler:
#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); }
4.Nume: GOLD System 5.Versiunea: 1.1 6.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: gold_system.amxx 7.Cvars: gold_kill "600" Comenzi publice (se tasteaza in joc prin apasarea tastei Y): /gold - afiseaza cat gold ai Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini): - HamSandWich - ColorChat - Nvault |
|