Иконка ресурса

Maxim Zotkin

Участник
Сообщения
2
Реакции
0
!resetscore

Привет всем такая проблема,добавил плагин !resetscore когда ты мертв он пишет что ,,нельзя сбросить пока вы мертвы,, когда я жив и сщет равен допустим 1:0 то ничего не происходит
 

legend1998

Участник
Сообщения
286
Реакции
187
Re: !resetscore

Привет всем такая проблема,добавил плагин !resetscore когда ты мертв он пишет что ,,нельзя сбросить пока вы мертвы,, когда я жив и сщет равен допустим 1:0 то ничего не происходит
...
 

Вложения

  • Resetscore.smx
    3.5 КБ · Просмотры: 20

legend1998

Участник
Сообщения
286
Реакции
187
Re: [CS:S] Resetscore v.1.1

legend1998, как-то немного криво пошел...:
Кодировку, случайно, не забыл поменять?
0a1a17648f46.png

Оффтоп
 

Вложения

  • Resetscore.smx
    3.6 КБ · Просмотры: 35

qwertyfox

Участник
Сообщения
3
Реакции
0
Re: [CS:S] Resetscore v.1.1

Удалил эту строку из плагина: PrintToChatAll( "\x03[SM Resetscore] %s has just reseted his score.", Name );.

Теперь во время компиляции вылазит "warning 204":
fz2zoiY4.jpg
Вот сам плагин:
#include <sourcemod>
#include <sdktools>

#define PLUGIN_AUTHOR "tuty"
#define PLUGIN_VERSION "1.1"
#pragma semicolon 1

new Handle:gPluginEnabled = INVALID_HANDLE;

public Plugin:myinfo =
{
name = "Resetscore",
author = PLUGIN_AUTHOR,
description = "Type !resetscore in chat to reset your score.",
version = PLUGIN_VERSION,
url = "www.ligs.us"
};
public OnPluginStart()
{
RegConsoleCmd( "say", CommandSay );
RegConsoleCmd( "say_team", CommandSay );

gPluginEnabled = CreateConVar( "sm_resetscore", "1" );
CreateConVar( "resetscore_version", PLUGIN_VERSION, "Reset Score", FCVAR_PLUGIN | FCVAR_SPONLY | FCVAR_REPLICATED | FCVAR_NOTIFY );
}
public Action:CommandSay( id, args )
{
decl String:Said[ 128 ];
GetCmdArgString( Said, sizeof( Said ) - 1 );
StripQuotes( Said );
TrimString( Said );

if( StrEqual( Said, "!rs" ) || StrEqual( Said, "!кы" ))
{
if( GetClientDeaths( id ) == 0 && GetClientFrags( id ) == 0 )
{
PrintToChat( id, "\x04[RS] \x01Ваш счет итак равен нулю!" );
PrintToConsole( id, "[RS] Ваш счет итак равен нулю!" );

return Plugin_Continue;
}

SetClientFrags( id, 0 );
SetClientDeaths( id, 0 );

decl String:Name[ 32 ];
GetClientName( id, Name, sizeof( Name ) - 1 );

PrintToChat( id, "\x04[RS] \x01Вы успешно обнулили свой счет!" );
PrintToChatAll( "\x03[SM Resetscore] %s has just reseted his score.", Name );
PrintToConsole( id, "[RS] Вы успешно обнулили свой счет!" );
}

return Plugin_Continue;
}
stock SetClientFrags( index, frags )
{
SetEntProp( index, Prop_Data, "m_iFrags", frags );
return 1;
}
stock SetClientDeaths( index, deaths )
{
SetEntProp( index, Prop_Data, "m_iDeaths", deaths );
return 1;
}

В чем проблема? Помогите разобраться.
 

legend1998

Участник
Сообщения
286
Реакции
187
Re: [CS:S] Resetscore v.1.1

Удали:
new Handle:gPluginEnabled = INVALID_HANDLE;
и
gPluginEnabled = CreateConVar( "sm_resetscore", "1" );

И эта ошибка, думаю, не принесет вреда...
Связано с тем, что Cvar gPluginEnabled нигде не используется.
 
Последнее редактирование:

The End Is Near...

Russian Roulette
Сообщения
874
Реакции
691
Re: [CS:S] Resetscore v.1.1

Упрощенная версия плагина
PHP:
#include <sourcemod>

public Plugin:myinfo =
{
	name = "Resetscore",
	author = "tuty",
	version = "1.1"
};

public OnPluginStart()
{
	RegConsoleCmd("rs", CallBack);
	RegConsoleCmd("resetscore", CallBack);
}

public Action:CallBack(client, args)
{
	if (client > 0)
	{
		if (GetClientDeaths(client) == 0 && GetClientFrags(client) == 0)
		{
			PrintToChat(client, "\x01\x05[RESET Score] \x03Повторное обнуление счета запрещено!");
		}
		else
		{
			SetEntProp(client, Prop_Data, "m_iDeaths", 0);
			SetEntProp(client, Prop_Data, "m_iFrags", 0);
			PrintToChat(client, "\x01\x05[RESET Score] \x03Ваши Убийства и Смерти были успешно обнулены!");
		}
	}
	return Plugin_Handled;
}
 
Последнее редактирование:

Danger1

Участник
Сообщения
9
Реакции
0
Re: [CS:S] Resetscore v.1.1

как сделать чтобы у мёртвых тоже счёт обновлялся
 

SenatoR

Участник
Сообщения
773
Реакции
344
Re: [CS:S] Resetscore v.1.1

Кодировку UTF-8 без BOM?
 

runner

Участник
Сообщения
20
Реакции
0
Re: [CS:S] Resetscore v.1.1

Народ Помогите Исправить Вот Эту Ошибку:
/home/groups/sourcemod/upload_tmp/php0ofJkQ.sp(42) : warning 217: loose indentation
/home/groups/sourcemod/upload_tmp/php0ofJkQ.sp(51) : warning 217: loose indentation

Вот исходник:

#include <sourcemod>
#include <sdktools>

#define PLUGIN_AUTHOR "tuty,Runner"
#define PLUGIN_VERSION "1.1"
#pragma semicolon 1

public Plugin:myinfo =
{
name = "Resetscore",
author = PLUGIN_AUTHOR,
description = "Type !resetscore in chat to reset your score.",
version = PLUGIN_VERSION,
url = "www.sourcemod.net"
};
public OnPluginStart()
{

RegConsoleCmd( "say", CommandSay );
RegConsoleCmd( "say_team", CommandSay );

}
public Action:CommandSay( id, args )
{
if(!id || !IsClientInGame(id))
return Plugin_Continue;


decl String:Said[ 128 ];
GetCmdArgString( Said, sizeof( Said ) - 1 );
StripQuotes( Said );
TrimString( Said );

if( id && StrEqual( Said, "!rs" ) || StrEqual( Said, "!resetscore" ) || StrEqual( Said, "!rdk" )
|| StrEqual( Said, "!кы" ) || StrEqual( Said, "!куыуеысщку" ) || StrEqual( Said, "!квл" )
|| StrEqual( Said, "!сброс" ) || StrEqual( Said, "!сброс счета" ) )
{
if( GetClientDeaths( id ) == 0 && GetClientFrags( id ) == 0 )
{
PrintToChat( id, "\x03[SM Resetscore] \x01Ваш счёт и так \x04[0:0]" );

return Plugin_Continue;
}

SetClientFrags( id, 0 );
SetClientDeaths( id, 0 );

decl String:Name[ 32 ];
GetClientName( id, Name, sizeof( Name ) - 1 );

PrintToChat( id, "\x03[SM Resetscore] \x01Вы успешно обнулили свой счёт" );
PrintToChatAll( "\x03[SM Resetscore] \x04%s \x01обнулил свой счёт.", Name );
}

return Plugin_Continue;
}
stock SetClientFrags( index, frags )
{
SetEntProp( index, Prop_Data, "m_iFrags", frags );
return 1;
}
stock SetClientDeaths( index, deaths )
{
SetEntProp( index, Prop_Data, "m_iDeaths", deaths );
return 1;
}
 
Последнее редактирование модератором:

★Сириус★

Участник
Сообщения
743
Реакции
197
Re: [CS:S] Resetscore v.1.1

Немного подправил плагин..
Надеюсь будет работать =)

Список изменений:
1. Команды ввода:
  • !rs
  • !resetscore
  • !кы
  • !куыуеысщку
  • !restartscore

2. Добавлены квары
  • Включение = 1 / отключение = 0 показа сообщений сброса счета всем игрокам
  • Включение = 1 / отключение = 0 показа сообщений помощи в конце раунда
  • Включение = 1 / отключение = 0 показа сообщений помощи в начале раунда
  • Включение = 1/ отключение = 0 возможности сброса счета мертвым

3. Добавлен файл перевода (Только ru ;) )
4. Выведен конфиг

Ну вот и все вроде =)

плагин понравился, но там ошибки пишет мне в логах,
PHP:
L 01/29/2013 - 19:56:13: [SM] Plugin encountered error 4: Invalid parameter or parameter type
L 01/29/2013 - 19:56:13: [SM] Native "VFormat" reported: Language phrase "RS All Chat Reset" not found
L 01/29/2013 - 19:56:13: [SM] Displaying call stack trace for plugin "Resetscore.smx":
L 01/29/2013 - 19:56:13: [SM]   [0]  Line 293, D:\Servers\SERVERS\Russian Roulette Server\css\cstrike\addons\sourcemod\scripting\include\halflife.inc::PrintToChatAll()
L 01/29/2013 - 19:56:13: [SM]   [1]  Line 89, D:\Servers\SERVERS\Russian Roulette Server\css\cstrike\addons\sourcemod\scripting\Resetscore.sp::CommandSay()

поправьте плиз
 

★Сириус★

Участник
Сообщения
743
Реакции
197
Re: [CS:S] Resetscore v.1.1

это я понял, там походу формат нужно вписать еще, перевод этой фразы выглядит так, он видмо это %s не определяет, сверху надо чето формат и чето еще дописать, незнаю что

PHP:
	"RS All Chat Reset"
	{
		"ru"	"Игрок %s сбросил счет!"
	}
 

★Сириус★

Участник
Сообщения
743
Реакции
197
Re: [CS:S] Resetscore v.1.1

вот про это я и говорил, спасибо
нужно еще здесь перезалить файл перевода http://hlmod.ru/forum/showpost.php?p=75982&postcount=87

Добавлено через 25 минут
ни фига ни чего не изменилось
PHP:
L 01/29/2013 - 22:04:18: [SM] Plugin encountered error 4: Invalid parameter or parameter type
L 01/29/2013 - 22:04:18: [SM] Native "VFormat" reported: Language phrase "RS All Chat Reset" not found
L 01/29/2013 - 22:04:18: [SM] Displaying call stack trace for plugin "Resetscore.smx":
L 01/29/2013 - 22:04:18: [SM]   [0]  Line 293, D:\Servers\SERVERS\Russian Roulette Server\css\cstrike\addons\sourcemod\scripting\include\halflife.inc::PrintToChatAll()
L 01/29/2013 - 22:04:18: [SM]   [1]  Line 89, D:\Servers\SERVERS\Russian Roulette Server\css\cstrike\addons\sourcemod\scripting\Resetscore.sp::CommandSay()

Добавлено через 2 часа 36 минут
самый прикол в том, что он в чате отображает эту фразу корректно, но в логах такую хрень пишет
 
Последнее редактирование:

The End Is Near...

Russian Roulette
Сообщения
874
Реакции
691
Re: [CS:S] Resetscore v.1.1

Оу.. Плагин не красив, попробую переделать на днях.
 

Slavik)))))

Участник
Сообщения
306
Реакции
484
Re: [CS:S] Resetscore v.1.1

В оригинале, наш соотечественник уже выложил версию 1.5

Full CS:GO support
Now can reset money in CS:S and CS:GO. The feature can be turned off in config. Also amount of money can be set by CVAR. Money will not reset, if player has less, then set by CVAR.
According to past info, I added two CVARs: sm_resetscore_reset_money and sm_resetscore_money_on_reset
Some code improvements and cleanup
PHP:
Code:
// This file was auto-generated by SourceMod
// ConVars for plugin "resetscore.smx"


// Plugin enabled or not
// -
// Default: "1"
sm_resetscore_enabled "1"

// Amount of money given to player after Score reset
// -
// Default: "800"
sm_resetscore_money_on_reset "800"

// If this is '1' and player resets his score, then print to common chat. Else print to player chat only.
// -
// Default: "1"
sm_resetscore_print_to_all "1"

// Reset player money or not
// -
// Default: "1"
sm_resetscore_reset_money "1"

Для CS GO необходим Sourcemod 1.5.0-dev-hg3707! и выше.
 
Сверху Снизу