Descriere: Acest plugin adauga pe server euro ... Are native asa ca va pute-ti face Shop-uri si alte porcarii
[b]/*========================================================================================================================================== Cvars HsKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva in Head Shot (default: 20) NormalKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva [simplu / no-hs / no knife / no he] (default: 15) Comenzi Administrative amx_euro <name> - afli cate credite are un jucator amx_give_euro <name> <amount> - Dai cuiva credite amx_take_euro <name> <amount> - Iei cuiva credite Comenzi Publice /euro - vezi cati euro ai Change Log Version 1.0 - Lansarea 1.1 - Adaugarea comenzilor administrative [amx_euro / amx_give_euro / amx_take_euro] 1.2 - Updateuri Credits -------- ============================================================================================================================================*/#include <amxmodx>#include <amxmisc>#include <nvault>#include <hamsandwich>#include <fun>#include <colorchat>#pragma semicolon 1new const PLUGIN_NAME[] = "Euro System";new const VERSION_PLUGIN[] = "1.2";new const AUTOR_NAME[] = "GhosT ***";new EuroPlayer[32];new g_vault;new HeadShotKill_Euro;new NormalKill_Euro;public plugin_init(){ register_plugin(PLUGIN_NAME, VERSION_PLUGIN, AUTOR_NAME); register_clcmd("say /euro", "ShowEuroInfo"); register_clcmd("say_team /euro", "ShowEuroInfo"); register_event("DeathMsg", "DeathMsg", "a"); register_concmd("amx_euro", "_euro"); register_concmd("amx_give_euro", "_give_euro", ADMIN_MENU, "<nume> <Amount>"); register_concmd("amx_take_euro", "_take_euro", ADMIN_MENU, "<nume> <Amount>"); g_vault = nvault_open("EuroSystem"); HeadShotKill_Euro = register_cvar("HsKill_Euro", "50"); NormalKill_Euro = register_cvar("NormalKill_Euro", "30");}public client_putinserver(id){ LoadEuro(id); set_task(5.0, "ShowMessage", id);}public client_disconnect(id){ SaveEuro(id);}public SaveEuro(id){ new name[32]; get_user_name(id,name,31); new vaultkey[64],vaultdata[256]; format(vaultkey,63,"%s-Euro",name); format(vaultdata,255,"%i#", EuroPlayer[id]); nvault_set(g_vault,vaultkey,vaultdata);}public LoadEuro(id){ new name[32]; get_user_name(id, name, 31); new vaultkey[64], vaultdata[256]; format(vaultkey, 63, "%s-Euro", name); format(vaultdata, 255, "%i#", EuroPlayer[id]); nvault_get(g_vault,vaultkey,vaultdata,255); replace_all(vaultdata, 255, "#", " "); new PlayerEuro[32]; parse(vaultdata, PlayerEuro, 31); EuroPlayer[id] = str_to_num(PlayerEuro);}public plugin_natives(){ register_library( "es" ); register_native("get_user_euro", "_get_user_Euro"); register_native("set_user_euro", "_set_user_Euro");}public _get_user_Euro(Plugin, Params){ return EuroPlayer[get_param(1)];}public _set_user_Euro(Plugin, Params){ new id = get_param(1); EuroPlayer[id] = max(0, get_param(2)); SaveEuro(id); return EuroPlayer[id];}native get_user_euro(index);native set_user_euro(index, amount);public ShowEuroInfo(id){ ColorChat(id, RED, "^x04 [EURO]^x01 Ai^x03 %i^x01 euro !", get_user_euro(id)); return 1;}public DeathMsg(iWpnIndex){ new headshot = read_data(3); new Victim = read_data(2); new iAttacker = read_data(1); if(iAttacker == Victim) return PLUGIN_HANDLED; else if(headshot) set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(HeadShotKill_Euro)); else set_user_euro(iAttacker, get_user_euro(iAttacker) + get_pcvar_num(NormalKill_Euro)); return PLUGIN_CONTINUE;}public _euro(id){ new target_name[32]; read_argv(1, target_name, 31); if(equal(target_name, "")) { console_print(id, "amx_euro <Nume>"); return 1; } new iPlayer = cmd_target(id, target_name, 8); if(!iPlayer) { console_print(id, "Jucatorul %s nu a fost gasit !", target_name); return 1; } new Player_Name[32]; get_user_name(iPlayer, Player_Name, 31); console_print(id, "Jucatorul %s are %i euro !", Player_Name, get_user_euro(iPlayer)); return 1;}public _give_euro(id){ if(get_user_flags(id) & ADMIN_MENU) { new target_name[32]; new Amount[10]; read_argv(1, target_name, 31); read_argv(2, Amount, 9); if(equal(target_name, "") || equal(Amount, "")) { console_print(id, "amx_give_euro <Nume> <Suma>"); return 1; } new Euro = str_to_num(Amount); if(Euro <= 0) { console_print(id, "Trebuie sa scrii o suma mai mare decat 0 !"); return 1; } new iPlayer = cmd_target(id, target_name, 8); if(!iPlayer) { console_print(id, "Jucatorul %s nu a fost gasit !", target_name); return 1; } set_user_euro(iPlayer, get_user_euro(iPlayer) + Euro); new Admin_Name[32]; new Player_Name[32]; get_user_name(id, Admin_Name, 31); get_user_name(iPlayer, Player_Name, 31); ColorChat(id, RED, "^x04 ADMIN: %s^x01 i-a dat^x03 %d Euro^x01 lui^x04 %s^x01 !", Admin_Name, Euro, Player_Name); return 1; } else { console_print(id, "Nu ai acces la aceasta comanda !"); return 1; } return 1;}public _take_euro(id){ if(get_user_flags(id) & ADMIN_MENU) { new target_name[32]; new Amount[10]; read_argv(1, target_name, 31); read_argv(2, Amount, 9); if(equal(target_name, "") || equal(Amount, "")) { console_print(id, "amx_take_euro <Nume> <Suma>"); return 1; } new Euro = str_to_num(Amount); if(Euro <= 0) { console_print(id, "Trebuie sa scrii o suma mai mare decat 0 !"); return 1; } new iPlayer = cmd_target(id, target_name, 8); if(!iPlayer) { console_print(id, "Jucatorul %s nu a fost gasit !", target_name); return 1; } if(get_user_euro(iPlayer) < Euro) { console_print(id, "Jucatorul %s are doar %i Euro !", target_name, get_user_euro(iPlayer)); return 1; } set_user_euro(iPlayer, get_user_euro(iPlayer) - Euro); new Admin_Name[32]; new Player_Name[32]; get_user_name(id, Admin_Name, 31); get_user_name(iPlayer, Player_Name, 31); ColorChat(id, RED, "^x04 ADMIN: %s^x01 i-a luat^x03 %d Euro^x01 lui^x04 %s^x01 !", Admin_Name, Euro, Player_Name); return 1; } else { console_print(id, "Nu ai acces la aceasta comanda !"); return 1; } return 1;[/b]
[b]#if defined _euro_system_included #endinput#endif#define _euro_system_included //========================================================================================== native get_user_euro(index);/* * Returns a players euro * * @param index - The player index to get euro * * @return The Euro of client * */ //==========================================================================================native set_user_euro(index, amount); /* * Sets <euro> to player * * @param index - The player index to set euro * @param amount - The amount of euro to set to player * * @return The Euro of client * */ //==========================================================================================stock add_user_euro(index, amount){ return set_user_euro(index, get_user_euro(index) + amount);} /* * Add <euro> to player * * @param index - The player index to add euro * @param amount - The amount of euro to add to player * * @return The Euro of client * *///========================================================================================== stock remove_user_euro(index, amount){ return set_user_euro(index, get_user_euro(index) - credits);} /* * Remove <euro> from player * * @param index - The player index to remove euro * @param amount - The amount of euro to remove to player * * @return The Euro of client * *///========================================================================================== stock strip_user_euro(index){ return set_user_euro(index, 0);} /* * Strip <euro> from player * * @param index - The player index to strip euro * * @return The Euro of client * */ //==========================================================================================[/b]
Nume: Euro System
Versiune: 1.0
Instalare: Instalare: 1. Fisierul euro_sys.sma il puneti in addons/amxmodx/scripting ! 2. Fisierul euro_sys.amxx il puneti in addons/amxmodx/plugins ! 6. Intrati in fisierul addons/amxmodx/configs/plugins.ini si adaugati la urma:
[b]euro_sys.amxx[/b]
7. Alti pasi necesari...
Cvar-uri (se adauga in fisierul amxmodx\configs\amxx.cfg):
[b]Suicide_Euro - Cati euro sa iti ia atunci cand te sinucizi (default: 30)NormalKnifeKill_Euro - Cati euro sa iti dea atunci cand omori pe cine cu knife (default: 25)HsKnifeKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva cu knife in Head Shot (default: 30)GrenadeKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva cu He Grenade (default: 35)HsKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva in Head Shot (default: 20)NormalKill_Euro - Cati euro sa iti dea atunci cand omori pe cineva [simplu / no-hs / no knife / no he] (default: 15)Plant_Euro - Cati euro sa iti dea atunci cand plantezi bomba[c4] (default: 5)Defuse_Euro - Cati euro sa iti dea atunci cand ai dat defuse la bomba[c4] (default: 10)Explode_Euro - Cati euro sa iti dea atunci cand bomba[c4] a explodat (default:5)Survive_Euro - Cati euro sa iti dea atunci cand esti viu la final de runda (default: 5)[/b]
Comenzi administrative (se tasteaza in consola si trebuie sa fiti administrator):
| Ascunde codul amx_euro <name> - afli cate credite are un jucator amx_give_euro <name> <amount> - Dai cuiva credite amx_take_euro <name> <amount> - Iei cuiva credite
Comenzi publice (se tasteaza in joc prin apasarea tastei Y):
Comenzi publice | Ascunde codul /euro - vezi cati euro ai /infoeuro - Afli informatii despre cum sa faci euro
Module necesare (se sterge ; din fata modulului de mai jos; acestea le gasiti in fisierul amxmodx\configs\modules.ini):
| Ascunde codul #include <amxmodx> #include <nvault> #include <hamsandwich> #include <fun> #include <colorchat> #include <csx>
Download: .Sma + .Amxx + .Inc .Inc