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

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

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

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

35 страниц V  « 24 25 26 ... 33 34 »

Склад маленьких плагинов

, только отборная пузатая мелочь
Статус пользователя SivAnOl
сообщение 4.1.2015, 21:31
Сообщение #481


Стаж: 16 лет

Сообщений: 416
Благодарностей: 49
Полезность: 13

Цитата(Safety1st @ 20.7.2014, 16:45) *
Плагин GHW Auto Message Displayer...
v3.1b [attachment=26854:GHW_Message_Disp.sma]

Помогите пожалуйста, что отредактировать в коде, чтобы сместить худ (или дхуд, не знаю) левее.
Если поделить левую половину экрана пополам - то по центру левой половины (высота та же).
Так понимаю редактировать нужно это?
Часть кода
public DisplayHudMessage() {
new Float:loc[3]
switch (get_pcvar_num(pHudLoc) ) {
case 2: {
loc[0] = -1.0
loc[1] = -1.0
}
default: {
loc[0] = -1.0
#if defined USE_DHUD
loc[1] = 0.14
#else
loc[1] = 0.19
#endif
}
}
Вот весь, если что.
Плагин
#define VERSION "3.1b"

#include <amxmodx>
#include <amxmisc>

/*---------------EDIT ME------------------*/
#define NUM_MESSAGES 25
#define USE_DHUD // comment this to use standard HUD messages; it might be enabled for cstrike only
//#define DEBUG // uncomment to get read results into server console
/*----------------------------------------*/

#define LINE_LEN 608 // read lines buffer
#define HUD_LEN 128 // max allowed HUD message length
#define TEXT_LEN 191 // max allowed text message length

#if defined USE_DHUD && AMXX_VERSION_NUM < 183
// AMXX 1.8.3 since git3790 dev build has its own support of DHUD messages
#include <dhudmessage>
#endif

new text_messages[NUM_MESSAGES][TEXT_LEN]
new hud_messages[NUM_MESSAGES][4][HUD_LEN]
new hud_message_colors[NUM_MESSAGES][4][3]
new giMsgSayText

new num_hudmessages, num_textmessages
new cur_hudmessage[33], cur_textmessage[33]
new pHudLen, pTextLen, pHudLoc

public plugin_init() {
register_plugin( "GHW Auto Message Displayer" , VERSION, "GHW_Chronic/Safety1st" )

pHudLen = register_cvar( "advertise_hud_len", "30" )
pTextLen = register_cvar( "advertise_text_len", "30" )
pHudLoc = register_cvar( "advertise_hud_loc", "1" )

set_task( 7.0, "ReadConfig" )
}

public ReadConfig() {
ReadConfigFile()

if ( num_hudmessages )
set_task( get_pcvar_float(pHudLen), "DisplayHudMessage", .flags = "b" )
if ( num_textmessages ) {
set_task( get_pcvar_float(pTextLen), "DisplayTextMessage", .flags = "b" )
giMsgSayText = get_user_msgid("SayText")
}
}

public ReadConfigFile() {
new szConfigFile[192]
get_localinfo( "amxx_configsdir", szConfigFile, 63 )
format( szConfigFile, charsmax(szConfigFile), "%s/messages.ini", szConfigFile )

new Fsize = file_size(szConfigFile, 1 /* return number of lines */ )
new read[LINE_LEN], trash, j, position, startpos, endpos
for(new i=0;i<Fsize;i++)
{
read_file(szConfigFile,i,read,LINE_LEN - 1,trash)
if(containi(read,"Text")==0)
{
i++
if(num_textmessages==NUM_MESSAGES) {
log_amx("Could not add new text message because text message limit is reached; max = %d", NUM_MESSAGES)
continue // do not read any text messages anymore
}
read_file(szConfigFile,i,read,LINE_LEN - 1,trash)
replace_all(read,LINE_LEN - 1,"[blue]","^x03")
replace_all(read,LINE_LEN - 1,"[/blue]","^x01")
replace_all(read,LINE_LEN - 1,"[red]","^x03")
replace_all(read,LINE_LEN - 1,"[/red]","^x01")
replace_all(read,LINE_LEN - 1,"[green]","^x04")
replace_all(read,LINE_LEN - 1,"[/green]","^x01")
replace_all(read,LINE_LEN - 1,"[Blue]","^x03")
replace_all(read,LINE_LEN - 1,"[/Blue]","^x01")
replace_all(read,LINE_LEN - 1,"[Red]","^x03")
replace_all(read,LINE_LEN - 1,"[/Red]","^x01")
replace_all(read,LINE_LEN - 1,"[Green]","^x04")
replace_all(read,LINE_LEN - 1,"[/Green]","^x01")
format(text_messages[num_textmessages],TEXT_LEN - 1,"^x04^x01%s",read)
#if defined DEBUG
server_print( "^nTEXT: %s^n", text_messages[num_textmessages] )
#endif
num_textmessages++
}
else if(containi(read,"Hud")==0)
{
i++
if(num_hudmessages==NUM_MESSAGES) {
log_amx("Could not add new HUD message because HUD message limit is reached; max = %d", NUM_MESSAGES)
continue // do not read any HUD messages anymore
}
read_file(szConfigFile,i,read, LINE_LEN - 1,trash)
j = 0, position = 0
while(position < strlen(read) && j<4)
{
while(!contain(read[position]," ")) position++
if(!containi(read[position],"[blue]"))
{
startpos = position + 6
endpos = containi(read[startpos],"[/blue]")
if(endpos == -1) {
#if defined DEBUG
server_print( "^nHUD problem - can't find closing tag: %s^n", read[startpos] )
#endif
break
}
endpos += startpos
position = endpos + 7
hud_message_colors[num_hudmessages][j][0] = 0
hud_message_colors[num_hudmessages][j][1] = 100
hud_message_colors[num_hudmessages][j][2] = 255
}
else if(!containi(read[position],"[red]"))
{
startpos = position + 5
endpos = containi(read[startpos],"[/red]")
if(endpos == -1) {
#if defined DEBUG
server_print( "^nHUD problem - can't find closing tag: %s^n", read[startpos] )
#endif
break
}
endpos += startpos
position = endpos + 6
hud_message_colors[num_hudmessages][j][0] = 255
hud_message_colors[num_hudmessages][j][1] = 0
hud_message_colors[num_hudmessages][j][2] = 0
}
else if(!containi(read[position],"[green]"))
{
startpos = position + 7
endpos = containi(read[startpos],"[/green]")
if(endpos == -1) {
#if defined DEBUG
server_print( "^nHUD problem - can't find closing tag: %s^n", read[startpos] )
#endif
break
}
endpos += startpos
position = endpos + 8
hud_message_colors[num_hudmessages][j][0] = 0
hud_message_colors[num_hudmessages][j][1] = 255
hud_message_colors[num_hudmessages][j][2] = 0
}
else if(!containi(read[position],"[yellow]"))
{
startpos = position + 8
endpos = containi(read[startpos],"[/yellow]")
if(endpos == -1) {
#if defined DEBUG
server_print( "^nHUD problem - can't find closing tag: %s^n", read[startpos] )
#endif
break
}
endpos += startpos
position = endpos + 9
hud_message_colors[num_hudmessages][j][0] = 255
hud_message_colors[num_hudmessages][j][1] = 255
hud_message_colors[num_hudmessages][j][2] = 0
}
else if(!containi(read[position],"[orange]"))
{
startpos = position + 8
endpos = containi(read[startpos],"[/orange]")
if(endpos == -1) {
#if defined DEBUG
server_print( "^nHUD problem - can't find closing tag: %s^n", read[startpos] )
#endif
break
}
endpos += startpos
position = endpos + 9
hud_message_colors[num_hudmessages][j][0] = 255
hud_message_colors[num_hudmessages][j][1] = 128
hud_message_colors[num_hudmessages][j][2] = 64
}
else if(!containi(read[position],"[pink]"))
{
startpos = position + 6
endpos = containi(read[startpos],"[/pink]")
if(endpos == -1) {
#if defined DEBUG
server_print( "^nHUD problem - can't find closing tag: %s^n", read[startpos] )
#endif
break
}
endpos += startpos
position = endpos + 7
hud_message_colors[num_hudmessages][j][0] = 255
hud_message_colors[num_hudmessages][j][1] = 0
hud_message_colors[num_hudmessages][j][2] = 128
}
else if(!containi(read[position],"[indigo]"))
{
startpos = position + 8
endpos = containi(read[startpos],"[/indigo]")
if(endpos == -1) {
#if defined DEBUG
server_print( "^nHUD problem - can't find closing tag: %s^n", read[startpos] )
#endif
break
}
endpos += startpos
position = endpos + 9
hud_message_colors[num_hudmessages][j][0] = 0
hud_message_colors[num_hudmessages][j][1] = 255
hud_message_colors[num_hudmessages][j][2] = 255
}
else if(!containi(read[position],"[white]"))
{
startpos = position + 7
endpos = containi(read[startpos],"[/white]")
if(endpos == -1) {
#if defined DEBUG
server_print( "^nHUD problem - can't find closing tag: %s^n", read[startpos] )
#endif
break
}
endpos += startpos
position = endpos + 8
hud_message_colors[num_hudmessages][j][0] = 255
hud_message_colors[num_hudmessages][j][1] = 255
hud_message_colors[num_hudmessages][j][2] = 255
}
else{
startpos = position
endpos = containi(read[startpos],"[") // may be where are next pair of tags?
if(endpos == -1) {
// no, there are not ;)
endpos = LINE_LEN
position = LINE_LEN
}
else {
endpos += startpos
position = endpos
}
hud_message_colors[num_hudmessages][j][0] = 255
hud_message_colors[num_hudmessages][j][1] = 255
hud_message_colors[num_hudmessages][j][2] = 255
}

copy(hud_messages[num_hudmessages][j], min(HUD_LEN - 1,endpos - startpos), read[startpos])
#if defined DEBUG
server_print( "^nHUD: %s^n", hud_messages[num_hudmessages][j] )
#endif
j++
}
num_hudmessages++
}
}
}

public DisplayHudMessage() {
new Float:loc[3]
switch (get_pcvar_num(pHudLoc) ) {
case 2: {
loc[0] = -1.0
loc[1] = -1.0
}
default: {
loc[0] = -1.0
#if defined USE_DHUD
loc[1] = 0.14
#else
loc[1] = 0.19
#endif
}
}

new iPlayers[32], iPlayersNum, iPlayer
get_players( iPlayers, iPlayersNum, "bch" ) // display messages to dead players only
for ( new i = 0; i < iPlayersNum; i++ ) {
iPlayer = iPlayers[i]
loc[2] = loc[1] // reset Y position
for ( new j = 0; j < 4; j++ ) {
if ( hud_messages[cur_hudmessage[iPlayer]][j][0] ) {
#if defined USE_DHUD
set_dhudmessage( hud_message_colors[cur_hudmessage[iPlayer]][j][0],hud_message_colors[cur_hudmess
age[iPlayer]][j][1],hud_message_colors[cur_hudmessage[iPlayer]][j][2],loc[0],loc[
2], 0, 6.0, 12.0,0.1,0.2 )
show_dhudmessage( iPlayer, hud_messages[cur_hudmessage[iPlayer]][j] )
loc[2] += 0.03
#else
set_hudmessage( hud_message_colors[cur_hudmessage[iPlayer]][j][0],hud_message_colors[cur_hudmess
age[iPlayer]][j][1],hud_message_colors[cur_hudmessage[iPlayer]][j][2],loc[0],loc[
2], 0, 6.0, 12.0,0.1,0.2,-1 )
show_hudmessage( iPlayer, hud_messages[cur_hudmessage[iPlayer]][j] )
loc[2] += 0.02
#endif
}
}
cur_hudmessage[iPlayer] = ++cur_hudmessage[iPlayer] % num_hudmessages
}
}

public DisplayTextMessage() {
new iPlayers[32], iPlayersNum, iPlayer
get_players( iPlayers, iPlayersNum, "bch" ) // display messages to dead players only
for ( new i = 0; i < iPlayersNum; i++ ) {
iPlayer = iPlayers[i]

message_begin( MSG_ONE_UNRELIABLE, giMsgSayText, _, iPlayer )
write_byte(iPlayer)
write_string( text_messages[cur_textmessage[iPlayer]] )
message_end()

cur_textmessage[iPlayer] = ++cur_textmessage[iPlayer] % num_textmessages
}
}


Отредактировал: SivAnOl, - 4.1.2015, 21:34
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя tenb63rus
сообщение 2.2.2015, 21:49
Сообщение #482


Стаж: 12 лет

Сообщений: 817
Благодарностей: 476
Полезность: 850

Цитата(Developer @ 7.5.2014, 9:03) *
Плагин Force Round End

Не компилируется плагин, ошибка:
Код:
force_round_end.sma(119) : error 017: undefined symbol "RoundForceEndControl"

1 Error.
Could not locate output file C:\6153\cstrike\addons\amxmodx\plugins\force_round_end.amx (compile failed).

Все инклюды на месте...
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя ThePhoenix
сообщение 2.2.2015, 21:58
Сообщение #483


Стаж: 11 лет

Сообщений: 2723
Благодарностей: 533
Полезность: 40

Ни кто не может выпилить с Vip_Se7eN выдачу дигла каждый раунд?
Скрытый текст
Код:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <fakemeta_util>

#define VIP_FLAG ADMIN_LEVEL_D // flag 'p'

const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<
CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)

new giRoundCounter, pRound, giMenu

new bool:gbDisableArmory // whether VIP autoequipment and VIP armory are disabled for that map
new bool:gbBombMap // whether there is bomb objective on the map
new giIsUsed // whether player has used VIP menu in the current round

// macro; %1 - variable being modified, %2 - player id
#define CheckUsed(%1) ( giIsUsed & ( 1 << (%1-1) ) )
#define SetUsed(%1) ( giIsUsed |= ( 1 << (%1-1) ) )

#define VIP_TAG (1<<2)

public plugin_init() {
register_plugin( "Vip_weapon", "1.60", "7eVen / Safety1st" )

register_event( "ResetHUD", "ResetHUD", "be" )
register_event( "HLTV", "Event_NewRound", "a", "1=0", "2=0" )
register_event( "TextMsg", "Event_NewGame", "a", "2=#Game_will_restart_in", "2=#Game_Commencing" )
register_message( get_user_msgid( "ScoreAttrib" ), "msgScoreAttrib" )

register_clcmd( "vipmenu", "vip_menu" )
register_clcmd( "say /vipmenu", "vip_menu" )

register_clcmd( "say /adminka", "adminka" )
register_clcmd( "say /vip","vipka" )

pRound = register_cvar("amx_vip_give", "3")

if( engfunc( EngFunc_FindEntityByString, -1, "classname", "func_bomb_target" ) )
gbBombMap = true
else if( engfunc( EngFunc_FindEntityByString, -1, "classname", "info_bomb_target" ) )
gbBombMap = true

new szMap[32]
get_mapname( szMap, charsmax(szMap) )
if( containi( szMap , "awp_" ) != -1 || containi( szMap , "35hp_" ) != -1 || containi( szMap , "aim_" ) != -1 )
gbDisableArmory = true

// build menu
giMenu = menu_create( "\r Оружейка \w[\y V.I.P \w]", "show_vipmenu" )

menu_additem( giMenu, "\wВзять \r[\y Famas \r]\r", "1" )
menu_additem( giMenu, "\wВзять \r[\y M4A1 \r]\r", "2" )
menu_additem( giMenu, "\wВзять \r[\y AK47 \r]\r", "3" )
menu_additem( giMenu, "\wВзять \r[\y AWP \r]\r", "4" )

menu_setprop( giMenu, MPROP_NUMBER_COLOR, "\y" )
menu_setprop( giMenu, MPROP_NEXTNAME, "Дальше" )
menu_setprop( giMenu, MPROP_BACKNAME, "Назад" )
menu_setprop( giMenu, MPROP_EXITNAME, "Выход" )
menu_setprop( giMenu, MPROP_EXIT,MEXIT_ALL )
}

drop_weapon(id) {
static weapons[32], i, num, weaponid, wname[32]

num = 0
get_user_weapons( id, weapons, num )

for( i = 0; i < num; i++ ) {
weaponid = weapons[i]

if( ( (1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM ) ) {
get_weaponname( weaponid, wname, 31 )
engclient_cmd( id, "drop", wname )
}
}
}

public vip_menu(id) {
if( !is_user_alive(id) )
return PLUGIN_HANDLED

if( !( get_user_flags(id) & VIP_FLAG ) ) {
ChatColor( id, "^1[ ^4V.I.P^1 ] Только для ^4[V.I.P]" )
return PLUGIN_HANDLED
}

if( gbDisableArmory ) {
ChatColor( id, "^1[ ^4V.I.P^1 ] На текущей карте оружейка отключена!" )
return PLUGIN_HANDLED
}

if( CheckUsed(id) ) {
ChatColor( id, "^1[ ^4V.I.P^1 ] Вы уже использовали. Подождите..." )
return PLUGIN_HANDLED
}

new iRound = get_pcvar_num(pRound)
if( giRoundCounter < iRound ) {
ChatColor( id, "^1[ ^4V.I.P^1 ] Доступно с %d раунда!", iRound )
return PLUGIN_HANDLED
}

menu_display( id, giMenu )
return PLUGIN_HANDLED
}

public show_vipmenu( id, giMenu, item ) {
if( item == MENU_EXIT || !is_user_alive(id) )
return PLUGIN_HANDLED

drop_weapon(id)

switch( ++item ) {
case 1: {
give_item( id, "weapon_famas" )
cs_set_user_bpammo( id , CSW_FAMAS, 90 )
}
case 2: {
give_item( id, "weapon_m4a1" )
cs_set_user_bpammo( id , CSW_M4A1, 90 )
}
case 3: {
give_item( id, "weapon_ak47" )
cs_set_user_bpammo( id , CSW_AK47, 90 )
}
case 4: {
give_item( id, "weapon_awp" )
cs_set_user_bpammo( id , CSW_AWP, 30 )
}
}

SetUsed(id)
return PLUGIN_HANDLED
}

public Event_NewRound() {
giRoundCounter++
giIsUsed = 0 // reset uses
}

public Event_NewGame() {
giRoundCounter = 0
}

public adminka(id) {
show_motd( id, "adminka.txt", "Покупка - Админки!" )
}

public vipka(id) {
show_motd( id, "vip.txt", "Покупка - V.I.P" )
}

public ResetHUD(id) {
if( gbDisableArmory )
return

if( giRoundCounter < 2 )
return

if( get_user_flags(id) & VIP_FLAG )
set_task( 0.5, "EquipVIP", id )
}

public EquipVIP(id) {
if( is_user_alive(id) ) {
cs_set_user_armor( id, 100, CsArmorType:CS_ARMOR_VESTHELM )
if( cs_get_user_team(id) == CS_TEAM_CT && gbBombMap && !cs_get_user_defuse(id) )
cs_set_user_defuse( id, .defusekit = 1 )

static const iPistols[] = { CSW_P228, CSW_ELITE, CSW_FIVESEVEN, CSW_USP, CSW_GLOCK18 }
for( new i = 0; i < 5; i++ ) {
if( fm_strip_user_gun( id, iPistols[i] ) )
break
}
give_item( id, "weapon_hegrenade" )
give_item( id, "weapon_flashbang" )
give_item( id, "weapon_flashbang" )
give_item( id, "weapon_smokegrenade" )

give_item( id, "weapon_deagle")
give_item( id, "ammo_50ae" )
give_item( id, "ammo_50ae" )
give_item( id, "ammo_50ae" )
give_item( id, "ammo_50ae" )
give_item( id, "ammo_50ae" )
}
}

public msgScoreAttrib(const MsgId, const MsgType, const MsgDest) { //xpaw's code
if ( get_user_flags(get_msg_arg_int(1)) & VIP_FLAG && !get_msg_arg_int(2) )
set_msg_arg_int( 2, ARG_BYTE, VIP_TAG )
}

ChatColor(const id, const input[], any:...) {
new count = 1, players[32], iPlayer
static msg[192], iMsgSayText
vformat(msg, 191, input, 3)

if ( !iMsgSayText )
iMsgSayText = get_user_msgid("SayText")

if (id)
players[0] = id
else
get_players(players, count, "ch")

for( new i = 0; i < count; i++ ) {
iPlayer = players[i]
message_begin(MSG_ONE_UNRELIABLE, iMsgSayText, _, iPlayer)
write_byte(iPlayer)
write_string(msg)
message_end()
}
}


Отредактировал: ThePhoenix, - 2.2.2015, 21:58
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Bloo
сообщение 2.2.2015, 22:03
Сообщение #484


Стаж: 12 лет

Сообщений: 15547
Благодарностей: 6971
Полезность: 1206

tenb63rus, так?
Код:
/**
* Home post:
* https://c-s.net.ua/forum/index.php?act=find...&pid=592779
*
* Last update:
* 8/8/2014
*
* Attention:
* Plugin only works on maps without any objectives!
*
* Requirements:
* - 'Round Control' AMXX module
* https://c-s.net.ua/forum/index.php?showtopic=63041
* - 'Director Hud Message' include for AMXX older than 1.8.3-dev git3790
* https://forums.alliedmods.net/showthread.php?t=149210
*
* Credits:
* - to Alka for his 'Force Round End' plugin; it was used as prototype
* http://forums.alliedmods.net/showthread.php?t=56941
* - to s1lent for his 'Round Control' AMXX module
*/

/* Copyright © 2014 Safety1st

Force Round End is free software;
you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include <amxmodx>
#include <fakemeta>
#tryinclude <roundcontrol>
#if AMXX_VERSION_NUM < 183
#include <dhudmessage>
#endif

#define PLUGIN "Force Round End"
#define VERSION "0.80b"
#define AUTHOR "Safety1st"

#if !defined _roundcontrol_included
#assert "Round Control AMXX module required for plugin!"
#endif

new pWarnBefore
new bool:gbRoundStarted, bool:gbGameScoringActive, giWarnBefore

#define TASK_ID 7330 // arbitrary value

public plugin_init() {
register_plugin( PLUGIN, VERSION, AUTHOR )
register_dictionary( "force_round_end.txt" )

new szObjectivesList[][] = {
"func_bomb_target",
"info_bomb_target",
"hostage_entity",
"func_hostage_rescue",
"info_hostage_rescue",
"info_vip_start",
"func_vip_safetyzone",
"func_escapezone"
}
for( new i = 0; i < sizeof szObjectivesList; i++ ) {
if( engfunc(EngFunc_FindEntityByString, -1, "classname", szObjectivesList[i] ) )
pause("d") // set 'stopped' status when pausing whole plugin; in this status plugin is unpauseable
// TODO: may be unload module too...
}

register_event( "RoundTime", "RoundTimer", "bc" ) // we hook single MSG_ONE message repeated to players
register_logevent( "Event_RoundStart", 2, "1=Round_Start" )
register_logevent( "Event_RoundEnd", 2, "1=Round_End" )

register_event( "TextMsg", "Event_NewGame", "a", "2=#Game_Commencing" )
register_event( "TextMsg", "Event_RoundRestart", "a", "2=#Game_will_restart_in" )
register_event( "TextMsg", "Event_GameScoring", "a", "2=#Game_scoring" )

pWarnBefore = register_cvar( "fre_warn_before", "0" )
}

public Event_RoundStart() {
gbRoundStarted = true
}

public RoundTimer() {
if( gbGameScoringActive || !gbRoundStarted )
return

gbRoundStarted = false

giWarnBefore = get_pcvar_num( pWarnBefore )

if( !giWarnBefore )
set_task( float( read_data(1) ), "ForceRoundEnd", TASK_ID )
else
set_task( float( read_data(1) - giWarnBefore ), "WarnPlayers", TASK_ID )
}

public WarnPlayers() {
// SAMPLE FUNCTION FOR THE FUTURE
set_dhudmessage( 255, 0, 0, -1.0, 0.16, 0, 0.0, 5.0, 1.0, 1.0 )
show_dhudmessage( 0, "%L", LANG_PLAYER, "FRE_WARNING", giWarnBefore )

set_task( float(giWarnBefore), "ForceRoundEnd", TASK_ID )
}

public ForceRoundEnd() {
RoundEndForceControl( WINSTATUS_DRAW )
}

public Event_RoundEnd()
remove_task(TASK_ID)

public Event_RoundRestart()
remove_task(TASK_ID)

public Event_NewGame() {
gbGameScoringActive = false
/* task will be removed in Event_RoundEnd() function because
Game_Commencing event is followed by Round_End logevent */
}

public Event_GameScoring() {
if( !gbGameScoringActive ) {
remove_task(TASK_ID)
gbGameScoringActive = true
}
}
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя GOOD FELLOW
сообщение 2.2.2015, 22:05
Сообщение #485


Иконка группы

Стаж: 13 лет

Сообщений: 2294
Благодарностей: 1187
Полезность: 890

удали этот код
Код:
      static const iPistols[] = { CSW_P228, CSW_ELITE, CSW_FIVESEVEN, CSW_USP, CSW_GLOCK18 }
for( new i = 0; i < 5; i++ ) {
if( fm_strip_user_gun( id, iPistols[i] ) )
break


и вот этот

Код:
      give_item( id, "weapon_deagle")
give_item( id, "ammo_50ae" )
give_item( id, "ammo_50ae" )
give_item( id, "ammo_50ae" )
give_item( id, "ammo_50ae" )
give_item( id, "ammo_50ae" )
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя GOOD FELLOW
сообщение 2.2.2015, 22:15
Сообщение #486


Иконка группы

Стаж: 13 лет

Сообщений: 2294
Благодарностей: 1187
Полезность: 890

Код:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <fakemeta_util>

#define VIP_FLAG ADMIN_LEVEL_D // flag 'p'

const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<
CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)

new giRoundCounter, pRound, giMenu

new bool:gbDisableArmory // whether VIP autoequipment and VIP armory are disabled for that map
new bool:gbBombMap // whether there is bomb objective on the map
new giIsUsed // whether player has used VIP menu in the current round

// macro; %1 - variable being modified, %2 - player id
#define CheckUsed(%1) ( giIsUsed & ( 1 << (%1-1) ) )
#define SetUsed(%1) ( giIsUsed |= ( 1 << (%1-1) ) )

#define VIP_TAG (1<<2)

public plugin_init() {
register_plugin( "Vip_weapon", "1.60", "7eVen / Safety1st" )

register_event( "ResetHUD", "ResetHUD", "be" )
register_event( "HLTV", "Event_NewRound", "a", "1=0", "2=0" )
register_event( "TextMsg", "Event_NewGame", "a", "2=#Game_will_restart_in", "2=#Game_Commencing" )
register_message( get_user_msgid( "ScoreAttrib" ), "msgScoreAttrib" )

register_clcmd( "vipmenu", "vip_menu" )
register_clcmd( "say /vipmenu", "vip_menu" )

register_clcmd( "say /adminka", "adminka" )
register_clcmd( "say /vip","vipka" )

pRound = register_cvar("amx_vip_give", "3")

if( engfunc( EngFunc_FindEntityByString, -1, "classname", "func_bomb_target" ) )
gbBombMap = true
else if( engfunc( EngFunc_FindEntityByString, -1, "classname", "info_bomb_target" ) )
gbBombMap = true

new szMap[32]
get_mapname( szMap, charsmax(szMap) )
if( containi( szMap , "awp_" ) != -1 || containi( szMap , "35hp_" ) != -1 || containi( szMap , "aim_" ) != -1 )
gbDisableArmory = true

// build menu
giMenu = menu_create( "\r Оружейка \w[\y V.I.P \w]", "show_vipmenu" )

menu_additem( giMenu, "\wВзять \r[\y Famas \r]\r", "1" )
menu_additem( giMenu, "\wВзять \r[\y M4A1 \r]\r", "2" )
menu_additem( giMenu, "\wВзять \r[\y AK47 \r]\r", "3" )
menu_additem( giMenu, "\wВзять \r[\y AWP \r]\r", "4" )

menu_setprop( giMenu, MPROP_NUMBER_COLOR, "\y" )
menu_setprop( giMenu, MPROP_NEXTNAME, "Дальше" )
menu_setprop( giMenu, MPROP_BACKNAME, "Назад" )
menu_setprop( giMenu, MPROP_EXITNAME, "Выход" )
menu_setprop( giMenu, MPROP_EXIT,MEXIT_ALL )
}

drop_weapon(id) {
static weapons[32], i, num, weaponid, wname[32]

num = 0
get_user_weapons( id, weapons, num )

for( i = 0; i < num; i++ ) {
weaponid = weapons[i]

if( ( (1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM ) ) {
get_weaponname( weaponid, wname, 31 )
engclient_cmd( id, "drop", wname )
}
}
}

public vip_menu(id) {
if( !is_user_alive(id) )
return PLUGIN_HANDLED

if( !( get_user_flags(id) & VIP_FLAG ) ) {
ChatColor( id, "^1[ ^4V.I.P^1 ] Только для ^4[V.I.P]" )
return PLUGIN_HANDLED
}

if( gbDisableArmory ) {
ChatColor( id, "^1[ ^4V.I.P^1 ] На текущей карте оружейка отключена!" )
return PLUGIN_HANDLED
}

if( CheckUsed(id) ) {
ChatColor( id, "^1[ ^4V.I.P^1 ] Вы уже использовали. Подождите..." )
return PLUGIN_HANDLED
}

new iRound = get_pcvar_num(pRound)
if( giRoundCounter < iRound ) {
ChatColor( id, "^1[ ^4V.I.P^1 ] Доступно с %d раунда!", iRound )
return PLUGIN_HANDLED
}

menu_display( id, giMenu )
return PLUGIN_HANDLED
}

public show_vipmenu( id, giMenu, item ) {
if( item == MENU_EXIT || !is_user_alive(id) )
return PLUGIN_HANDLED

drop_weapon(id)

switch( ++item ) {
case 1: {
give_item( id, "weapon_famas" )
cs_set_user_bpammo( id , CSW_FAMAS, 90 )
}
case 2: {
give_item( id, "weapon_m4a1" )
cs_set_user_bpammo( id , CSW_M4A1, 90 )
}
case 3: {
give_item( id, "weapon_ak47" )
cs_set_user_bpammo( id , CSW_AK47, 90 )
}
case 4: {
give_item( id, "weapon_awp" )
cs_set_user_bpammo( id , CSW_AWP, 30 )
}
}

SetUsed(id)
return PLUGIN_HANDLED
}

public Event_NewRound() {
giRoundCounter++
giIsUsed = 0 // reset uses
}

public Event_NewGame() {
giRoundCounter = 0
}

public adminka(id) {
show_motd( id, "adminka.txt", "Покупка - Админки!" )
}

public vipka(id) {
show_motd( id, "vip.txt", "Покупка - V.I.P" )
}

public ResetHUD(id) {
if( gbDisableArmory )
return

if( giRoundCounter < 2 )
return

if( get_user_flags(id) & VIP_FLAG )
set_task( 0.5, "EquipVIP", id )
}

public EquipVIP(id) {
if( is_user_alive(id) ) {
cs_set_user_armor( id, 100, CsArmorType:CS_ARMOR_VESTHELM )
if( cs_get_user_team(id) == CS_TEAM_CT && gbBombMap && !cs_get_user_defuse(id) )
cs_set_user_defuse( id, .defusekit = 1 )

give_item( id, "weapon_hegrenade" )
give_item( id, "weapon_flashbang" )
give_item( id, "weapon_flashbang" )
give_item( id, "weapon_smokegrenade" )
}
}

public msgScoreAttrib(const MsgId, const MsgType, const MsgDest) { //xpaw's code
if ( get_user_flags(get_msg_arg_int(1)) & VIP_FLAG && !get_msg_arg_int(2) )
set_msg_arg_int( 2, ARG_BYTE, VIP_TAG )
}

ChatColor(const id, const input[], any:...) {
new count = 1, players[32], iPlayer
static msg[192], iMsgSayText
vformat(msg, 191, input, 3)

if ( !iMsgSayText )
iMsgSayText = get_user_msgid("SayText")

if (id)
players[0] = id
else
get_players(players, count, "ch")

for( new i = 0; i < count; i++ ) {
iPlayer = players[i]
message_begin(MSG_ONE_UNRELIABLE, iMsgSayText, _, iPlayer)
write_byte(iPlayer)
write_string(msg)
message_end()
}
}
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя ThePhoenix
сообщение 2.2.2015, 22:18
Сообщение #487


Стаж: 11 лет

Сообщений: 2723
Благодарностей: 533
Полезность: 40

GOOD FELLOW, ошибка компиляции:
Скрытый текст
Lite_Vip.sma(185) : warning 217: loose indentation
Lite_Vip.sma(191) : error 054: unmatched closing brace

Sma:
Скрытый текст
Код:
#include <amxmodx>
#include <cstrike>
#include <fun>
#include <fakemeta_util>

#define VIP_FLAG ADMIN_LEVEL_D // flag 'p'

const PRIMARY_WEAPONS_BIT_SUM = (1<<CSW_SCOUT)|(1<<CSW_XM1014)|(1<<CSW_MAC10)|(1<<CSW_AUG)|(1<<CSW_UMP45)|(1<<CSW_SG550)|(1<<CSW_GALIL)|(1<<CSW_FAMAS)|(1<<CSW_AWP)|(1<<
CSW_MP5NAVY)|(1<<CSW_M249)|(1<<CSW_M3)|(1<<CSW_M4A1)|(1<<CSW_TMP)|(1<<CSW_G3SG1)|(1<<CSW_SG552)|(1<<CSW_AK47)|(1<<CSW_P90)

new giRoundCounter, pRound, giMenu

new bool:gbDisableArmory // whether VIP autoequipment and VIP armory are disabled for that map
new bool:gbBombMap // whether there is bomb objective on the map
new giIsUsed // whether player has used VIP menu in the current round

// macro; %1 - variable being modified, %2 - player id
#define CheckUsed(%1) ( giIsUsed & ( 1 << (%1-1) ) )
#define SetUsed(%1) ( giIsUsed |= ( 1 << (%1-1) ) )

#define VIP_TAG (1<<2)

public plugin_init() {
register_plugin( "Vip_weapon", "1.60", "7eVen / Safety1st" )

register_event( "ResetHUD", "ResetHUD", "be" )
register_event( "HLTV", "Event_NewRound", "a", "1=0", "2=0" )
register_event( "TextMsg", "Event_NewGame", "a", "2=#Game_will_restart_in", "2=#Game_Commencing" )
register_message( get_user_msgid( "ScoreAttrib" ), "msgScoreAttrib" )

register_clcmd( "vipmenu", "vip_menu" )
register_clcmd( "say /vipmenu", "vip_menu" )

register_clcmd( "say /adminka", "adminka" )
register_clcmd( "say /vip","vipka" )

pRound = register_cvar("amx_vip_give", "3")

if( engfunc( EngFunc_FindEntityByString, -1, "classname", "func_bomb_target" ) )
gbBombMap = true
else if( engfunc( EngFunc_FindEntityByString, -1, "classname", "info_bomb_target" ) )
gbBombMap = true

new szMap[32]
get_mapname( szMap, charsmax(szMap) )
if( containi( szMap , "awp_" ) != -1 || containi( szMap , "35hp_" ) != -1 || containi( szMap , "aim_" ) != -1 || containi( szMap , "fy" ) != -1 || containi( szMap , "$2000$" ) != -1 )
gbDisableArmory = true

// build menu
giMenu = menu_create( "\w[\y Lite Vip \w]", "show_vipmenu" )

menu_additem( giMenu, "\wВзять \r[\y Famas \r]\r", "1" )
menu_additem( giMenu, "\wВзять \r[\y M4A1 \r]\r", "2" )
menu_additem( giMenu, "\wВзять \r[\y AK47 \r]\r", "3" )
menu_additem( giMenu, "\wВзять \r[\y AWP \r]\r", "4" )

menu_setprop( giMenu, MPROP_NUMBER_COLOR, "\y" )
menu_setprop( giMenu, MPROP_NEXTNAME, "Дальше" )
menu_setprop( giMenu, MPROP_BACKNAME, "Назад" )
menu_setprop( giMenu, MPROP_EXITNAME, "Выход" )
menu_setprop( giMenu, MPROP_EXIT,MEXIT_ALL )
}

drop_weapon(id) {
static weapons[32], i, num, weaponid, wname[32]

num = 0
get_user_weapons( id, weapons, num )

for( i = 0; i < num; i++ ) {
weaponid = weapons[i]

if( ( (1<<weaponid) & PRIMARY_WEAPONS_BIT_SUM ) ) {
get_weaponname( weaponid, wname, 31 )
engclient_cmd( id, "drop", wname )
}
}
}

public vip_menu(id) {
if( !is_user_alive(id) )
return PLUGIN_HANDLED

if( !( get_user_flags(id) & VIP_FLAG ) ) {
ChatColor( id, "^1[ ^4V.I.P^1 ] Только для ^4[V.I.P]" )
return PLUGIN_HANDLED
}

if( gbDisableArmory ) {
ChatColor( id, "^1[ ^4V.I.P^1 ] На текущей карте оружейка отключена!" )
return PLUGIN_HANDLED
}

if( CheckUsed(id) ) {
ChatColor( id, "^1[ ^4V.I.P^1 ] Вы уже использовали. Подождите..." )
return PLUGIN_HANDLED
}

new iRound = get_pcvar_num(pRound)
if( giRoundCounter < iRound ) {
ChatColor( id, "^1[ ^4V.I.P^1 ] Доступно с %d раунда!", iRound )
return PLUGIN_HANDLED
}

menu_display( id, giMenu )
return PLUGIN_HANDLED
}

public show_vipmenu( id, giMenu, item ) {
if( item == MENU_EXIT || !is_user_alive(id) )
return PLUGIN_HANDLED

drop_weapon(id)

switch( ++item ) {
case 1: {
give_item( id, "weapon_famas" )
cs_set_user_bpammo( id , CSW_FAMAS, 90 )
}
case 2: {
give_item( id, "weapon_m4a1" )
cs_set_user_bpammo( id , CSW_M4A1, 90 )
}
case 3: {
give_item( id, "weapon_ak47" )
cs_set_user_bpammo( id , CSW_AK47, 90 )
}
case 4: {
give_item( id, "weapon_awp" )
cs_set_user_bpammo( id , CSW_AWP, 30 )
}
}

SetUsed(id)
return PLUGIN_HANDLED
}

public Event_NewRound() {
giRoundCounter++
giIsUsed = 0 // reset uses
}

public Event_NewGame() {
giRoundCounter = 0
}

public adminka(id) {
show_motd( id, "adminka.txt", "Покупка - Админки!" )
}

public vipka(id) {
show_motd( id, "vip.txt", "Покупка - V.I.P" )
}

public ResetHUD(id) {
if( gbDisableArmory )
return

if( giRoundCounter < 2 )
return

if( get_user_flags(id) & VIP_FLAG )
set_task( 0.5, "EquipVIP", id )
}

public EquipVIP(id) {
if( is_user_alive(id) ) {
cs_set_user_armor( id, 100, CsArmorType:CS_ARMOR_VESTHELM )
if( cs_get_user_team(id) == CS_TEAM_CT && gbBombMap && !cs_get_user_defuse(id) )
cs_set_user_defuse( id, .defusekit = 1 )

}
give_item( id, "weapon_hegrenade" )
give_item( id, "weapon_flashbang" )
give_item( id, "weapon_flashbang" )
give_item( id, "weapon_smokegrenade" )

}
}

public msgScoreAttrib(const MsgId, const MsgType, const MsgDest) { //xpaw's code
if ( get_user_flags(get_msg_arg_int(1)) & VIP_FLAG && !get_msg_arg_int(2) )
set_msg_arg_int( 2, ARG_BYTE, VIP_TAG )
}

ChatColor(const id, const input[], any:...) {
new count = 1, players[32], iPlayer
static msg[192], iMsgSayText
vformat(msg, 191, input, 3)

if ( !iMsgSayText )
iMsgSayText = get_user_msgid("SayText")

if (id)
players[0] = id
else
get_players(players, count, "ch")

for( new i = 0; i < count; i++ ) {
iPlayer = players[i]
message_begin(MSG_ONE_UNRELIABLE, iMsgSayText, _, iPlayer)
write_byte(iPlayer)
write_string(msg)
message_end()
}
}
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя tenb63rus
сообщение 2.2.2015, 22:21
Сообщение #488


Стаж: 12 лет

Сообщений: 817
Благодарностей: 476
Полезность: 850

Цитата(Bloo @ 2.2.2015, 22:03) *
tenb63rus, так?
Скрытый текст
Код:
/**
* Home post:
* https://c-s.net.ua/forum/index.php?act=find...&pid=592779
*
* Last update:
* 8/8/2014
*
* Attention:
* Plugin only works on maps without any objectives!
*
* Requirements:
* - 'Round Control' AMXX module
* https://c-s.net.ua/forum/index.php?showtopic=63041
* - 'Director Hud Message' include for AMXX older than 1.8.3-dev git3790
* https://forums.alliedmods.net/showthread.php?t=149210
*
* Credits:
* - to Alka for his 'Force Round End' plugin; it was used as prototype
* http://forums.alliedmods.net/showthread.php?t=56941
* - to s1lent for his 'Round Control' AMXX module
*/

/* Copyright © 2014 Safety1st

Force Round End is free software;
you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include <amxmodx>
#include <fakemeta>
#tryinclude <roundcontrol>
#if AMXX_VERSION_NUM < 183
#include <dhudmessage>
#endif

#define PLUGIN "Force Round End"
#define VERSION "0.80b"
#define AUTHOR "Safety1st"

#if !defined _roundcontrol_included
#assert "Round Control AMXX module required for plugin!"
#endif

new pWarnBefore
new bool:gbRoundStarted, bool:gbGameScoringActive, giWarnBefore

#define TASK_ID 7330 // arbitrary value

public plugin_init() {
register_plugin( PLUGIN, VERSION, AUTHOR )
register_dictionary( "force_round_end.txt" )

new szObjectivesList[][] = {
"func_bomb_target",
"info_bomb_target",
"hostage_entity",
"func_hostage_rescue",
"info_hostage_rescue",
"info_vip_start",
"func_vip_safetyzone",
"func_escapezone"
}
for( new i = 0; i < sizeof szObjectivesList; i++ ) {
if( engfunc(EngFunc_FindEntityByString, -1, "classname", szObjectivesList[i] ) )
pause("d") // set 'stopped' status when pausing whole plugin; in this status plugin is unpauseable
// TODO: may be unload module too...
}

register_event( "RoundTime", "RoundTimer", "bc" ) // we hook single MSG_ONE message repeated to players
register_logevent( "Event_RoundStart", 2, "1=Round_Start" )
register_logevent( "Event_RoundEnd", 2, "1=Round_End" )

register_event( "TextMsg", "Event_NewGame", "a", "2=#Game_Commencing" )
register_event( "TextMsg", "Event_RoundRestart", "a", "2=#Game_will_restart_in" )
register_event( "TextMsg", "Event_GameScoring", "a", "2=#Game_scoring" )

pWarnBefore = register_cvar( "fre_warn_before", "0" )
}

public Event_RoundStart() {
gbRoundStarted = true
}

public RoundTimer() {
if( gbGameScoringActive || !gbRoundStarted )
return

gbRoundStarted = false

giWarnBefore = get_pcvar_num( pWarnBefore )

if( !giWarnBefore )
set_task( float( read_data(1) ), "ForceRoundEnd", TASK_ID )
else
set_task( float( read_data(1) - giWarnBefore ), "WarnPlayers", TASK_ID )
}

public WarnPlayers() {
// SAMPLE FUNCTION FOR THE FUTURE
set_dhudmessage( 255, 0, 0, -1.0, 0.16, 0, 0.0, 5.0, 1.0, 1.0 )
show_dhudmessage( 0, "%L", LANG_PLAYER, "FRE_WARNING", giWarnBefore )

set_task( float(giWarnBefore), "ForceRoundEnd", TASK_ID )
}

public ForceRoundEnd() {
RoundEndForceControl( WINSTATUS_DRAW )
}

public Event_RoundEnd()
remove_task(TASK_ID)

public Event_RoundRestart()
remove_task(TASK_ID)

public Event_NewGame() {
gbGameScoringActive = false
/* task will be removed in Event_RoundEnd() function because
Game_Commencing event is followed by Round_End logevent */
}

public Event_GameScoring() {
if( !gbGameScoringActive ) {
remove_task(TASK_ID)
gbGameScoringActive = true
}
}

Получилось, а в чем различия, если не секрет?)
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя Bloo
сообщение 2.2.2015, 22:23
Сообщение #489


Стаж: 12 лет

Сообщений: 15547
Благодарностей: 6971
Полезность: 1206

tenb63rus, функция поменялась с обновлением модуля, Саф так и не обновил плагин.
RoundForceEndControl
>>>>
RoundEndForceControl
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя GOOD FELLOW
сообщение 2.2.2015, 22:28
Сообщение #490


Иконка группы

Стаж: 13 лет

Сообщений: 2294
Благодарностей: 1187
Полезность: 890

ThePhoenix, https://c-s.net.ua/forum/topic54004.html?vi...st&p=728528
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя ThePhoenix
сообщение 3.2.2015, 0:05
Сообщение #491


Стаж: 11 лет

Сообщений: 2723
Благодарностей: 533
Полезность: 40

Цитата(GOOD FELLOW @ 3.2.2015, 0:28) *

Я извиняюсь,не тот файл скомпилировал,а пост не дало отредактировать,все моя невнимательность.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя bot123
сообщение 21.2.2015, 19:16
Сообщение #492


Стаж: 11 лет

Сообщений: 236
Благодарностей: 233
Полезность: 645

Safety1st,
Здравствуйте!

Пользуюсь вашим плагином "VIP Weapon от 7eVen'а" и обнаружил там баг. Когда играешь с правами VIP и прописываешь в консоле record 1, а потом stop. Все обмундирование пополняется заново, VIP имеет бесконечное количество гранат и всегда 100% броню.

Можно ли это исправить?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Safety1st
сообщение 21.2.2015, 20:34
Сообщение #493
Стаж: 14 лет
Город: Moscow

Сообщений: 7228
Благодарностей: 8071
Полезность: 196

Легко. Но мне самому это сделать сейчас будет неудобно, может быть кто-нибудь другой Вам поможет...
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя TJhack
сообщение 29.3.2015, 23:02
Сообщение #494
Стаж: 12 лет

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

Цитата(Safety1st @ 20.7.2014, 18:45) *

Как сделать что-бы показывало постоянно то есть когда ты не мёртв или в спектаторе ?

Отредактировал: Bloo, - 30.3.2015, 8:08
Причина: Выдано устное предупреждение!
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя TJhack
сообщение 30.3.2015, 19:44
Сообщение #495
Стаж: 12 лет

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

Помогите в чём проблема почему hud так криво показывает?
screen

sma
Код:
#define VERSION "3.1b"

#include <amxmodx>
#include <amxmisc>

/*---------------EDIT ME------------------*/
#define NUM_MESSAGES 25
//#define USE_DHUD // comment this to use standard HUD messages; it might be enabled for cstrike only
//#define DEBUG // uncomment to get read results into server console
/*----------------------------------------*/

#define LINE_LEN 608 // read lines buffer
#define HUD_LEN 128 // max allowed HUD message length
#define TEXT_LEN 191 // max allowed text message length

#if defined USE_DHUD && AMXX_VERSION_NUM < 183
// AMXX 1.8.3 since git3790 dev build has its own support of DHUD messages
#include <dhudmessage>
#endif

new text_messages[NUM_MESSAGES][TEXT_LEN]
new hud_messages[NUM_MESSAGES][4][HUD_LEN]
new hud_message_colors[NUM_MESSAGES][4][3]
new giMsgSayText

new num_hudmessages, num_textmessages
new cur_hudmessage[33], cur_textmessage[33]
new pHudLen, pTextLen, pHudLoc

public plugin_init() {
register_plugin( "GHW Auto Message Displayer" , VERSION, "GHW_Chronic/Safety1st" )

pHudLen = register_cvar( "advertise_hud_len", "60" )
pTextLen = register_cvar( "advertise_text_len", "60" )
pHudLoc = register_cvar( "advertise_hud_loc", "1" )

set_task( 7.0, "ReadConfig" )
}

public ReadConfig() {
ReadConfigFile()

if ( num_hudmessages )
set_task( get_pcvar_float(pHudLen), "DisplayHudMessage", .flags = "b" )
if ( num_textmessages ) {
set_task( get_pcvar_float(pTextLen), "DisplayTextMessage", .flags = "b" )
giMsgSayText = get_user_msgid("SayText")
}
}

public ReadConfigFile() {
new szConfigFile[192]
get_localinfo( "amxx_configsdir", szConfigFile, 63 )
format( szConfigFile, charsmax(szConfigFile), "%s/messages.ini", szConfigFile )

new Fsize = file_size(szConfigFile, 1 /* return number of lines */ )
new read[LINE_LEN], trash, j, position, startpos, endpos
for(new i=0;i<Fsize;i++)
{
read_file(szConfigFile,i,read,LINE_LEN - 1,trash)
if(containi(read,"Text")==0)
{
i++
if(num_textmessages==NUM_MESSAGES) {
log_amx("Could not add new text message because text message limit is reached; max = %d", NUM_MESSAGES)
continue // do not read any text messages anymore
}
read_file(szConfigFile,i,read,LINE_LEN - 1,trash)
replace_all(read,LINE_LEN - 1,"[blue]","^x03")
replace_all(read,LINE_LEN - 1,"[/blue]","^x01")
replace_all(read,LINE_LEN - 1,"[red]","^x03")
replace_all(read,LINE_LEN - 1,"[/red]","^x01")
replace_all(read,LINE_LEN - 1,"[green]","^x04")
replace_all(read,LINE_LEN - 1,"[/green]","^x01")
replace_all(read,LINE_LEN - 1,"[Blue]","^x03")
replace_all(read,LINE_LEN - 1,"[/Blue]","^x01")
replace_all(read,LINE_LEN - 1,"[Red]","^x03")
replace_all(read,LINE_LEN - 1,"[/Red]","^x01")
replace_all(read,LINE_LEN - 1,"[Green]","^x04")
replace_all(read,LINE_LEN - 1,"[/Green]","^x01")
format(text_messages[num_textmessages],TEXT_LEN - 1,"^x04^x01%s",read)
#if defined DEBUG
server_print( "^nTEXT: %s^n", text_messages[num_textmessages] )
#endif
num_textmessages++
}
else if(containi(read,"Hud")==0)
{
i++
if(num_hudmessages==NUM_MESSAGES) {
log_amx("Could not add new HUD message because HUD message limit is reached; max = %d", NUM_MESSAGES)
continue // do not read any HUD messages anymore
}
read_file(szConfigFile,i,read, LINE_LEN - 1,trash)
j = 0, position = 0
while(position < strlen(read) && j<4)
{
while(!contain(read[position]," ")) position++
if(!containi(read[position],"[blue]"))
{
startpos = position + 6
endpos = containi(read[startpos],"[/blue]")
if(endpos == -1) {
#if defined DEBUG
server_print( "^nHUD problem - can't find closing tag: %s^n", read[startpos] )
#endif
break
}
endpos += startpos
position = endpos + 7
hud_message_colors[num_hudmessages][j][0] = 0
hud_message_colors[num_hudmessages][j][1] = 100
hud_message_colors[num_hudmessages][j][2] = 255
}
else if(!containi(read[position],"[red]"))
{
startpos = position + 5
endpos = containi(read[startpos],"[/red]")
if(endpos == -1) {
#if defined DEBUG
server_print( "^nHUD problem - can't find closing tag: %s^n", read[startpos] )
#endif
break
}
endpos += startpos
position = endpos + 6
hud_message_colors[num_hudmessages][j][0] = 255
hud_message_colors[num_hudmessages][j][1] = 0
hud_message_colors[num_hudmessages][j][2] = 0
}
else if(!containi(read[position],"[green]"))
{
startpos = position + 7
endpos = containi(read[startpos],"[/green]")
if(endpos == -1) {
#if defined DEBUG
server_print( "^nHUD problem - can't find closing tag: %s^n", read[startpos] )
#endif
break
}
endpos += startpos
position = endpos + 8
hud_message_colors[num_hudmessages][j][0] = 0
hud_message_colors[num_hudmessages][j][1] = 255
hud_message_colors[num_hudmessages][j][2] = 0
}
else if(!containi(read[position],"[yellow]"))
{
startpos = position + 8
endpos = containi(read[startpos],"[/yellow]")
if(endpos == -1) {
#if defined DEBUG
server_print( "^nHUD problem - can't find closing tag: %s^n", read[startpos] )
#endif
break
}
endpos += startpos
position = endpos + 9
hud_message_colors[num_hudmessages][j][0] = 255
hud_message_colors[num_hudmessages][j][1] = 255
hud_message_colors[num_hudmessages][j][2] = 0
}
else if(!containi(read[position],"[orange]"))
{
startpos = position + 8
endpos = containi(read[startpos],"[/orange]")
if(endpos == -1) {
#if defined DEBUG
server_print( "^nHUD problem - can't find closing tag: %s^n", read[startpos] )
#endif
break
}
endpos += startpos
position = endpos + 9
hud_message_colors[num_hudmessages][j][0] = 255
hud_message_colors[num_hudmessages][j][1] = 128
hud_message_colors[num_hudmessages][j][2] = 64
}
else if(!containi(read[position],"[pink]"))
{
startpos = position + 6
endpos = containi(read[startpos],"[/pink]")
if(endpos == -1) {
#if defined DEBUG
server_print( "^nHUD problem - can't find closing tag: %s^n", read[startpos] )
#endif
break
}
endpos += startpos
position = endpos + 7
hud_message_colors[num_hudmessages][j][0] = 255
hud_message_colors[num_hudmessages][j][1] = 0
hud_message_colors[num_hudmessages][j][2] = 128
}
else if(!containi(read[position],"[indigo]"))
{
startpos = position + 8
endpos = containi(read[startpos],"[/indigo]")
if(endpos == -1) {
#if defined DEBUG
server_print( "^nHUD problem - can't find closing tag: %s^n", read[startpos] )
#endif
break
}
endpos += startpos
position = endpos + 9
hud_message_colors[num_hudmessages][j][0] = 0
hud_message_colors[num_hudmessages][j][1] = 255
hud_message_colors[num_hudmessages][j][2] = 255
}
else if(!containi(read[position],"[white]"))
{
startpos = position + 7
endpos = containi(read[startpos],"[/white]")
if(endpos == -1) {
#if defined DEBUG
server_print( "^nHUD problem - can't find closing tag: %s^n", read[startpos] )
#endif
break
}
endpos += startpos
position = endpos + 8
hud_message_colors[num_hudmessages][j][0] = 255
hud_message_colors[num_hudmessages][j][1] = 255
hud_message_colors[num_hudmessages][j][2] = 255
}
else{
startpos = position
endpos = containi(read[startpos],"[") // may be where are next pair of tags?
if(endpos == -1) {
// no, there are not ;)
endpos = LINE_LEN
position = LINE_LEN
}
else {
endpos += startpos
position = endpos
}
hud_message_colors[num_hudmessages][j][0] = 255
hud_message_colors[num_hudmessages][j][1] = 255
hud_message_colors[num_hudmessages][j][2] = 255
}

copy(hud_messages[num_hudmessages][j], min(HUD_LEN - 1,endpos - startpos), read[startpos])
#if defined DEBUG
server_print( "^nHUD: %s^n", hud_messages[num_hudmessages][j] )
#endif
j++
}
num_hudmessages++
}
}
}

public DisplayHudMessage() {
new Float:loc[3]
switch (get_pcvar_num(pHudLoc) ) {
case 2: {
loc[0] = -1.0
loc[1] = -1.0
}
default: {
loc[0] = -1.0
#if defined USE_DHUD
loc[1] = 0.14
#else
loc[1] = 0.19
#endif
}
}

new iPlayers[32], iPlayersNum, iPlayer
get_players( iPlayers, iPlayersNum, "ch" ) // display messages to dead players only
for ( new i = 0; i < iPlayersNum; i++ ) {
iPlayer = iPlayers[i]
loc[2] = loc[1] // reset Y position
for ( new j = 0; j < 4; j++ ) {
if ( hud_messages[cur_hudmessage[iPlayer]][j][0] ) {
#if defined USE_DHUD
set_dhudmessage( hud_message_colors[cur_hudmessage[iPlayer]][j][0],hud_message_colors[cur_hudmess
age[iPlayer]][j][1],hud_message_colors[cur_hudmessage[iPlayer]][j][2],loc[0],loc[
2], 0, 6.0, 12.0,0.1,0.2 )
show_dhudmessage( iPlayer, hud_messages[cur_hudmessage[iPlayer]][j] )
loc[2] += 0.03
#else
set_hudmessage( hud_message_colors[cur_hudmessage[iPlayer]][j][0],hud_message_colors[cur_hudmess
age[iPlayer]][j][1],hud_message_colors[cur_hudmessage[iPlayer]][j][2],loc[0],loc[
2], 0, 6.0, 12.0,0.1,0.2,-1 )
show_hudmessage( iPlayer, hud_messages[cur_hudmessage[iPlayer]][j] )
loc[2] += 0.02
#endif
}
}
cur_hudmessage[iPlayer] = ++cur_hudmessage[iPlayer] % num_hudmessages
}
}

public DisplayTextMessage() {
new iPlayers[32], iPlayersNum, iPlayer
get_players( iPlayers, iPlayersNum, "ch" ) // display messages to dead players only
for ( new i = 0; i < iPlayersNum; i++ ) {
iPlayer = iPlayers[i]

message_begin( MSG_ONE_UNRELIABLE, giMsgSayText, _, iPlayer )
write_byte(iPlayer)
write_string( text_messages[cur_textmessage[iPlayer]] )
message_end()

cur_textmessage[iPlayer] = ++cur_textmessage[iPlayer] % num_textmessages
}
}
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя csnet
сообщение 30.3.2015, 19:54
Сообщение #496
Стаж: 12 лет

Сообщений: 4808
Благодарностей: 3849
Полезность: 690

Цитата
Когда играешь с правами VIP и прописываешь в консоле record 1, а потом stop. Все обмундирование пополняется заново,

глюк fullupdate? при записи демки оно отправляется поэтому пополняет патроны, таким багом пользовались раньше на cs_deagle5


go v cs:go
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя [WPMG]PRoSToTeM@
сообщение 30.3.2015, 20:00
Сообщение #497
Стаж: 13 лет

Сообщений: 1514
Благодарностей: 1025
Полезность: 725

Цитата(csnet @ 30.3.2015, 20:54) *
глюк fullupdate? при записи демки оно отправляется поэтому пополняет патроны, таким багом пользовались раньше на cs_deagle5

Там плагин криво сделан, перехват спавна через ResetHUD cbf1b2bfde1a.gif
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Safety1st
сообщение 30.3.2015, 20:14
Сообщение #498
Стаж: 14 лет
Город: Moscow

Сообщений: 7228
Благодарностей: 8071
Полезность: 196

Цитата(TJhack @ 30.3.2015, 20:44) *
Помогите в чём проблема почему hud так криво показывает?

Используйте DHUD пока. Интервал между строками в случае HUD'а нужно получше подобрать.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя Andrey777best
сообщение 15.5.2015, 11:08
Сообщение #499


Стаж: 13 лет
Город: Харьков

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

Цитата(Safety1st @ 21.2.2014, 12:28) *
ConnorMcLeod придумал, как пофиксить появление 'Auto-Team Balance next round' в безорфейной версии Instant AutoTeamBalance. Есть какая-то вероятность, что могут быть кики некоторых игроков с причиной 'Reliable channel overflowed'. Этот момент нуждается в тщательном тестировании.
[attachment=23439:lol.sma]

Поставил эту версию, надписи нет, только ! появляется...как его убрать?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Safety1st
сообщение 15.5.2015, 11:33
Сообщение #500
Стаж: 14 лет
Город: Moscow

Сообщений: 7228
Благодарностей: 8071
Полезность: 196

Andrey777best, скрин в студию.
И значение квара iatb_message какое (смотреть на сервере, не в конфиге)?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
35 страниц V  « 24 25 26 ... 33 34 »
 
Ответить в данную темуНачать новую тему
 
0 пользователей и 3 гостей читают эту тему: