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

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

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

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

Помогите добавить меню

Статус пользователя TYLER[t]
сообщение 25.8.2011, 9:44
Сообщение #1


Стаж: 14 лет

Сообщений: 43
Благодарностей: 26
Полезность: 461

Помогите добавить меню в плагин, сам плагин ниже, меню вызывается командой screens в консоли и /screens в чате ne_othodi_ot_temy.gif
*sma.
/*
Plugin: gmScreens
Version: 2.1
Original author: uTg | bigpapajiggs
© [gm-project.net] #Staff.

*/

// Plugin
#define PLUGIN "gmScreens"
#define VERSION "2.1"
#define AUTHOR "[gm-project.net] #Staff"

#include <amxmodx>
#include <amxmisc>
#include <colorchat>

new player

//PCVAR
new maxss, ssinterval, timestamptype

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

register_concmd("amx_screen", "concmd_screen", ADMIN_LEVEL_D, "<authid, nick or #userid> <number of screens>")

maxss = register_cvar("amx_maxscreens", "10")
ssinterval = register_cvar("amx_ssinterval", "1.0")
timestamptype = register_cvar("amx_timestamptype", "3")

register_cvar("gm_screens", VERSION, FCVAR_SERVER | FCVAR_SPONLY)
}

public concmd_screen(id, level, cid)
{
//Is the amx_screen'er an admin?
if(!cmd_access(id, level, cid, 3))
{
return PLUGIN_HANDLED
}

//Read the arguements
new arg1[24], arg2[4]
read_argv(1, arg1, 23)
read_argv(2, arg2, 3)

new screens = str_to_num(arg2)
new maxscreens = get_pcvar_num(maxss)

//Let us make sure that there aren't too many screenshots taken
if(screens > maxscreens)
{
console_print(id, "[Problem?] You cannot take that many screenshots!")

return PLUGIN_HANDLED
}

//Does the target exist?
player = cmd_target(id, arg1, 1)
if (!player)
{
return PLUGIN_HANDLED
}

//How many screenshots?
new Float:interval = get_pcvar_float(ssinterval)
new array[2]
array[0] = id
array[1] = player
set_task(interval, "takeScreen", 0, array,2, "a", screens)

return PLUGIN_HANDLED
}

public takeScreen(array[2])
{
new player = array[1]
new id = array[0]

//Get time, admin name, and target name
new timestamp[32], name[32], adminname[32]
get_time("%m/%d/%Y - %H:%M:%S", timestamp, 31)
get_user_name(player, name, 31)
get_user_name(id, adminname, 31)

//No timestamp
if(get_pcvar_num(timestamptype) == 0)
{
ColorChat(id, GREEN, "^x01[^x04Problem?^x01] Screenshot taken on player ^x03%s^x01 by Admin ^x04%s^x01", name, adminname)

//Take the screenshot
client_cmd(player, "snapshot")
}
//Client Print only
else if(get_pcvar_num(timestamptype) == 1)
{
//client_print Timestamp Message
ColorChat(id, GREEN, "^x01[^x04Problem?^x01] Screenshot taken on player ^x03%s^x01 by Admin ^x04%s^x01 (Date: %s)", name, adminname, timestamp)

//Take the screenshot
client_cmd(player, "snapshot")
}
//HUD Message only
else if(get_pcvar_num(timestamptype) == 2)
{
//HUD Timestamp Message
set_hudmessage(255, 255, 0, 0.93, 0.0, 0, 6.0, 12.0)
show_hudmessage(player, "Problem Officer?")

//Take the screenshot
client_cmd(player, "snapshot")
}
//Both
else if(get_pcvar_num(timestamptype) == 3)
{
//HUD Timestamp Message
set_hudmessage(255, 255, 0, 0.93, 0.0, 0, 6.0, 12.0)
show_hudmessage(player, "Problem Officer?")

//client_print Timestamp Message
ColorChat(id, GREEN, "^x01[^x04Problem?^x01] Screenshot taken on player ^x03%s^x01 by Admin ^x04%s^x01 (Date: %s)", name, adminname, timestamp)

//Take the screenshot
client_cmd(player, "snapshot")
}
return PLUGIN_CONTINUE
}


Отредактировал: TYLER[t], - 25.8.2011, 9:45
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   Цитировать сообщение
Статус пользователя Rejiser
сообщение 25.8.2011, 9:46
Сообщение #2


Стаж: 15 лет

Сообщений: 2261
Благодарностей: 1068
Полезность: 870

За просто так тебе только дурачек сделает, вот статья https://c-s.net.ua/forum/topic14671.html читай, делай.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
  Тема закрытаНачать новую тему
 
0 пользователей и 1 гостей читают эту тему: