Existing user? Sign in
Sign up
Games
Servers
Useful
User
Pass
2FA
[pending]Modificare plugin donate
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
Author
Message
422
zp.Bodo
[Creep]
Status: Offline
(since 17-11-2019 13:51)
Joined: 15 Jun 2014
Posts: 663
,
Topics: 166
Location:
Romania
Reputation:
548.2
Votes
: 20
Posted: 28-01-2017, 18:18:36
| Translate post to:
... (
Click for more languages
)
Nume: donate plugin
Descriere: vreau sa aiba acces adminii sa apara niste loguri si sa poata fi setat o limita pe mapa
Sma:
Spoiler:
#include <amxmodx>
#include <cstrike>
#include <zombieplague>
#include <dhudmessage>
#define PLUGIN "ammo donate/dhud"
#define VERSION "1.5"
#define AUTHOR "user/zobie-dead bug fix/phantom fix"
new players_menu, players[32], num, i
new accessmenu, iName[64], callback
public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
register_clcmd("say /donate", "transfer_menu", ADMIN_KICK, "") // кеХанды длѬ вызева ХенѮ
register_clcmd("transfer", "transfer_ammo", ADMIN_KICK, "")
}
public transfer_menu(id)
{
get_players(players, num, "h")
if (num <= 1)
{
set_dhudmessage(0, 155, 0, -1.0, 0.4, 0, 0.0, 5.0, 1.0, 1.0, false)
show_dhudmessage(id,"Nu ai acces la aceasta comanda!")
return PLUGIN_HANDLED
}
new tempname[32], info[10]
players_menu = menu_create("Meniu Donate", "players_menu_handler")
for(i = 0; i < num; i++)
{
if(players[i] == id)
continue
get_user_name(players[i], tempname, 31)
num_to_str(players[i], info, 9)
menu_additem(players_menu, tempname, info, 0)
}
menu_setprop(players_menu, MPROP_EXIT, MEXIT_ALL)
menu_display(id, players_menu, 0)
return PLUGIN_CONTINUE
}
public players_menu_handler(id, players_menu, item)
{
if(item == MENU_EXIT)
{
menu_destroy(players_menu)
return PLUGIN_HANDLED
}
new data[6]
menu_item_getinfo(players_menu, item, accessmenu, data, charsmax(data), iName, charsmax(iName), callback)
new player = str_to_num(data)
client_cmd(id, "messagemode ^"transfer %i^"", player)
return PLUGIN_CONTINUE
}
public transfer_ammo(id)
{
new param[6]
read_argv(2, param, charsmax(param))
for (new x; x < strlen(param); x++)
{
if(!isdigit(param[x]))
{
set_dhudmessage(255, 0, 0, -1.0, 0.4, 0, 0.0, 5.0, 1.0, 1.0, false)
show_dhudmessage(id,"Jucatorul nu a fost gasit!")
return 0
}
}
new amount = str_to_num(param)
new ammo = zp_get_user_ammo_packs(id)
if (ammo < amount)
{
set_dhudmessage(255, 0, 0, -1.0, 0.4, 0, 0.0, 5.0, 1.0, 1.0, false)
show_dhudmessage(id,"Nu ai destule credite pentru a transfera!")
return 0
}
read_argv(1, param, charsmax(param))
new player = str_to_num(param)
new player_ammo = zp_get_user_ammo_packs(player)
zp_set_user_ammo_packs(id, ammo - amount)
zp_set_user_ammo_packs(player, player_ammo + amount)
new names[2][32]
get_user_name(id, names[0], 31)
get_user_name(player, names[1], 31)
set_dhudmessage(0, 125, 200, -1.0, 0.4, 0, 0.0, 5.0, 1.0, 1.0, false)
show_dhudmessage(0,"Adminul %s i-a transferat %i credite jucatorului %s", names[0], amount, names[1])
return 0
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }*/
Contact Skype | zm.bodo
Grup Facebook |
CSRO 2k17+
0
0
Back to top
ZPLegendary
[Mentally Stable]
Status: Offline
(since 03-10-2019 20:59)
Joined: 13 Jan 2017
Posts: 142
,
Topics: 7
Location:
Polovragi, GJ
Reputation:
15.4
Votes
: 17
Posted: 28-01-2017, 21:48:15
| Translate post to:
... (
Click for more languages
)
Netestat, s-a compilat perfect.
Am rezolvat si cateva buguri.
Ti-am pus si cvar.
Ti-am scos hud-ul, daca ai si alte huduri iti poate face lag si provoca overflow daca se abuzeaza.
Ti-am adaugat colorchat, trebuie sa ai colorchat.inc in include.
Mesajele sunt colorate.
Ti-am adaugat si log, se numeste Donate.log
Sa-ti schimbi tag-ul, pui ce tag vrei.
Spoiler:
Code:
#include <amxmodx>
#include <amxmisc>
#include <zombieplague>
#include <colorchat>
#define PLUGIN "Donate Credits"
#define VERSION "1.0"
#define AUTHOR "Legendary"
#define ACCES ADMIN_MAP // Acces Admin
new g_UserTotalAmmo[33], g_ItemCount[33];
new limita;
public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
limita = register_cvar("zp_limitadonate", "6") // De cate ori poate dona
register_logevent("cs_round_start", 2, "1=Round_Start")
register_clcmd("say", "handleSay")
register_clcmd("say_team", "handleSay")
}
public handleSay(id)
{
new args[64]
read_args(args, charsmax(args))
remove_quotes(args)
new arg1[16]
new arg2[32]
strbreak(args, arg1, charsmax(arg1), arg2, charsmax(arg2))
if (equal(arg1,"/donate", 7))
donate(id, arg2)
}
public client_putinserver(id)
g_ItemCount[id] = 0
public client_disconnect(id)
g_ItemCount[id] = 0
public donate(id, arg[])
{
if (!(get_user_flags(id) & ACCES))
{
ColorChat(id, RED, "4[AMX Mod X]^3 Nu ai ^4acces^3 la aceasta ^4comanda^3.")
return ZP_PLUGIN_HANDLED;
}
if (g_ItemCount[id] >= get_pcvar_num(limita))
{
ColorChat(id, RED, "4[AMX Mod X]^3 Nu mai poti sa donezi momentan.")
return ZP_PLUGIN_HANDLED;
}
new to[32], count[10]
new donator, cantitate, reciever;
strbreak(arg, to, 31, count, 9)
donator = zp_get_user_ammo_packs(id)
reciever = cmd_target(id, to, (CMDTARGET_ALLOW_SELF))
if (!to[0] || !count[0])
{
ColorChat(id, RED,"^4[Zombie Legendary]^3 Scrie: ^4/donate numele cantitatea^3.")
return ZP_PLUGIN_HANDLED;
}
if (equal(count, "all"))
cantitate = donator
else
cantitate = str_to_num(count)
if (cantitate <= 0)
{
ColorChat(id, RED,"^4[Zombie Legendary]^3 Suma trebuie sa fie ^4mai mare^3 decat ^4zero^3.")
return ZP_PLUGIN_HANDLED;
}
donator -= cantitate
if (donator < 0)
{
cantitate+=donator
donator = 0
}
if (!reciever)
{
ColorChat(id, RED,"^4[Zombie Legendary]^3 Jucatorul^4 %s^3 nu a fost gasit pe ^4Server^3.", to)
return ZP_PLUGIN_HANDLED;
}
if(reciever == id)
{
ColorChat(id, RED,"^4[Zombie Legendary]^3 Nu iti poti dona ^4Credite^3 tie.", to)
return ZP_PLUGIN_HANDLED;
}
zp_set_user_ammo_packs(reciever, zp_get_user_ammo_packs(reciever) + cantitate)
g_UserTotalAmmo[reciever] += cantitate
zp_set_user_ammo_packs(id, donator)
new aName[32], vName[32]
get_user_name(id, aName, 31)
get_user_name(reciever, vName, 31)
ColorChat(0, RED, "^4[Zombie Legendary]^3 Jucatorul^4 %s ^3i-a donat^4 %d Credite ^3lui^4 %s^3!", aName, cantitate, vName)
log_amx("Donate.log", "Jucatorul %s i-a donat %d Credite lui^4 %s!", aName, cantitate, vName)
g_ItemCount[id]++
return ZP_PLUGIN_HANDLED;
}
Be the one, not anyone.
Currently working on Zombie Legendary 8.1
0
0
Back to top
Freakz Forum Index
->
Trash Bin
->
CS 2006-2019 (Archived)
->
Plugins - Help / Support
The time now is 10-01-2025, 17:09:40
Copyright info
Based on phpBB
ro
/
com
B
Login
I forgot my password
World of Warcraft
Login for more...
Download WoW 7.3.5
Misc
eSports
Achievements
Buy reputation with votes
Reputation trades
Forum rules
Ban list
Members list
User guide (FAQ)
World of Warcraft
View details