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

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

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

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

Скрипт чата

, что то запутался
Статус пользователя AsPiRaNt
сообщение 30.1.2018, 17:11
Сообщение #1


Стаж: 8 лет 7 месяцев
Город: Ростов

Сообщений: 384
Благодарности: выкл.

Я пытаюсь сделать чтобы по середине экрана выводилось красным цветом с текстом "Только Для VIP-Персоны"


вот старый код
#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fakemeta>
#include <engine>


}

public OnWeaponboxTouch(wEnt, id){
if(g_bAccess[id]||!IsEntOnGround(wEnt))return PLUGIN_CONTINUE
static szModel[64]
entity_get_string(wEnt, EV_SZ_model, szModel, charsmax(szModel))

if(TrieKeyExists(g_tWorldModels, szModel)){
client_print(id, print_center, "Only VIPs!") // print_center flood 100/sec :D
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}


а вот новый

#include <amxmodx>
#include <amxmisc>
#include <colorchat>
#include <hamsandwich>
#include <fakemeta>
#include <engine>

}

public OnWeaponboxTouch(wEnt, id){
if(g_bAccess[id]||!IsEntOnGround(wEnt))return PLUGIN_CONTINUE
static szModel[64]
entity_get_string(wEnt, EV_SZ_model, szModel, charsmax(szModel))

if(TrieKeyExists(g_tWorldModels, szModel)){
client_print(id, print_center, "^x03Только Для VIP-Персоны!") // print_center flood 100/sec :D
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}




Или эту строку надо так ??
client_print(id, print_center, "\rТолько Для VIP-Персоны!") // print_center flood 100/sec :D


Вообщем я запутался как правильно сделать ?? Помогите
я приложил колор чат ,вроде нужно чтоб вы знали какой у меня колор




colorchat.inc
#if defined _colorchat_included
#endinput
#endif
#define _colorchat_included

/* ColorChat Support */
#define RED Red
#define BLUE Blue
#define GREY Grey
#define ColorChat client_print_color
/* ColorChat Support */

enum {
DontChange = 0,
Grey = 33,
Red,
Blue
};

stock client_print_color(id, sender, const fmt[], any:...)
{
// check if id is different from 0
if( id && !is_user_connected(id) )
{
return 0;
}

static const szTeamName[][] =
{
"",
"TERRORIST",
"CT"
};

new szMessage[192];

new iParams = numargs();
// Specific player code
if( id )
{
if( iParams == 3 )
{
copy(szMessage, charsmax(szMessage), fmt); // copy so message length doesn't exceed critical 192 value
}
else
{
vformat(szMessage, charsmax(szMessage), fmt, 4);
}

if( sender > Grey )
{
if( sender > Blue )
{
sender = id;
}
else
{
_CC_TeamInfo(id, sender, szTeamName[sender-Grey]);
}
}
_CC_SayText(id, sender, szMessage);
}

// Send message to all players
else
{
// Figure out if at least 1 player is connected
// so we don't execute useless useless code if not
new iPlayers[32], iNum;
get_players(iPlayers, iNum, "ch");
if( !iNum )
{
return 0;
}

new iMlNumber, i, j;
new Array:aStoreML = ArrayCreate();
if( iParams >= 5 ) // ML can be used
{
for(j=3; j<iParams; j++)
{
// retrieve original param value and check if it's LANG_PLAYER value
if( getarg(j) == LANG_PLAYER )
{
i=0;
// as LANG_PLAYER == -1, check if next parm string is a registered language translation
while( ( szMessage[ i ] = getarg( j + 1, i++ ) ) ) {}
if( GetLangTransKey(szMessage) != TransKey_Bad )
{
// Store that arg as LANG_PLAYER so we can alter it later
ArrayPushCell(aStoreML, j++);

// Update ML array saire so we'll know 1st if ML is used,
// 2nd how many args we have to alterate
iMlNumber++;
}
}
}
}

// If arraysize == 0, ML is not used
// we can only send 1 MSG_ALL message if sender != 0
if( !iMlNumber )
{
if( iParams == 3 )
{
copy(szMessage, charsmax(szMessage), fmt);
}
else
{
vformat(szMessage, charsmax(szMessage), fmt, 4);
}
if( 0 < sender < Blue ) // if 0 is passed, need to loop
{
if( sender > Grey )
{
_CC_TeamInfo(0, sender, szTeamName[sender-Grey]);
}
_CC_SayText(0, sender, szMessage);
return 1;
}
}

if( sender > Blue )
{
sender = 0; // use receiver index
}

for(--iNum; iNum>=0; iNum--)
{
id = iPlayers[iNum];

if( iMlNumber )
{
for(j=0; j<iMlNumber; j++)
{
// Set all LANG_PLAYER args to player index ( = id )
// so we can format the text for that specific player
setarg(ArrayGetCell(aStoreML, j), _, id);
}

// format string for specific player
vformat(szMessage, charsmax(szMessage), fmt, 4);
}

if( sender > Grey )
{
_CC_TeamInfo(id, sender, szTeamName[sender-Grey]);
}
_CC_SayText(id, sender, szMessage);
}

ArrayDestroy(aStoreML);
}
return 1;
}

stock _CC_TeamInfo(iReceiver, iSender, szTeam[])
{
static iTeamInfo = 0;
if( !iTeamInfo )
{
iTeamInfo = get_user_msgid("TeamInfo");
}
message_begin(iReceiver ? MSG_ONE : MSG_ALL, iTeamInfo, _, iReceiver);
write_byte(iSender);
write_string(szTeam);
message_end();
}

stock _CC_SayText(iReceiver, iSender, szMessage[])
{
static iSayText = 0;
if( !iSayText )
{
iSayText = get_user_msgid("SayText");
}
message_begin(iReceiver ? MSG_ONE : MSG_ALL, iSayText, _, iReceiver);
write_byte(iSender ? iSender : iReceiver);
write_string(szMessage);
message_end();
}

stock register_dictionary_colored(const filename[])
{
if( !register_dictionary(filename) )
{
return 0;
}

new szFileName[256];
get_localinfo("amxx_datadir", szFileName, charsmax(szFileName));
format(szFileName, charsmax(szFileName), "%s/lang/%s", szFileName, filename);
new fp = fopen(szFileName, "rt");
if( !fp )
{
log_amx("Failed to open %s", szFileName);
return 0;
}

new szBuffer[512], szLang[3], szKey[64], szTranslation[256], TransKey:iKey;

while( !feof(fp) )
{
fgets(fp, szBuffer, charsmax(szBuffer));
trim(szBuffer);

if( szBuffer[0] == '[' )
{
strtok(szBuffer[1], szLang, charsmax(szLang), szBuffer, 1, ']');
}
else if( szBuffer[0] )
{
strbreak(szBuffer, szKey, charsmax(szKey), szTranslation, charsmax(szTranslation));
iKey = GetLangTransKey(szKey);
if( iKey != TransKey_Bad )
{
replace_all(szTranslation, charsmax(szTranslation), "!g", "^4");
replace_all(szTranslation, charsmax(szTranslation), "!t", "^3");
replace_all(szTranslation, charsmax(szTranslation), "!n", "^1");
AddTranslation(szLang, iKey, szTranslation[2]);
}
}
}

fclose(fp);
return 1;
}
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   Цитировать сообщение
Статус пользователя paraz1t15
сообщение 30.1.2018, 17:24
Сообщение #2
Стаж: 11 лет
Город: Красноярск

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

print_center не берёт цвет, хоть 100 колорчатов подключи
в худе хоть розовым выкрашивай
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя AsPiRaNt
сообщение 30.1.2018, 18:14
Сообщение #3


Стаж: 8 лет 7 месяцев
Город: Ростов

Сообщений: 384
Благодарности: выкл.

Цитата(paraz1t15 @ 30.1.2018, 17:24) *
print_center не берёт цвет, хоть 100 колорчатов подключи
в худе хоть розовым выкрашивай



как не берет я видел плагины типо "кик" там пишет по середине красным цветом "вам выдано предупреждение "
и у скальпеля видел вроде тоже какой то плагин где по середине пишет предупреждение цветным текстом ...

Как то они же сделали..
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя AsPiRaNt
сообщение 30.1.2018, 18:26
Сообщение #4


Стаж: 8 лет 7 месяцев
Город: Ростов

Сообщений: 384
Благодарности: выкл.

Или через другую команду зайти

чуть выше основного чата ,там должна быть другая быть команда .Хотя это уже будет не то .
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя JIuXeP
сообщение 31.1.2018, 9:54
Сообщение #5


Стаж: 12 лет

Сообщений: 338
Благодарностей: 205
Полезность: 792

StatusText (зависит от клиентского квара hud_centerid, так же как и отображаются имена при наведении прицела на игрока, заместо имён) - очень неудобен...
hudmessage - хорошее решение.
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
Поблагодарили 1 раз
   + Цитировать сообщение
Статус пользователя AsPiRaNt
сообщение 31.1.2018, 14:28
Сообщение #6


Стаж: 8 лет 7 месяцев
Город: Ростов

Сообщений: 384
Благодарности: выкл.

JIuXeP,


и как вставить код тот сюда?
}

public OnWeaponboxTouch(wEnt, id){
if(g_bAccess[id]||!IsEntOnGround(wEnt))return PLUGIN_CONTINUE
static szModel[64]
entity_get_string(wEnt, EV_SZ_model, szModel, charsmax(szModel))

if(TrieKeyExists(g_tWorldModels, szModel)){
client_print(id, print_center, "Only VIPs!") // print_center flood 100/sec :D
return PLUGIN_HANDLED
}
return PLUGIN_CONTINUE
}



}
public hud_message_red(id){
//красный hud
set_hudmessage(255, 0, 0, -1.0, -1.0, 0, 6.0, 10.0)
show_hudmessage(id, "You red hudmessage")
}


Если от скобки до скобки удалить оно просто работать не будет ,а я так понял нужно где то в середине вставить то есть

{
client_print(id, print_center, "Only VIPs!") // print_center flood 100/sec :D
return PLUGIN_HANDLED
}

вот так и вместо него ?
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
Статус пользователя AsPiRaNt
сообщение 2.2.2018, 20:31
Сообщение #7


Стаж: 8 лет 7 месяцев
Город: Ростов

Сообщений: 384
Благодарности: выкл.

L 02/02/2018 - 17:02:11: Info (map "de_dust") (file "addons/amxmodx/logs/error_20180202.log")
L 02/02/2018 - 17:02:11: [HAMSANDWICH] Invalid player 3 (not in-game)
L 02/02/2018 - 17:02:11: [AMXX] Displaying debug trace (plugin "vip_custom.amxx")
L 02/02/2018 - 17:02:11: [AMXX] Run time error 10: native error (native "get_pdata_cbase")
L 02/02/2018 - 17:02:11: [AMXX] [0] vip_custom.sma::refill (line 937)
L 02/02/2018 - 17:02:11: [AMXX] [1] vip_custom.sma::GiveItem (line 630)

а что за ошибка ? по плагину в логе выдает
Перейти в начало страницы         Просмотр профиля    Отправить личное сообщение
   + Цитировать сообщение
  Ответить в данную темуНачать новую тему
 
0 пользователей и 1 гостей читают эту тему: