OciXCrom's Rank System [XP|Levels|Ranks]

Одобрените от нас плъгини. Моля, докладвайте ако забележите бъг с някой от плъгините в този раздел.
Аватар
Guardian Angel
Извън линия
VIP
VIP
Мнения: 186
Регистриран на: 18 Окт 2016, 02:00
Местоположение: Петрич
Се отблагодари: 1 път
Получена благодарност: 22 пъти

OciXCrom's Rank System [XP|Levels|Ranks]

Мнение от Guardian Angel » 08 Мар 2019, 07:36

It's writen in some of Ocix posts with information for sql version. Just create new table with SQL_TABLE and after that u can take all the information from the previous table with command crxranks_update_mysql CRXRanks ( CRXRanks is your old table name, if you chaged that name just put yours) . You have to put this command in server console, if you dont have acces to it you have to write amx_rcon crxranks_update_mysql CRXRanks in your CStrike client.

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

OciXCrom's Rank System [XP|Levels|Ranks]

Мнение от OciXCrom » 08 Мар 2019, 20:12

Guardian Angel написа: 08 Мар 2019, 07:36 It's writen in some of Ocix posts with information for sql version. Just create new table with SQL_TABLE and after that u can take all the information from the previous table with command crxranks_update_mysql CRXRanks ( CRXRanks is your old table name, if you chaged that name just put yours) . You have to put this command in server console, if you dont have acces to it you have to write amx_rcon crxranks_update_mysql CRXRanks in your CStrike client.
No, that command does a completely different thing.

I didn't upload such a plugin yet. I started making it, but I didn't really test it out. If you want, you can test it:

Код за потвърждение: Избери целия код

#include <amxmodx>
#include <crxranks>
#include <nvault_util>
#include <sqlx>

#define PLUGIN_VERSION "1.0"

new g_szTable[32], Handle:g_iTuple

public plugin_init()
{
	register_plugin("CRXRanks: nVault to MySQL", PLUGIN_VERSION, "OciXCrom")
	register_cvar("CRXRanksTransfer", PLUGIN_VERSION, FCVAR_SERVER|FCVAR_SPONLY|FCVAR_UNLOGGED)
	register_srvcmd("crxranks_nvault_to_mysql", "Cmd_Transfer")
}

public Cmd_Transfer()
{
	static bUsed

	if(bUsed)
	{
		server_print("Data has already been transfered once during this map. There's no point in transfering it again.")
		return PLUGIN_HANDLED
	}

	new szHost[32], szUser[32], szPassword[32], szDatabase[32]
	crxranks_get_setting("SQL_HOST", szHost, charsmax(szHost))
	crxranks_get_setting("SQL_USER", szUser, charsmax(szUser))
	crxranks_get_setting("SQL_PASSWORD", szPassword, charsmax(szPassword))
	crxranks_get_setting("SQL_DATABASE", szDatabase, charsmax(szDatabase))
	crxranks_get_setting("SQL_TABLE", g_szTable, charsmax(g_szTable))

	g_iTuple = SQL_MakeDbTuple(szHost, szUser, szPassword, szDatabase)

	new szVault[32]
	crxranks_get_setting("VAULT_NAME", szVault, charsmax(szVault))

	new iVault = nvault_util_open(szVault)
	nvault_util_readall(iVault, "OnVaultRead")
	nvault_util_close(iVault)
	bUsed = true

	return PLUGIN_HANDLED
}

public OnVaultRead(iCurrent, iNumEntries, szKey[], szValue[], iTimeStamp, iData, iSize)
{
	static szQuery[128]
	formatex(szQuery, charsmax(szQuery), "INSERT INTO %s (`Player`,`XP`,`Level`,`Next XP`,`Rank`,`Next Rank`) VALUES ('%s','%s','1','0','n/a','n/a');", g_szTable, szKey, szValue)
	SQL_ThreadQuery(g_iTuple, "QueryHandler", szQuery)
}

public QueryHandler(iFailState, Handle:iQuery, szError[], iErrorCode)
{
	if(iFailState == TQUERY_CONNECT_FAILED || iFailState == TQUERY_QUERY_FAILED)
	{
		server_print(szError)
	}
}
The command is crxranks_nvault_to_mysql. It will take the data from the nVault file that is set in the VAULT_NAME setting and will transfer it to the table set in the SQL_TABLE setting. This proccess may take a while if you have many players in the file.

Аватар
Kobra
Извън линия
Foreigner
Foreigner
Мнения: 20
Регистриран на: 06 Ное 2018, 20:55
Се отблагодари: 1 път
Получена благодарност: 1 път

OciXCrom's Rank System [XP|Levels|Ranks]

Мнение от Kobra » 09 Мар 2019, 22:48

Getting this error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''n/a' at line 1

Guess it's related to rank and next rank columns...
http://prntscr.com/mvmrvv

EDIT: In the end it worked,the error was just a warning. Thank you !

Аватар
Kobra
Извън линия
Foreigner
Foreigner
Мнения: 20
Регистриран на: 06 Ное 2018, 20:55
Се отблагодари: 1 път
Получена благодарност: 1 път

OciXCrom's Rank System [XP|Levels|Ranks]

Мнение от Kobra » 13 Мар 2019, 01:19

Hey @OciXCrom is it possible to also make the ranks multilang?

Аватар
OciXCrom
Извън линия
Администратор
Администратор
Мнения: 7206
Регистриран на: 06 Окт 2016, 19:20
Местоположение: /resetscore
Се отблагодари: 117 пъти
Получена благодарност: 1295 пъти
Обратна връзка:

OciXCrom's Rank System [XP|Levels|Ranks]

Мнение от OciXCrom » 13 Мар 2019, 21:11

Kobra написа: 13 Мар 2019, 01:19 Hey @OciXCrom is it possible to also make the ranks multilang?
It's possible, but I don't think it's a good idea, at least not for the main plugin. It would be much harder for people to manage the ranks that way and usually most names can't be translated to other languages properly, so it's better to use just one.

Аватар
Kobra
Извън линия
Foreigner
Foreigner
Мнения: 20
Регистриран на: 06 Ное 2018, 20:55
Се отблагодари: 1 път
Получена благодарност: 1 път

OciXCrom's Rank System [XP|Levels|Ranks]

Мнение от Kobra » 13 Мар 2019, 21:28

OciXCrom написа: 13 Мар 2019, 21:11
Kobra написа: 13 Мар 2019, 01:19 Hey @OciXCrom is it possible to also make the ranks multilang?
It's possible, but I don't think it's a good idea, at least not for the main plugin. It would be much harder for people to manage the ranks that way and usually most names can't be translated to other languages properly, so it's better to use just one.
I got it ; I am facing some problems with the MySQL saving type right now as it connected to the mysql database once but every few minutes the connection drops and players ranks get resetted . I contacted the hosting company and they said it's not from their side , also I am using fresh bans with continuous connection with the same database just fine. Can the connection drop be caused by the plugin itself?

Аватар
FFiiinnggeerrr
Извън линия
Потребител
Потребител
Мнения: 30
Регистриран на: 30 Апр 2017, 23:48
Получена благодарност: 1 път

OciXCrom's Rank System [XP|Levels|Ranks]

Мнение от FFiiinnggeerrr » 05 Апр 2019, 22:15

има ли команда да дава xp при убийство на съотборник

Аватар
SkandaU
Извън линия
Потребител
Потребител
Мнения: 213
Регистриран на: 09 Яну 2017, 12:37
Се отблагодари: 45 пъти
Получена благодарност: 22 пъти

OciXCrom's Rank System [XP|Levels|Ranks]

Мнение от SkandaU » 05 Апр 2019, 22:40

OciXCrom написа: 24 Юни 2018, 21:11


"Погледнете този линк за да намерите всички ключови думи достъпни в плъгина."
Изображение

Аватар
Awake
Извън линия
Потребител
Потребител
Мнения: 75
Регистриран на: 01 Окт 2018, 14:25
Се отблагодари: 2 пъти
Получена благодарност: 3 пъти

OciXCrom's Rank System [XP|Levels|Ranks]

Мнение от Awake » 17 Апр 2019, 01:03

Настроих всичко, заместих кода във ChatManager със този код

Код за потвърждение: Избери целия код

format_admin = $dead_prefix$ &x04[$rank$] $admin_prefix$ &x03$custom_name$ &x01: $chat_color$$message$
format_admin_team = $dead_prefix$ ($team$) &x04[$rank$] $admin_prefix$ &x03$custom_name$ &x01: $chat_color$$message$
format_player = $dead_prefix$ &x04[$rank$] &x03$custom_name$ &x01: $chat_color$$message$
format_player_team = $dead_prefix$ ($team$) &x04[$rank$] &x03$custom_name$ &x01: $chat_color$$message$
Сложих Chat Manager, но когато тествах в чата излиза само това "[] [Head Admin] Beware : d"

Другия проблем е, че не запазва XP-то когато си дадох с командата и написах /xp, всичко е ок "[CRXRanks] You have 100 XP. Your rank is #0: . You are on the final level", но когато реконектна, "[CRXRanks] You have 0 XP. Your rank is #0: . You are on the final level", настроих го да запазва хп, чрез IP, но пак не става?

Аватар
illusion
Извън линия
Developer
Developer
Мнения: 1796
Регистриран на: 27 Ное 2016, 17:47
Местоположение: CraftVision
Се отблагодари: 151 пъти
Получена благодарност: 358 пъти
Обратна връзка:

OciXCrom's Rank System [XP|Levels|Ranks]

Мнение от illusion » 17 Апр 2019, 09:55

Пробвай да поставиш rank system плъгина под chat manager-a

Публикувай отговор
  • Подобни теми
    Отговори
    Преглеждания
     Последно мнение

Обратно към “Одобрени плъгини”

Кой е на линия

Потребители разглеждащи този форум: Bing [Bot] и 14 госта