Skip to content

Commit

Permalink
Merge pull request #51 from ShadowsAdi/implement-music-kits
Browse files Browse the repository at this point in the history
Implement `Music Kits` as a `MVP` alternative
  • Loading branch information
ShadowsAdi authored Sep 8, 2024
2 parents e50c99b + 4ea0fd3 commit 98e20e6
Show file tree
Hide file tree
Showing 14 changed files with 3,335 additions and 38 deletions.
4 changes: 2 additions & 2 deletions addons/amxmodx/configs/csgor_configs.ini
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,6 @@
"Deagle" "26"
"P90" "30"


[Main Menu]
; Example of menus:
; "Menu Name" "Menu open Command"
Expand All @@ -325,9 +324,10 @@
"CSGOR_MM_OPEN_CRAFT" "opencase"
"CSGOR_MM_MARKET" "market"
"CSGOR_MM_GIVEAWAY" "giveaway"
"CSGOR_MM_MVP" "mvp_menu"
"CSGOR_MM_GAMES" "games"
"CSGOR_MM_DUSTBIN" "dustbin"
"CSGOR_MM_GIFT_TRADE" "gift"
"CSGOR_MM_GAMES" "games"

[SKIP FROM CHAT]
; In this section you can enter strings or characters which you want to be skipped from showing in chat!
Expand Down
60 changes: 60 additions & 0 deletions addons/amxmodx/configs/csgor_mvp.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
[TRACKS SECTION]
# Tracks must be in .mp3 format
# "Track Name" "Track Path" "Only for VIP" "Track Cost"
# Ex: "TRACK #1" "sound/mvp_otr/track1.mp3" "0" "1000"
"Janji - Heroes Tonight" "sound/csgor_mvp/heroes_tonight.wav" "0" "100"
"Cartoon, Jeja - On & On" "sound/csgor_mvp/on_and_on.wav" "0" "150"
"DEAF KEV - Invincible" "sound/csgor_mvp/invincible.wav" "1" "200"

[SETTINGS SECTION]
# Chat Prefix of MVP Message
CHAT_PREFIX = [{g}MVP{n}]

# Hud Prefix of MVP Message
HUD_PREFIX = [MVP]

# Menu Prefix
MENU_PREFIX = [MVP]

# How to save player's preferences: 0 = nVault | 1 = MySQL | 2 = SQLite
# If you want to use SQLite Database, you need to activate the "sqlite" module in modules.ini by removing ";"
SAVE_TYPE = 0

# Database informations
# For SQLite you need to remove password from SQL_PASS field.
SQL_HOST = localhost
SQL_USER = root
SQL_PASS = password
SQL_DATABASE = database
SQL_TABLE = mvp_otr

# Vault informations
NVAULT_DATABASE = mvp_otr

# Save player's data method:
# 0 = Save player's data on Name
# 1 = Save player's data on SteamID
AUTH_METHOD = 0

# Save player's data instant?: 0 = No | 1 = Yes
INSTANT_SAVE = 1

# Message type when MVP event is triggered
# 0 = Message is sent through chat
# 1 = Message is sent through DHUD channel ( recommended )
# 2 = Message is sent through HUD channel
MESSAGE_TYPE = 1

# HUD Color | R G B
HUD_COLOR = 0 255 0

# HUD Position | xOy Axis
HUD_POSITION = -1.0 0.26

# Commands to open the MVP Tracks Menu
# Commands must be splitted by ","
MENU_COMMANDS = say /mvp, say_team /mvp, mvp_menu

# Access for VIP Tracks
# Default: "t" / ADMIN_LEVEL_H
VIP_ACCESS = t
52 changes: 51 additions & 1 deletion addons/amxmodx/data/lang/csgor_language.txt
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,31 @@ CSGOR_ACCOUNT_REMOVED = Contul %s a fost sters
CSGOR_ACCOUNT_RESET_ITEM = Contului %s i-a fost resetat %s
CSOGR_ACCOUNT_NOT_FOUND = Contul %s nu a fost gasit!

MVP_MENU_TITLE = Meniu MVP
MVP_SHOW_MVP_COUNT = Ai fost de \r%d ori\y MVP\w!
MVP_SELECTED_TRACK = \yMelodia ta\d: \r%s
MVP_NOT_SELECTED = \yNu ai selectat nicio melodie!
MVP_CHOOSE_TRACK = Alege o melodie
MVP_TRACK_LIST = Vezi lista melodiilor
MVP_SOUNDS_ON_OFF = Sunete MVP: \y%s
MVP_TRACK_X_SELECTED = Ai selectat melodia: ^4%s
MVP_TRACK_X_DESELECTED = Ai deselectat melodia: ^4%s
MVP_TRACK_LIST_TITLE = Lista Melodiilor
MVP_KILLER_SHOW_CHAT = Jucatorul acestei runde: ^3%s^1 pentru ^4uciderea a %i jucatori.
MVP_KILLER_SHOW_HUD = Jucatorul acestei runde: %s pentru uciderea a %i jucatori.
MVP_DEFUSER_SHOW_CHAT = Jucatorul acestei runde: ^3%s^1 pentru ^4dezamorsarea bombei.
MVP_DEFUSER_SHOW_HUD = Jucatorul acestei runde: %s pentru dezamorsarea bombei.
MVP_PLANTER_SHOW_CHAT = Jucatorul acestei runde: ^3%s^1 pentru ^4plantarea bombei.
MVP_PLANTER_SHOW_HUD = Jucatorul acestei runde: %s pentru plantarea bombei.
NO_MVP_SHOW_CHAT = Jucatorul acestei runde: ^3Niciun Jucator^1 nu a fost destul de ^4bun aceasta runda.
NO_MVP_SHOW_HUD = Jucatorul acestei runde: Niciun Jucator nu a fost destul de bun aceasta runda.
MVP_NO_TRACKS_LOADED =Nicio melodie incarcata.
MVP_VIP_ONLY = \r[Doar VIP]
MVP_TRACK_VIP_ONLY = Aceasta melodie este doar pentru membri ^4V.I.P^1.
MVP_PLAYING_TRACK = Asculti melodia:
MVP_BUY_SUCCESS = ^1Ai cumparat melodia ^4%s^1 cu ^4%d^1 puncte.
MVP_BUY_FAILED = ^1Nu ai destule puncte pentru a cumpara ^4%s. Detii %d/%d puncte.

[en]
CSGOR_NO_DROP_SKINS = There are no drop type skins!
CSGOR_NO_CRAFT_SKINS = There are no craft type skins!
Expand Down Expand Up @@ -639,4 +664,29 @@ CSGOR_INVALID_ARGUMENT = Invalid argument number %d: %s
CSGOR_ACCOUNT_RESET = Account %s has been reset
CSGOR_ACCOUNT_REMOVED = Account %s has been removed
CSGOR_ACCOUNT_RESET_ITEM = Account's %s got %s reset
CSOGR_ACCOUNT_NOT_FOUND = Account %s has not been found!
CSOGR_ACCOUNT_NOT_FOUND = Account %s has not been found!

MVP_MENU_TITLE = MVP Menu
MVP_SHOW_MVP_COUNT = You were \r%d times\y MVP\w!
MVP_SELECTED_TRACK = \yYour track\d: \r%s
MVP_NOT_SELECTED = \yYou don't have any selected track!
MVP_CHOOSE_TRACK = Choose a track
MVP_TRACK_LIST = Preview Tracks list
MVP_SOUNDS_ON_OFF = MVP Sounds: \y%s
MVP_TRACK_X_SELECTED = You have selected the track: ^4%s
MVP_TRACK_X_DESELECTED = You have deselected the track: ^4%s
MVP_TRACK_LIST_TITLE = Tracks List
MVP_KILLER_SHOW_CHAT = Player of the round: ^3%s^1 for ^4killing %i players.
MVP_KILLER_SHOW_HUD = Player of the round: %s for killing %i players.
MVP_DEFUSER_SHOW_CHAT = Player of the round: ^3%s^1 for ^4defusing the bomb.
MVP_DEFUSER_SHOW_HUD = Player of the round: %s for defusing the bomb.
MVP_PLANTER_SHOW_CHAT = Player of the round: ^3%s^1 for ^4planting the bomb.
MVP_PLANTER_SHOW_HUD = Player of the round: %s for planting the bomb.
NO_MVP_SHOW_CHAT = Player of the round: ^3No Player^1 was ^4good enough this round.
NO_MVP_SHOW_HUD = Player of the round: No Player was good enough this round.
MVP_NO_TRACKS_LOADED = No tracks loaded.
MVP_VIP_ONLY = \r[VIP Only]
MVP_TRACK_VIP_ONLY = This track is only for ^4V.I.P^1 members.
MVP_PLAYING_TRACK = Playing Track:
MVP_BUY_SUCCESS = ^1You have succesfully bought ^4%s^1 with ^4%d^1 points.
MVP_BUY_FAILED = ^1You don't have enough points to buy ^4%s. You have %d/%d
55 changes: 30 additions & 25 deletions addons/amxmodx/scripting/csgo_remake.sma
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
/* DO NOT MODIFY THIS LIME. */
#pragma dynamic MAX_SKINS * 17

#define PLUGIN "CS:GO Remake"
#define VERSION "2.3.2"
#define PLUGIN "[CS:GO Remake] Core"
#define VERSION "2.3.3"
#define AUTHOR "Shadows Adi"

#define CSGO_TAG "[CS:GO Remake]"
Expand Down Expand Up @@ -1249,7 +1249,7 @@ RegisterForwards()
g_iForwards[ user_register ] = CreateMultiForward("csgor_user_register", ET_IGNORE, FP_CELL)
g_iForwards[ user_pass_fail ] = CreateMultiForward("csgor_user_password_failed", ET_IGNORE, FP_CELL, FP_CELL)
g_iForwards[ user_assist ] = CreateMultiForward("csgor_user_assist", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL, FP_CELL)
g_iForwards[ user_mvp ] = CreateMultiForward("csgor_user_mvp", ET_IGNORE, FP_CELL, FP_CELL, FP_CELL)
g_iForwards[ user_mvp ] = CreateMultiForward("csgor_user_mvp", ET_CONTINUE, FP_CELL, FP_CELL, FP_CELL)
g_iForwards[ user_case_opening ] = CreateMultiForward("csgor_user_case_open", ET_IGNORE, FP_CELL)
g_iForwards[ user_craft ] = CreateMultiForward("csgor_user_craft", ET_IGNORE, FP_CELL)
g_iForwards[ user_level_up ] = CreateMultiForward("csgor_user_levelup", ET_IGNORE, FP_CELL, FP_STRING, FP_CELL)
Expand Down Expand Up @@ -1841,24 +1841,24 @@ public task_Check_Conditions(data[])
{
if (g_bBombExplode)
{
_ShowMVP(g_iBombPlanter, 1)
_ShowMVP(g_iBombPlanter, MVP_PLANTER)
}
else
{
new top1 = _GetTopKiller(1)
_ShowMVP(top1, 0)
_ShowMVP(top1, MVP_KILLER)
}
}
case 2:
{
if (g_bBombDefused)
{
_ShowMVP(g_iBombDefuser, 2)
_ShowMVP(g_iBombDefuser, MVP_DEFUSER)
}
else
{
new top1 = _GetTopKiller(2)
_ShowMVP(top1, 0)
_ShowMVP(top1, MVP_KILLER)
}
}
}
Expand Down Expand Up @@ -2721,8 +2721,12 @@ public QueryPlayerLoadedSkins(iFailState, Handle:iQuery, Error[], Errcode, szDat
}
}

client_print_color(id, print_chat, "^4%s^1 %L", CSGO_TAG, LANG_SERVER, "CSGOR_DATA_LOADED")
g_bLoaded[id] = true
if(g_bLogged[id])
{
client_print_color(id, print_chat, "^4%s^1 %L", CSGO_TAG, LANG_SERVER, "CSGOR_DATA_LOADED")
g_bLoaded[id] = true
_ShowMainMenu(id)
}
}

public _SaveData(id)
Expand Down Expand Up @@ -2983,26 +2987,25 @@ public reg_menu_handler(id, menu, item)

_LoadSkins(id)

new spLen = strlen(g_szUser_SavedPass[id])
new spLen = strlen(g_szUserPassword[id])

if (strlen(g_szUserPassword[id]) <= 0)
{
client_print_color(id, print_chat, "^4%s^1 %L", CSGO_TAG, LANG_SERVER, "CSGOR_REG_INSERT_PASS", 6)
client_print_color(id, print_chat, "^4%s^1%L", CSGO_TAG, LANG_SERVER, "CSGOR_REG_INSERT_PASS", 6)
client_cmd(id, "messagemode UserPassword")
}

if (!equal(g_szUserPassword[id], g_szUser_SavedPass[id], spLen))
{
g_iUserPassFail[id]++
client_print_color(id, print_chat, "^4%s ^1 %L", CSGO_TAG, LANG_SERVER, "CSGOR_PASS_FAIL")
client_print_color(id, print_chat, "^4%s ^1%L", CSGO_TAG, LANG_SERVER, "CSGOR_PASS_FAIL")
_ShowRegMenu(id)
ExecuteForward(g_iForwards[ user_pass_fail ], g_iForwardResult, id, g_iUserPassFail[id])
}
else
{
g_bLogged[id] = true
_ShowMainMenu(id)
client_print_color(id, print_chat, "^4%s^1 %L", CSGO_TAG, LANG_SERVER, "CSGOR_LOGIN_SUCCESS")
client_print_color(id, print_chat, "^4%s ^1%L", CSGO_TAG, LANG_SERVER, "CSGOR_LOGIN_SUCCESS")
ExecuteForward(g_iForwards[ user_log_in ], g_iForwardResult, id)
}

Expand Down Expand Up @@ -10963,12 +10966,18 @@ _ShowMVP(id, event)

g_iUserMVP[id]++

new iRet
ExecuteForward(g_iForwards[ user_mvp ], iRet, id, event, g_iRoundKills[id])

if(iRet > PLUGIN_CONTINUE)
{
return PLUGIN_HANDLED
}

_GiveBonus(id, 1)

switch (g_iCvars[iMVPMsgType])
{
case 0:
{
goto _End
}
case 1:
{
switch (event)
Expand Down Expand Up @@ -11026,11 +11035,7 @@ _ShowMVP(id, event)
}
}
}

_End:
ExecuteForward(g_iForwards[ user_mvp ], g_iForwardResult, id, event, g_iRoundKills[id])
_GiveBonus(id, 1)


return PLUGIN_HANDLED
}

Expand Down Expand Up @@ -11097,7 +11102,7 @@ _GiveBonus(id, type)
if (!g_bLogged[id])
{
client_print_color(id, print_chat, "^4%s^1 %L", CSGO_TAG, LANG_SERVER, "CSGOR_REGISTER")
return PLUGIN_HANDLED
return -1
}

new rpoints
Expand All @@ -11120,7 +11125,7 @@ _GiveBonus(id, type)
_Save(id)
}

return PLUGIN_CONTINUE
return rpoints
}

_SetKillsIcon(id, reset)
Expand Down
Loading

0 comments on commit 98e20e6

Please sign in to comment.