.Metrix 31 Posted May 24, 2016 Share Posted May 24, 2016 Server :ZMO.RangFort.Ro Nick : .Metrix.Grad server : Manager ServerLa ce doriţi ajutor? : Salut, am bagat de curand un plugin de autosave(ammo), el merge cum trebuie dar la mesajele de la /take all, /deposit all etc. imi apare ????????? in loc de ce trebuie sa scrie(voi lasa o poza mai jos) si vreau sa schimb cu altceva.Cum pot face asta? poza: http://imgur.com/FPsMtA8 plugin: #include <amxmodx> #include <amxmisc> #include <nvault> #include <fakemeta> #include <colorchat> #include <zombieplague> static const version[] = "0.3"; static const plugin[] = "[ZP] Sub Plugin: Auto-save Bank(Name)"; static const prefix[] = "ZP Bank" enum pcvar { enable = 0, cap, start } new pcvars[pcvar]; new bankstorage[33]; new gvault, thinkobj; public plugin_init() { register_plugin(plugin, version, "Random1, 93()|29!/<"); gvault = nvault_open("Zombie Bank Name"); pcvars[enable] = register_cvar("zp_bank", "1"); pcvars[cap] = register_cvar("zp_bank_limit", "5000"); pcvars[start] = register_cvar("zp_bank_blockstart", "0"); if (get_pcvar_num(pcvars[cap]) > 2147483646) { set_pcvar_num(pcvars[cap], 2147483646); server_print("[%s] Due to a 32 bit restriction in perl zp_ammo_limit reset based on restriction", plugin); } register_clcmd("say", "handle_say"); register_clcmd("say_team", "handle_say"); thinkobj = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString, "info_target")); if (pev_valid(thinkobj)) { set_pev(thinkobj, pev_classname, "advertisement_loop"); set_pev(thinkobj, pev_nextthink, get_gametime() + 240.0); register_forward(FM_Think, "fourmin_think"); } } public fourmin_think(ent) { if (ent != thinkobj) return FMRES_IGNORED; if (!get_pcvar_num(pcvars[enable])) return FMRES_IGNORED; ColorChat(0, GREEN, "[%s]^x01 ????? ?????^x03 %d^x01 ???????", prefix, get_pcvar_num(pcvars[cap])); ColorChat(0, GREEN, "[%s]^x01 ????? ??????? ? ????^x03 deposit <amount>", prefix); ColorChat(0, GREEN, "[%s]^x01 ?????? ???????^x03 withdraw <amount>", prefix); ColorChat(0, GREEN, "[%s]^x01 ???? ????????? ??????^x03 ?????????????", prefix); set_pev(ent, pev_nextthink, get_gametime() + 240.0); return FMRES_HANDLED; } public plugin_end() nvault_close(gvault); public handle_say(id) { if (!get_pcvar_num(pcvars[enable])) return PLUGIN_CONTINUE; new text[70], arg1[32], arg2[32], arg3[6]; read_args(text, sizeof(text)-1); remove_quotes(text); arg1[0] = '^0'; arg2[0] = '^0'; arg3[0] = '^0'; parse(text, arg1, sizeof(arg1)-1, arg2, sizeof(arg2)-1, arg3, sizeof(arg3)-1); //dbg_log("cmd_say() arg1:#%s# arg2:#%s# arg3:#%s#", arg1, arg2, arg3); // if the chat line has more than 2 words, we're not interested at all if (arg3[0] == 0) { //strip forward slash if present if (equali(arg1, "/", 1)) format(arg1, 31, arg1[1]); if (equali(arg1, "deposit", 7) || equali(arg1, "send", 4) || equali(arg1, "store", 5)) { if (isdigit(arg2[0]) || (arg2[0] == '-' && isdigit(arg2[1]))) { new value = str_to_num(arg2); store_cash(id, value); ColorChat(id, GREEN, "[%s]^x01 ?? ????????^x03 %d^x01 ??????? ? ????", prefix, value) return PLUGIN_HANDLED; } else if (equali(arg2, "all")) { store_cash(id, -1); ColorChat(id, GREEN, "[%s]^x01 ?? ?????? ? ????^x03 ???^x01 ??????", prefix) return PLUGIN_HANDLED; } else if (arg2[0] == 0) ColorChat(id, GREEN, "[%s]^x01 ????? ??????? ? ????^x03 deposit <amount to deposit>", prefix); return PLUGIN_CONTINUE; } else if (equali(arg1, "withdraw", 8) || equali(arg1, "take", 4) || equali(arg1, "retrieve", 8)) { if (isdigit(arg2[0]) || (arg2[0] == '-' && isdigit(arg2[1]))) { new value = str_to_num(arg2); take_cash(id, value); ColorChat(id, GREEN, "[%s]^x01 ?? ????? ? ?????^x03 %d^x01 ???????", prefix, value) return PLUGIN_HANDLED; } else if (equali(arg2, "all")) { take_cash(id, -1); ColorChat(id, GREEN, "[%s]^x01 ?? ????? ? ?????^x03 ???^x01 ??????", prefix) return PLUGIN_HANDLED; } else if (arg2[0] == 0) ColorChat(id, GREEN, "[%s]^x01 ?????? ???????^x03 withdraw <amount to withdraw>", prefix); return PLUGIN_CONTINUE; } else if (equali(arg1, "mybank", 6) || equali(arg1, "account", 7) || equali(arg1, "bank", 4)) { if (arg2[0] == 0) { ColorChat(id, GREEN, "[%s]^x01 ? ????? ?????^x03 %d^x01 ???????", prefix, bankstorage[id]); return PLUGIN_HANDLED; } else { new player = cmd_target(id, arg2, 2); if (!player) return PLUGIN_CONTINUE; static playername[32]; get_user_name(player, playername, 31); ColorChat(id, GREEN, "[%s]^x03 %s^x01 ?????^x04 %d^x01 ???????", prefix, playername, bankstorage[player]); return PLUGIN_HANDLED; } } } else if (equali(arg1, "donate", 6)) { give_cmd(id, arg2, arg3); return PLUGIN_HANDLED; } return PLUGIN_CONTINUE; } give_cmd(id, target[], amnt[]) { new temp = str_to_num(amnt); if (temp < 0) { ColorChat(id, GREEN, "[%s]^x01 - ^"amount^" ?????????? ????", prefix); return; } new player = cmd_target(id, target, 8); if (!player) return; new temp2 = bankstorage[id] + zp_get_user_ammo_packs(id); if (temp > temp2) { ColorChat(id, GREEN, "[%s]^x01 ??? ????????? ???????, ???? ??????^x04 %d^x01 ?? of^x03 %d^x01 specified", prefix, temp2, temp); return; } static playername[32], givename[32]; get_user_name(player, playername, 31); get_user_name(id, givename, 31); ColorChat(id, GREEN, "[%s]^x01 ???????^x03 %d^x01 ???????^x04 %s", prefix, temp, playername); ColorChat(player, GREEN, "[%s]^x03 %s^x01 ???????^x04 %d^x01 ??????? ???", prefix, givename, temp); bankstorage[player] += temp; if (bankstorage[id] > temp) bankstorage[id] -= temp; else { temp -= bankstorage[id]; bankstorage[id] = 0; zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) - temp); } } //public zp_user_disconnect_pre(id) public client_disconnect(id) { store_cash(id, -1); if (bankstorage[id] > 0) save_data(id); } //public zp_user_connect_post(id) public client_connect(id) { bankstorage[id] = 0; //clear residual before loading retrieve_data(id); } store_cash(id, amnt) { if (!get_pcvar_num(pcvars[enable])) return; if (amnt == -1) { bankstorage[id] += zp_get_user_ammo_packs(id); zp_set_user_ammo_packs(id, 0); checkmax(id); } else if (amnt > 0) { new temp = zp_get_user_ammo_packs(id); new limit = get_pcvar_num(pcvars[cap]); if (temp >= amnt) { if (bankstorage[id] + amnt <= limit) { bankstorage[id] += amnt zp_set_user_ammo_packs(id, temp - amnt); } else { new overflow = bankstorage[id] + amnt - limit; bankstorage[id] = limit; zp_set_user_ammo_packs(id, temp - amnt + overflow); ColorChat(id, GREEN, "[%s]^x01 ??? ???? ?????? ?????????^x03 %d", prefix, limit); ColorChat(id, GREEN, "[%s]^x01 ??????^x03 %d^x01 ??^x04 %d^x01 ???? ???????? ? ????", prefix, amnt - overflow, amnt); } } else ColorChat(id, GREEN, "[%s]^x01 ?? ?????? ?????(^x03%d^x01) ???????, ???? ??????(^x04%d^x01)", prefix, amnt, temp); } else take_cash(id, -amnt); } take_cash(id, amnt) { if (!get_pcvar_num(pcvars[enable])) return; if (amnt == 0) //otherwise a non terminal loop is possible return; if (amnt == -1) { zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + bankstorage[id]) bankstorage[id] = 0; } else if (amnt > 0) { if (bankstorage[id] >= amnt) { zp_set_user_ammo_packs(id, zp_get_user_ammo_packs(id) + amnt); bankstorage[id] -= amnt; } else { ColorChat(id, GREEN, "[%s]^x01 ????? (^x03%d^x01) ?????? ??? ? ?????(^x04%d^x01)", prefix, amnt, bankstorage[id]); } } else store_cash(id, -amnt); } save_data(id) { new Name[35]; get_user_name(id, Name, 34); new vaultkey[40], vaultdata[13]; formatex(vaultkey, 39, "__%s__", Name); formatex(vaultdata, 12, "%i", bankstorage[id]); nvault_set(gvault, vaultkey, vaultdata); } retrieve_data(id) { new Name[35]; get_user_name(id, Name, 34); new vaultkey[40], vaultdata[13]; format(vaultkey, 39, "__%s__", Name); nvault_get(gvault, vaultkey, vaultdata, 12); bankstorage[id] = str_to_num(vaultdata); checkmax(id); // If they have an account don't allow zombie mod to give them 5 ammo packs at beggining if (get_pcvar_num(pcvars[start]) && bankstorage[id] > 0) zp_set_user_ammo_packs(id, 0); } checkmax(id) { if (bankstorage[id] > get_pcvar_num(pcvars[cap])) bankstorage[id] = get_pcvar_num(pcvars[cap]); else if (bankstorage[id] < 0) bankstorage[id] = 0; } /* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE *{\\ rtf1\\ ansi\\ ansicpg1252\\ deff0\\ deflang1033{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ f0\\ fs16 \n\\ par } */ Multumesc Link to comment Share on other sites More sharing options...
LondoN eXtream 110 Posted May 25, 2016 Share Posted May 25, 2016 ColorChat(0, GREEN, "[%s]^x01 ????? ?????^x03 %d^x01 ???????", prefix, get_pcvar_num(pcvars[cap])); ColorChat(0, GREEN, "[%s]^x01 ????? ??????? ? ????^x03 deposit <amount>", prefix); ColorChat(0, GREEN, "[%s]^x01 ?????? ???????^x03 withdraw <amount>", prefix); ColorChat(0, GREEN, "[%s]^x01 ???? ????????? ??????^x03 ?????????????", prefix); Link to comment Share on other sites More sharing options...
MadneSS 113 Posted May 25, 2016 Share Posted May 25, 2016 ColorChat(0, GREEN, "[%s]^x01 ????? ?????^x03 %d^x01 ???????", prefix, get_pcvar_num(pcvars[cap])); ColorChat(0, GREEN, "[%s]^x01 ????? ??????? ? ????^x03 deposit <amount>", prefix); ColorChat(0, GREEN, "[%s]^x01 ?????? ???????^x03 withdraw <amount>", prefix); ColorChat(0, GREEN, "[%s]^x01 ???? ????????? ??????^x03 ?????????????", prefix) In loc de "?" pui ce vrei tu sa iti scrie . Link to comment Share on other sites More sharing options...
.Metrix 31 Posted May 28, 2016 Author Share Posted May 28, 2016 ColorChat(0, GREEN, "[%s]^x01 ????? ?????^x03 %d^x01 ???????", prefix, get_pcvar_num(pcvars[cap])); ColorChat(0, GREEN, "[%s]^x01 ????? ??????? ? ????^x03 deposit <amount>", prefix); ColorChat(0, GREEN, "[%s]^x01 ?????? ???????^x03 withdraw <amount>", prefix); ColorChat(0, GREEN, "[%s]^x01 ???? ????????? ??????^x03 ?????????????", prefix) In loc de "?" pui ce vrei tu sa iti scrie . Am schimbat aici(asta fiind un anunt) dar cand scriu /take all ,/bank ,/deposit all tot imi da cu ?????????.Ce mai trebuie sa schimb? :/ Link to comment Share on other sites More sharing options...
Sp1dey 308 Posted May 28, 2016 Share Posted May 28, 2016 Am schimbat aici(asta fiind un anunt) dar cand scriu /take all ,/bank ,/deposit all tot imi da cu ?????????.Ce mai trebuie sa schimb? :/ Ai incercat macar sa-l copilezi?. Link to comment Share on other sites More sharing options...
.Metrix 31 Posted May 28, 2016 Author Share Posted May 28, 2016 Ai incercat macar sa-l copilezi?. L-am copilat si am schimbat: ColorChat(0, GREEN, "[%s]^x01 ????? ?????^x03 %d^x01 ???????", prefix, get_pcvar_num(pcvars[cap])); ColorChat(0, GREEN, "[%s]^x01 ????? ??????? ? ????^x03 deposit <amount>", prefix); ColorChat(0, GREEN, "[%s]^x01 ?????? ???????^x03 withdraw <amount>", prefix); ColorChat(0, GREEN, "[%s]^x01 ???? ????????? ??????^x03 ?????????????", prefix) Dar astea sunt sub forma de anunt pe server.La comenzi mai da cu ?????(/bank ,etc.) Link to comment Share on other sites More sharing options...
.Metrix 31 Posted May 30, 2016 Author Share Posted May 30, 2016 up Link to comment Share on other sites More sharing options...
InFrAnSp 11 Posted May 30, 2016 Share Posted May 30, 2016 in cstrike/addons/amxmodx/data/lang ai un txt cu numele save_ammo ? daca da modifica de acolo asta ar trebui sa fie problema Link to comment Share on other sites More sharing options...
.Metrix 31 Posted May 31, 2016 Author Share Posted May 31, 2016 in cstrike/addons/amxmodx/data/lang ai un txt cu numele save_ammo ? daca da modifica de acolo asta ar trebui sa fie problema Nu am nimic in lang legat de asa ceva.Din plugin se modifica dar nu stiu cum si unde Link to comment Share on other sites More sharing options...
InFrAnSp 11 Posted June 1, 2016 Share Posted June 1, 2016 Nu am nimic in lang legat de asa ceva.Din plugin se modifica dar nu stiu cum si unde lasa-mi link de unde ai pluginul ca ti-l rezolv eu Link to comment Share on other sites More sharing options...
.Metrix 31 Posted June 1, 2016 Author Share Posted June 1, 2016 Rezolvat,am gasit ce trebuie modificat si cum trebuie. Multumesc de ajutor Link to comment Share on other sites More sharing options...
MadneSS 113 Posted June 2, 2016 Share Posted June 2, 2016 T/C . Link to comment Share on other sites More sharing options...
Recommended Posts