antitk.sp

ferest2

Участник
Сообщения
52
Реакции
3
Ребят вот появилась у мну 1 проблема!
Я скачал готовый плагин с вашего портала вот он http://hlmod.ru/forum/showthread.php?t=871

я его хотел переделать чтобы вместо [Anti-TK] писало [GunGame] ну в чате перед сообщением все сделал сохранил в кодировки wtf 8 без бум выделяю его ну этот файл antitk.sp кладу на файл compile появляется окно и пишет мне вот токую вот ошибку

//SourceMod Batch Compiler
// by the SourceMod Dev Team


//// antitk.sp
// D:\Css\orangebox\cstrike\addons\sourcemod\scripting\antitk.sp(298) : fatal er
ror 120: cannot read from file: "antitk/keyvalues.sp"
//
// Compilation aborted.
// 1 Error.
//
// Compilation Time: 0,22 sec
// ----------------------------------------

Press enter to exit ...

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


//SourceMod Batch Compiler
// by the SourceMod Dev Team


//// antitk.sp
// D:\Css\orangebox\cstrike\addons\sourcemod\scripting\antitk.sp(298) : fatal er
ror 120: cannot read from file: "antitk/keyvalues.sp"
//
// Compilation aborted.
// 1 Error.
//
// Compilation Time: 0,47 sec
// ----------------------------------------

Press enter to exit ...

Ребят в што я не так делаю?
 

kv.acid

Участник
Сообщения
2,025
Реакции
755
ferest2, Те бе же пишет, что не может прочесть файл antitk/keyvalues.sp. С официального сайта скачай недостающие файлы если их у тебя нет и компилируй с помощью двойного клика по compile, а не перетаскиванием файла.
 

kv.acid

Участник
Сообщения
2,025
Реакции
755
ferest2, Оффтоп Смотри в конце первого поста по той ссылке, что ты даешь! ТТ
Ссылка на скачивание http://forums.alliedmods.net/attachment.php?attachmentid=81011&d=1295821033
Ссылка на скачивание http://forums.alliedmods.net/attachment.php?attachmentid=81012&d=1295821040
 

FrozDark

Участник
Сообщения
1,769
Реакции
2,050
ну специально для слепых скрин сделал

attachment.php
 

Вложения

  • Безымянный.jpg
    Безымянный.jpg
    22.4 КБ · Просмотры: 183

ferest2

Участник
Сообщения
52
Реакции
3
Ребят а вотето так и должно быть?
//SourceMod Batch Compiler
// by the SourceMod Dev Team


//// antitk.sp
// D:\Css\orangebox\cstrike\addons\sourcemod\scripting\antitk.sp(2512) : warning
203: symbol is never used: "RemoveTKer"
// Header size: 5988 bytes
// Code size: 60060 bytes
// Data size: 32688 bytes
// Stack/heap size: 16384 bytes; Total requirements: 115120 bytes
//
// 1 Warning.
//
// Compilation Time: 1,61 sec
// ----------------------------------------

Press enter to exit ...
 

ferest2

Участник
Сообщения
52
Реакции
3
Ребят вот ещо 1 вопрос только по mapchooser_extended_1.4.1

я хачу изменить отображения голосов ну то что по середине пишет вот пример скрин
http://i063.radikal.ru/1106/52/da3bd8b1d13e.png

Тоесть я хотел сделать так))
http://s43.radikal.ru/i101/1106/db/fe7b8380c394.png

Но когда ктото голосует получаеца вот токая вот херня как исправить?
http://s013.radikal.ru/i325/1106/45/e364fef3af49.png

Спросите как я все это делал?
я зашел в папку sourcemod/scripting/mapchooser_extended/DisplayVoteProgress.sp
Там нашел строчку

PrintHintTextToAll("%s", hintboxText);
и изменил вот на вот это

new Handle:hBuffer = StartMessageAll("KeyHintText");
BfWriteByte(hBuffer, 1);
BfWriteString(hBuffer, hintboxText);
EndMessage();
вот што у мну получилось!
#include <sourcemod>
#include <sdktools>
#include <sdktools_sound>

#pragma semicolon 1

#define ITEM_MAX_LENGTH 128
#define CLIENT_MAX_LENGTH 32

new g_PlayerVotes[MAXPLAYERS+1];

new Handle:g_Cvar_PrintVotes = INVALID_HANDLE;
new Handle:g_Cvar_ShowVotes = INVALID_HANDLE;
new Handle:g_VoteDuration = INVALID_HANDLE;
new Handle:g_AllowedVoters = INVALID_HANDLE;

new Handle:g_timer_ShowVotes = INVALID_HANDLE;

new g_VoteTimeStart2;

public OnPluginStart_DisplayVote()
{
LoadTranslations("common.phrases");
LoadTranslations("basetriggers.phrases");

g_Cvar_PrintVotes = CreateConVar("sm_mapvote_printvotes", "0", "Should the option that a player vote on get printed (1 - yes print player votes, 0 - don't print).", _, true, 0.0, true, 1.0);
g_Cvar_ShowVotes = CreateConVar("sm_mapvote_showvotes", "3", "How many vote options the hint box should show. 0 will disable it", _, true, 0.0, true, 5.0);

g_VoteDuration = FindConVar("sm_mapvote_voteduration");

g_AllowedVoters = CreateArray(1);
}

public OnMapEnd_DisplayVote()
{
g_timer_ShowVotes = INVALID_HANDLE; // Being closed on mapchange: TIMER_FLAG_NO_MAPCHANGE
}

public OnClientDisconnect_DisplayVote(client)
{
// reset the clients vote
g_PlayerVotes[client] = -1;

// if client is allowed to vote then remove him (to fix max number of voters)
new index = FindValueInArray(g_AllowedVoters, client);
if (index > -1)
{
RemoveFromArray(g_AllowedVoters, index);
}

// if we display vote then update it
if (GetConVarBool(g_Cvar_ShowVotes) && g_timer_ShowVotes != INVALID_HANDLE)
{
TriggerTimer(g_timer_ShowVotes);
}
}

public VoteAction(Handle:menu, MenuAction:action, param1, param2)
{
switch(action)
{
case MenuAction_VoteStart:
{
VoteStarted();
if (GetConVarBool(g_Cvar_ShowVotes))
{
if (g_timer_ShowVotes == INVALID_HANDLE)
{
g_timer_ShowVotes = CreateTimer(0.95, ShowVoteProgress, menu, TIMER_REPEAT | TIMER_FLAG_NO_MAPCHANGE);
}
TriggerTimer(g_timer_ShowVotes);
}
}

case MenuAction_Select:
{
if (GetConVarBool(g_Cvar_PrintVotes))
{
decl String:name[CLIENT_MAX_LENGTH], String:option[ITEM_MAX_LENGTH];
GetClientName(param1, name, sizeof(name));
GetMenuItem(menu, param2, option, 0, _, option, sizeof(option));

PrintToChatAll("[SM] %t", "Vote Select", name, option);
}
if (GetConVarBool(g_Cvar_ShowVotes))
{
g_PlayerVotes[param1] = param2;
TriggerTimer(g_timer_ShowVotes);
}
}
}
}

VoteStarted()
{
// reset all votes
for (new i = 0; i <= MAXPLAYERS ; i++)
{
g_PlayerVotes = -1;
}

// set clients allowed to vote
ClearArray(g_AllowedVoters);
for (new i = GetMaxClients(); i > 0; i--)
if (IsClientInGame(i) && !IsFakeClient(i))
PushArrayCell(g_AllowedVoters, i);

g_VoteTimeStart2 = GetTime();
}

public VoteEnded(const String:voteEndInfo[])
{
if (g_timer_ShowVotes != INVALID_HANDLE)
{
KillTimer(g_timer_ShowVotes);
g_timer_ShowVotes = INVALID_HANDLE;
}
PrintHintTextToAll(voteEndInfo);
}

/**
* Show/updates the hintbox with current vote status
* ex.
*
Next map: (3/7) - 17 s
1. de_dust2 - 2
2. de_nuke -1
*/
public Action:ShowVoteProgress(Handle:timer, Handle:menu)
{
if (menu == INVALID_HANDLE) return Plugin_Continue;

decl String:hintboxText[1024];
decl String:option[ITEM_MAX_LENGTH];
decl String:formatBuffer[256];
decl String:translation_buffer[256];

// <title> - <timeleft>
//GetMenuTitle(menu, hintboxText, sizeof(hintboxText));
Format(translation_buffer, sizeof(translation_buffer),"%T", "Number Of Votes", LANG_SERVER);
Format(hintboxText, sizeof(hintboxText), "%s (%i/%i) - %is", translation_buffer, GetNrReceivedVotes(), GetArraySize(g_AllowedVoters), VoteTimeRemaining());

// <X>. <option>
new nrItems = GetMenuItemCount(menu);
new itemIndex[nrItems];
new itemVotes[nrItems];
GetItemsSortedByVotes(itemIndex, itemVotes, nrItems);

new displayNrOptions = GetConVarInt(g_Cvar_ShowVotes) >= nrItems ? nrItems : GetConVarInt(g_Cvar_ShowVotes);
for (new i = 1; i <= displayNrOptions; i++)
{
if (itemVotes[i-1] > 0)
{
GetMenuItem(menu, itemIndex[i-1], option, 0, _, option, sizeof(option));

new percent = ((itemVotes[i-1] * 100) / GetNrReceivedVotes());

Format(formatBuffer, sizeof(formatBuffer), "%T", "Vote Progress", LANG_SERVER, i, option, itemVotes[i-1], percent);
StrCat(hintboxText, sizeof(hintboxText), formatBuffer);
}
else
break;
}
new Handle:hBuffer = StartMessageAll("KeyHintText");
BfWriteByte(hBuffer, 1);
BfWriteString(hBuffer, hintboxText);
EndMessage();

return Plugin_Continue;
}

/**
* @return timeleft (remaining) of vote.
*/
VoteTimeRemaining()
{
new remainingTime = g_VoteTimeStart2 + GetConVarInt(g_VoteDuration) - GetTime();
if (remainingTime < 0)
{
return 0;
}
else
{
return remainingTime;
}
}

/**
* Returns a list of all items (their index) and number of votes on each, ordered by nr of received votes in descending order
*/
GetItemsSortedByVotes(itemIndex[], itemVotes[], nrOfItems)
{
// Get nr of votes on each item
new votesOnItem[nrOfItems+1]; // simplify by increasing by one and having index 0 being "not voted"
for (new i = 0; i <= MAXPLAYERS; i++)
{
votesOnItem[g_PlayerVotes+1]++;
}

// simple insertion sort
new mostVotes, index;
for (new i = 0; i < nrOfItems; i++)
{
mostVotes = -1;
for (new j = 1; j <= nrOfItems; j++)
{
if (votesOnItem[j] > mostVotes)
{
mostVotes = votesOnItem[j];
index = j;
}
}

itemIndex = index-1;
itemVotes = mostVotes;

// make sure it will not be selected again
votesOnItem[index] = -1;
}
}

/**
* @return return the total nr of votes received
*/
GetNrReceivedVotes()
{
new nrVotes = 0;
for (new i = GetMaxClients(); i > 0; i--)
{
if(g_PlayerVotes > -1)
nrVotes++;
}
return nrVotes;
}
где тут косяк? пожалуйста помогите правильно зделать!


Ребят а можно ечо убрать стороку в ccs ну когда ты В своего стреляешь пишит типа
Bro attacked a teammate можно ее какнебуть убратЬ?????
 
Последнее редактирование:

_Lexa_

Участник
Сообщения
846
Реакции
260
1 Warning почти на каждом плагине
 

ferest2

Участник
Сообщения
52
Реакции
3
Ребят помогите пожалусто с mapchooser_extended_1.4.1
 

Cmapuk

Yes of course
Сообщения
11
Реакции
2
basevotes.sp
basetriggers.sp
common.sp
Вот тут у тебя не отредактировано - на скине же видишь, что у тебя голосования по центру идёт, Вот он пытается поделит твой голосования на две части, от этого косяк.
Ищи проблему в тех файлах
 
Последнее редактирование:

reset-full

Участник
Сообщения
33
Реакции
9
Ладно, раз пошла такая песня чтоб несоздавать новой темы отпишусь сдесь.Тоже плаг антитк начал выдавать ошибку:
L 11/27/2011 - 14:35:44: [SM] Native "LogToGame" reported: Client index 260 is invalid
L 11/27/2011 - 14:35:44: [SM] Displaying call stack trace for plugin "antitk.smx":
L 11/27/2011 - 14:35:44: [SM] [0] Line 2046, antitk.sp::ForgivePlayer()
L 11/27/2011 - 14:35:44: [SM] [1] Line 1911, antitk.sp::PunishmentMenuSelected()
L 11/27/2011 - 14:45:08: Error log file session closed.
Сервер v34:
SourceMod 1.4.0
MetaMod 1.8.7V
SDK Hooks 2.1.0
 

Cmapuk

Yes of course
Сообщения
11
Реакции
2
Ладно, раз пошла такая песня чтоб несоздавать новой темы отпишусь сдесь.Тоже плаг антитк начал выдавать ошибку:
L 11/27/2011 - 14:35:44: [SM] Native "LogToGame" reported: Client index 260 is invalid
L 11/27/2011 - 14:35:44: [SM] Displaying call stack trace for plugin "antitk.smx":
L 11/27/2011 - 14:35:44: [SM] [0] Line 2046, antitk.sp::ForgivePlayer()
L 11/27/2011 - 14:35:44: [SM] [1] Line 1911, antitk.sp::PunishmentMenuSelected()
L 11/27/2011 - 14:45:08: Error log file session closed.
Сервер v34:
SourceMod 1.4.0
MetaMod 1.8.7V
SDK Hooks 2.1.0

а если не секрет то, что у тебя там в extensions лежит?
прост у меня ошибка тоже по началу была только из-за того что там не было (socket.ext.dll)
попробуй переустановить plugens antitk
 

reset-full

Участник
Сообщения
33
Реакции
9
Cmapuk, в том то и дело сейчас например нет этой ошибки.потом хрясть вылезет.И так раз в три дня то нет то есть)
 
Сверху Снизу