Правила форума Гаранты форума
Размещение рекламы AMX-X компилятор

Здравствуйте, гость Вход | Регистрация

Наши новости:

14-дек
24-апр
10-апр
11-апр

Помогите с плагинами Zombie

Статус пользователя TpoJlbJkee
сообщение 6.7.2016, 17:53
Сообщение #1
Стаж: 9 лет 10 месяцев
Город: Ташкент

Сообщений: 2
Благодарностей: 1
Полезность: 0

Всем привет в этой теме я хочу попросить вас помочь мне с 1 плагином.

Вот: Делаю VIP menu для ZM мне нужна команда которая превращает VIP игрока в Немезиду вот так вот

native zbg_give_nemesis(id)

и в case прописываем

zbg_give_nemesis(id)

Не судите строго я еще новичок =) Заранее Спасибо!
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   Цитировать сообщение
Статус пользователя TpoJlbJkee
сообщение 8.7.2016, 9:08
Сообщение #2
Стаж: 9 лет 10 месяцев
Город: Ташкент

Сообщений: 2
Благодарностей: 1
Полезность: 0

TpoJlbJkee,

Вот Исходник
Код:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <zombieplague>
#include <zmvip>

#define PLUGIN "[ZP] S/N Buy"
#define VERSION "1.1"
#define AUTHOR "aaarnas"

new g_msgSayText
new nemesis, survivor
new g_bought[33], bought
new /*cvar_n_price, cvar_s_price,*/ cvar_limit_all, cvar_everytime, cvar_show_bought, cvar_allow_times

public plugin_init() {
register_plugin(PLUGIN, VERSION, AUTHOR)
cvar_everytime = register_cvar("zp_allow_buy", "2")
cvar_allow_times = register_cvar("zp_allow_times", "4")
cvar_limit_all = register_cvar("zp_limit_for_all", "1")
//cvar_n_price = register_cvar("zp_nemesis_price", "35")
//cvar_s_price = register_cvar("zp_survivor_price", "35")
cvar_show_bought = register_cvar("zp_show_who_bought", "1")

g_msgSayText = get_user_msgid("SayText")

// Extra items
//nemesis = zv_register_extra_item("Buy Nemesis", "For one round", get_pcvar_num(cvar_n_price), 0)
//survivor = zv_register_extra_item("Buy Survivor","For one round", get_pcvar_num(cvar_s_price), 0)
}

public zp_round_ended()
bought = false

public plugin_natives ( )
{
register_native ( "give_nemesis", "get_nemesis", 1 )
register_native ( "give_survival", "get_survival", 1)
}

public get_nemesis(id)
{
nemesis = 1
}

public get_survival(id)
{
survivor = 1
}

public zv_extra_item_selected(id, itemid) {

new value = get_pcvar_num(cvar_everytime)

if(itemid == nemesis) {

if(get_pcvar_num(cvar_limit_all) && bought) {
client_printcolor(id, "/g[ZP] This is no more avaible in this round. Try next round.")
return ZV_PLUGIN_HANDLED
}
if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
client_printcolor(id, "/g[ZP] You can't buy it more than %d times.", get_pcvar_num(cvar_allow_times))
return ZV_PLUGIN_HANDLED
}
if(value == 2) {
zp_make_user_nemesis(id)
new name[64]
get_user_name(id, name, 63)
client_printcolor(0, "/g[ZP] %s /ybought nemesis", name)
g_bought[id]++
}
else if(zp_has_round_started() == value) {
zp_make_user_nemesis(id)
if(get_pcvar_num(cvar_show_bought)) {
new name[64]
get_user_name(id, name, 63)
client_printcolor(0, "/g[ZP] %s /ybought nemesis", name)
g_bought[id]++
bought = true
}
}
else {
client_printcolor(id, "/g[ZP] /yYou can buy Nemesis only when %s.", value ? "round started":"round not started")
return ZV_PLUGIN_HANDLED
}
}
else if(itemid == survivor) {

if(get_pcvar_num(cvar_limit_all) && bought) {
client_printcolor(id, "/g[ZP] This is no more avaible in this round. Try next round.")
return ZV_PLUGIN_HANDLED
}
if(g_bought[id] >= get_pcvar_num(cvar_allow_times)) {
client_printcolor(id, "/g[ZP] You can't buy it more than %d times.", get_pcvar_num(cvar_allow_times))
return ZV_PLUGIN_HANDLED
}
if(value == 2) {
zp_make_user_survivor(id)
new name[64]
get_user_name(id, name, 63)
client_printcolor(0, "/g[ZP] %s /ybought nemesis", name)
g_bought[id]++
}
else if(zp_has_round_started() == value) {
zp_make_user_survivor(id)
if(get_pcvar_num(cvar_show_bought)) {
new name[64]
get_user_name(id, name, 63)
client_printcolor(0, "/g[ZP] %s /ybought survivor", name)
g_bought[id]++
bought = true
}
}
else {
client_printcolor(id, "/g[ZP] /yYou can buy Survivor only when %s.", value ? "round started":"round not started")
return ZV_PLUGIN_HANDLED
}
}
return 1
}

stock client_printcolor(const id, const input[], any:...)
{
new iCount = 1, iPlayers[32]

static szMsg[191]
vformat(szMsg, charsmax(szMsg), input, 3)

replace_all(szMsg, 190, "/g", "^4") // green txt
replace_all(szMsg, 190, "/y", "^1") // orange txt
replace_all(szMsg, 190, "/ctr", "^3") // team txt
replace_all(szMsg, 190, "/w", "^0") // team txt

if(id) iPlayers[0] = id
else get_players(iPlayers, iCount, "ch")

for (new i = 0; i < iCount; i++)
{
if (is_user_connected(iPlayers[i]))
{
message_begin(MSG_ONE_UNRELIABLE, g_msgSayText, _, iPlayers[i])
write_byte(iPlayers[i])
write_string(szMsg)
message_end()
}
}
}


Отредактировал: iShot, - 8.7.2016, 15:24
Причина: Выдано предупреждение!
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
  Ответить в данную темуНачать новую тему
 
0 пользователей и 1 гостей читают эту тему: