Raised This Month: $209 Target: $400
 52% 

Solved [CSGO] Problem with my VIP plugin


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mesharsky How2Kill
AlliedModders Donor
Join Date: May 2017
Old 07-12-2017 , 11:45   [CSGO] Problem with my VIP plugin
Reply With Quote #1

Hello i have annoying problem with my VIP plugin that i made.

L 07/12/2017 - 17:43:46: [SM] Exception reported: Language phrase "TagDlaVipa" not found
L 07/12/2017 - 17:44:09: [SM] Exception reported: Language phrase "PorzegnanieVip" not found

And like with every single one. I actually think that i did everything right. There is no compilation error's at all.

The comments are in Polish but i hope you will understand the code.

This is the .sp.

Code:
/********************************************* ********************************************* **********
[CS:GO] How2Kill - VIP
********************************************* ********************************************* ***********

********************************************* ********************************************* ***********
CHANGELOG:
0.1 - Pierwsze wydanie.
0.2 - [BIG UPDATE] Przepisany plugin na nową składnie.
0.3 - Naprawiono wiele kodu w pluginie, pieniadze za rozbrojenie/podlozenie bomby juz dzialają.
0.4 - Dodano Cvary do pluginu.
0.5 - Dodano duzo wiecej Cvarow do pluginu oraz naprawiono kilka bledow.
0.6 - [BIG UPDATE] Dodano reset rund poprzez zmiane druzyn, dodano wiecej cvarow, dodano wiadomosci przy zabiciu itd.
0.7 - Dodano hajs za wygranie rundy, oraz poprawiono pare błędów w kodzie.
0.8 - Dodano przywitanie/porzegnanie dla vip'a w wiadomosci jak i w hint.
0.9 - Dodano translacje, dodano wiele convarow.
********************************************* ********************************************* ***********

********************************************* ********************************************* ***********
INCLUDES
********************************************* ********************************************* ***********/
#include <cstrike>
#include <sourcemod>
#include <sdktools>
#include <sdkhooks>
#include <multicolors>

/********************************************* ********************************************* ***********
DEFINES
********************************************* ********************************************* ***********/
#define PL_VERSION "0.9"
#define PREFIX "%t"

/********************************************* ********************************************* **********
ETIQUETTE.
********************************************* ********************************************* ***********/
#pragma newdecls required
#pragma semicolon 1

/********************************************* ********************************************* **********
HANDLES.
********************************************* ********************************************* ***********/

//===== Przywitanie/Pozegnanie MSG =====
ConVar g_cvPrzywitanieVip;
ConVar g_cvPorzegnanieVip;

//===== Hint =====
ConVar g_cvPrzywitanieHintVip;
ConVar g_cvPorzegnanieHintVip;

//===== HP =====
ConVar g_cvVipHP;
ConVar g_cvVipHeadShotHP;
ConVar g_cvVipKillHP;

//===== MV/GRAWITACJA =====
ConVar g_cvPredkoscGracza;
ConVar g_cvGrawitacja;

//===== ARMOR+HELM =====
ConVar g_cvVipArmor;
ConVar g_cvVipHelm;

//===== GRANATY =====
ConVar g_cvHEGranat;
ConVar g_cvFlashGranat;
ConVar g_cvSmokeGranat;
ConVar g_cvDecoyGranat;
ConVar g_cvHealGranat;
ConVar g_cvIncGranat;
ConVar g_cvMolotovGranat;
ConVar g_cvTaGranat;

//===== HAJSY =====
ConVar g_cvVipHajsNaStart;
ConVar g_cvVipHajsPodlozenie;
ConVar g_cvVipHajsRozbrojenie;
ConVar g_cvVipHeadShotHajs;
ConVar g_cvVipKillHajs;
ConVar g_cvVipWygranaHajs;

//===== Tag w tabeli =====
ConVar g_cvTag_Tabela;

//===== Runda =====
ConVar g_cvRunda_MenuBroni;

/********************************************* ********************************************* **********
INTS.
********************************************* ********************************************* ***********/
int RoundCount = 0;

/********************************************* ********************************************* **********
PLUGIN INFO.
********************************************* ********************************************* ***********/
public Plugin myinfo =
{
name = "[CS:GO] How2Kill - VIP",
author = "Mesharsky",
description = "[CS:GO] How2Kill - VIP",
version = PL_VERSION,
url = "http://steamcommunity.com/id/MesharskyH2K"
}

/********************************************* ********************************************* **********
INTS.
********************************************* ********************************************* ***********/

public void OnPluginStart()
{
HookEvent("round_start", Event_RoundStart);
HookEvent("player_spawn", Event_TagTable);
HookEvent("player_spawn", Event_PlayerSpawn);
HookEvent("player_death", Event_PlayerDeath);
HookEvent("bomb_planted", Event_BombPlanted);
HookEvent("bomb_defused", Event_BombDefused);
HookEvent("round_end", Event_RoundEnd);
HookEvent("announce_phase_end", ResetPoZmianie);
HookEvent("cs_intermission", ResetPoZmianie);

//===== TRANSLATIONS =====
LoadTranslations("H2K/Vip.phrases");

//===== Przywitanie/Pozegnanie MSG =====
g_cvPrzywitanieVip = CreateConVar("przywitanie_vip", "1", "Czy ma być pokazane przywitanie dla vip'a? w wiadomości? (0/1)");
g_cvPorzegnanieVip = CreateConVar("porzegnanie_vip", "1", "Czy ma być pokazane porzegnanie dla vip'a? w wiadomości? (0/1)");

//===== Przywitanie/Pozegnanie Hint =====
g_cvPrzywitanieHintVip = CreateConVar("przywitanie_hint_vip", "1", "Czy ma być pokazane przywitanie dla vip'a? w HINT? (0/1)");
g_cvPorzegnanieHintVip = CreateConVar("porzegnanie_hint_vip", "1", "Czy ma być pokazane porzegnanie dla vip'a? w HINT? (0/1)");

//===== HP =====
g_cvVipHP = CreateConVar("zycie_vip", "115", "Ile zdrowia ma posiadać vip na start rundy?");
g_cvVipKillHP = CreateConVar("kill_hp_vip", "5", "Ile zdrowia ma dostawać vip za zabójstwo ?");
g_cvVipHeadShotHP = CreateConVar("hs_hp_vip", "10", "Ile zdrowia ma dostawać vip za zabójstwo z HeadShot'a ?");

//===== MV + GRAWITACJA =====
g_cvPredkoscGracza = CreateConVar("vip_predkosc_ruchu", "1.0", "Prędkość ruchu vip'a (1.0 - standardowo)");
g_cvGrawitacja = CreateConVar("vip_grawitacja", "1.0", "Grawitacja dla vip'a (1.0 - standardowo)");

//===== KAMIZELKA + HELM =====
g_cvVipArmor = CreateConVar("armor_vip", "100", "Punkty kamizelki dla vipa? (od 1 - 100)");
g_cvVipHelm = CreateConVar("helm_vip", "1", "Czy vip ma posiadać hełm przy starcie rundy? (0/1)");

//===== HAJSY =====
g_cvVipHajsNaStart = CreateConVar("vip_dodatkowy_hajs", "0", "Ilość dodatkowego hajsu na start rundy jaki ma vip dostawać.");
g_cvVipKillHajs = CreateConVar("hajs_kill_vip", "200", "Ile vip ma dostawać pieniędzy za zabójstwo ?");
g_cvVipHeadShotHajs = CreateConVar("hajs_hs_vip", "500", "Ile vip ma dostawać pieniędzy za zabójstwo w głowę?");
g_cvVipHajsPodlozenie = CreateConVar("hajs_podlozenie_vip", "1000", "Ile hajsu ma dostawać vip za podłożenie bomby?");
g_cvVipHajsRozbrojenie = CreateConVar("hajs_rozbrojenie_vip", "1000", "Ile hajsu ma dostawać vip za rozbrojenie bomby?");
g_cvVipWygranaHajs = CreateConVar("hajs_wygranie_rundy", "500", "Ile hajsu ma dostawać vip za wygranie rundy?");

//===== GRANATY =====
g_cvHEGranat = CreateConVar("vip_he", "1", "Czy vip ma dostawać granat HE na start rundy?");
g_cvFlashGranat = CreateConVar("vip_flash", "1", "Czy vip ma dostawać granat Flash na start rundy?");
g_cvSmokeGranat = CreateConVar("vip_smoke", "1", "Czy vip ma dostawać granat Smoke na start rundy?");
g_cvDecoyGranat = Create"vip_tactic", "0", "Czy vip ma dostawać granat Taktyczny na start rundy?");

//===== TAG W TABELI =====
g_cvTag_Tabela = CreateConVar("vip_tag_tabela", "1", "Czy w tabeli ma widniec tag [VIP]?");

//===== RUNDA MENU BRONI =====
g_cvRunda_MenuBroni = CreateConVar("vip_runda_menubroni", "3", "Od ktorej rundy ma pokazywac menu broni dla vip'a?");
}

public void OnMapStart()
{
//===== PLIK KONFIGURACYJNY =====
AutoExecConfig(true, "Vip_By_Mesharsky");
RoundCount = 0;
}


//===== MENU BRONI =====
public Action MenuGlowne(int iClient)
{
if (IsValidClient(iClient)) {
if (IsPlayerVIP(iClient)) {
Menu menu = new Menu(MenuHandler1);
menu.SetTitle("VIP : Wybierz Broń");
menu.AddItem("weapon_ak47", "AK-47");
menu.AddItem("weapon_m4a1", "M4A4");
menu.AddItem("weapon_m4a1_silencer", "M4A1-S");
menu.AddItem("weapon_awp", "AWP");
menu.AddItem("weapon_ssg08", "SCOUT");
menu.AddItem("weapon_xm1014", "XM1014");
menu.AddItem("weapon_famas", "FAMAS");
menu.ExitButton = true;
menu.Display(iClient, 0);
}
}
}

public int MenuHandler1(Menu menu, MenuAction action, int iClient, int itemNum)
{
if (action == MenuAction_Select)
{
char info[32];
GetMenuItem(menu, itemNum, info, sizeof(info));

if (IsPlayerAlive(iClient))
{
StripAllWeapons(iClient);
GivePlayerItem(iClient, "weapon_knife");
GivePlayerItem(iClient, info);
MenuBroni(iClient);
}
}

else if (action == MenuAction_End) {
CloseHandle(menu);
}
}

public Action MenuBroni(int iClient)
{
if (IsValidClient(iClient)) {
if (IsPlayerVIP(iClient)) {
Menu menusec = new Menu(MenuHandler2);
menusec.SetTitle("VIP : Wybierz Pistolet");
menusec.AddItem("weapon_deagle", "Deagle");
menusec.AddItem("weapon_revolver", "R8 Revolver");
menusec.AddItem("weapon_fiveseven", "Five-Seven");
menusec.AddItem("weapo
menusec.ExitButton = true;
menusec.Display(iClient, 0);
}
}
}

public int MenuHandler2(Menu menusec, MenuAction action, int iClient, int itemNum)
{

if (action == MenuAction_Select)
{
char info[32];
GetMenuItem(menusec, itemNum, info, sizeof(info));

if (IsPlayerAlive(iClient)) {
GivePlayerItem(iClient, info);
}
}

else if (action == MenuAction_End) {
CloseHandle(menusec);
}
}

/********************************************* ********************************************* ***********
EVENTS.
********************************************* ********************************************* ***********/

//===== PRZYWITANIE VIPA =====
public void OnClientPutInServer(int iClient)
{
if (IsPlayerVIP(iClient)) GetConVarBool(g_cvPrzywitanieVip);
{
CPrintToChatAll("{olive}--------------------------------------------------------");
CPrintToChatAll(PREFVip", iClient);
CPrintToChatAll("{olive}--------------------------------------------------------");

if(GetConVarBool(g_HintVip)) PrintHintTextToAll("<font color='#FE2E2E'>VIP » %N </font> \n<font color='#01DF01'>Właśnie wszedł na serwer </font>", iClient);
}
}

//===== PORZEGNANIE VIPA =====
public void OnClientDisconnect(int iClient)
{
if (IsPlayerVIP(iClient)) GetConVarBool(g_cvPorzegnanieVip);
{
CPrintToChatAll("{olive}--------------------------------------------------------");
CPrintToChatAll(PREFIX, "PorzegnanieVip", iClient);
CPrintToChatAll("{olive}--------------------------------------------------------");

if(GetConVarBool(g_cvPorzegnanieHintVip)) PrintHintTextToAll("<font color='#FE2E2E'>VIP » %N </font> \n<font color='#ff0000'>Właśnie wyszedł z serwera </font>", iClient);
}
}

public Action Event_RoundS
if (GameRules_GetProp(t + 1;
}

//===== RESET ROUNDCOUNT PO ZMIANIE DRUZYN =====
public Action ResetPoZmianie(Handle hEvent, const char[] chName, bool bDontBroadcast)
{
RoundCount = 0;
}

public Action Event_PlayerSpawn(Handle hEvent, const char[] chName, bool bDontBroadcast)
{
int iClient = GetClientOfUserId(GetEventInt(hEvent, "userid"));

if (IsPlayerVIP(iClient))
{lient, Prop_Send, "m_flLaggedMovementValue", GetConVarFloat(g_cvPredkoscGracza));
SetEntityGravity(iClient, GetConVarFloat(g_cvGrawitacja));
if (GetConVarBool(g_cvHEGranat)) GivePlayerItem(iClient, "weapon_hegrenade");
if (GetConVarBool(g_cvFlashGranaerItem(iClient, "weapon_flashbang");
if (GetConVarBool(g_cvSmokeGrerItem(iClient, "weapon_tagrenade");
}

{ if (RoundCount >= GetConVarInt(g_cvRunda_MenuBroni))
{

public Action Event_PlayerDeath(Handle hEvent, const char[] chName, bool bDontBroadcast)
{
int attacker = GetClientOfUserId(GetEventInt(hEvent, "attacker"));
int victim = GetClientOfUserId(GetEventInt(hEvent, "userid"));

if (IsPlayerVIP(attacker))
{
if (!IsValidClient(attacker)) {
return;
}

if (GetClientTeam(attacker) != GetClientTeam(victim))
{
bool headshot = GetEventBool(hEvent, "headshot");
int HajsGracza = GetEntProp(attacker, Prop_Send, "m_iAccount");
int HP = GetClientHealth(attacker);

if (headshot) {
CPrintToChat(attacker, PREFIX, "VipZabicieHeadShot", GetConVarInt(g_cvVipHeadShotHP));
SetEntProp(attacker, Prop_Send, "m_iAccount", GetConVarInt(g_cvVipHeadShotHajs) + HajsGracza);
if(HP + GetConVarInt(g_cvVipHeadShotHP) > 150) SetEntityHealth(attacker, 150);
if(HP + GetConVarInt(g_cvVipHeadShotHP) <= 150) SetEntityHealth(attacker, HP + GetConVarInt(g_cvVipHeadShotHP));
}
else {
CPrintToChat(attacker, PREFIX, "VipZabicie", GetConVarInt(g_cvVipKillHP));
SetEntProp(attacker, Prop_Send, "m_iAccount", GetConVarInt(g_cvVipKillHajs) + HajsGracza);
if(HP + GetConVarInt(g_cvVipKillHP) > 150) SetEntityHealth(attacker, 150);
if(HP + GetConVarInt(g_cvVipKillHP) <= 150) SetEntityHealth(attacker, HP + GetConVarInt(g_cvVipKillHP));
}
}
Client, PREFIX, "VipPodlozenieBomby", GetConVarInt(g_cvVipHajsPodlozenie));
SetEntProp(iClient, Prop_Send, "m_iAccount", GetConVarInt(g_cvVipHajsPodlozenie) + HajsGracza);
}
}

public Action Event_BombDefused(Handle hEvent, const char[] chName, bool bDontBroadcast)
{
int iClient = GetClientOfUserId(GetEventInt(hEvent, "userid"));
int HajsGracza = GetEntProp(iClient, Prop_Send, "m_iAccount");

if (IsPlayerVIP(iClient)) {
CPrintToChat(iClient, PREFIX, "VipRozbrojenieBomby", GetConVarInt(g_cvVipHajsRozbrojenie));
SetEntProp(iClient, Prop_Send, "m_iAccount", GetConVarInt(g_cvVipHajsRozbrojenie) + HajsGracza);
}

if(IsValidClient(iClient) && GetClientTeam(iClient) == winnerTeam && IsPlayerVIP(iClient)) {
CPrintToChat(iClient, PREFIX, "VipWygranaRunda", GetConVarInt(g_cvVipWygranaHajs));
SetEntProp(iClient, Prop_Send, "m_iAccount", GetConVarInt(g_cvVipWygranaHajs) + HajsGracza);
}
}
if (IsPlayerVIP(iClient))
{
Format(TagVIP, sizeof(TagVIP), "%t" ,"TagDlaVipa", LANG_SERVER);
if (GetConVarBool(g_cvTag_Tabela)) CS_SetClientClanTag(iClient, TagVIP);
}
}

//===== PODWOJNY SKOK =====
public Action OnPlayerRunCmd(int iClient, int &buttons, int &impulse, float vel[3], float angles[3], int &weapon)
{
if (IsPlayerVIP(iClient) && IsPlayerAlive(iClient))
{
static 
g_iJumps[iClient]++;
float vVel[3];
GetEntPropVector(iClient, Prop_Data, "m_vecVelocity", vVel);
vVel[2] = 250.0;
TeleportEntity(iClient, NULL_VECTOR, NULL_VECTOR, vVel);
}

g_fLastFlags[iClient] = fCurFlags;
g_fLastButtons[iClient] = fCurButtons;
}
return Plugin_Continue;
}

stock void StripAllWeapons(int iClient)
{
int iEnt;
fo
if (!IsClientInGame(iClient)) {
return false;
}

if (IsFakeClient(iClient)) {
return false;
}

return true;
}
And there is my phrases file.

Code:
"Phrases"
{
"TagDlaVipa"
{
"pl" "[TEST_TAG]"
}
"PrzywitanieVip"
{
"pl" "★ {lightred}[VIP] {green}» {darkred}%N {default}Właśnie wszedł na nasz serwer!"
}
"PorzegnanieVip"
{
"pl" "★ {lightred}[VIP] {green}» {darkred}%N {default}Właśnie opuścił nasz serwer!"
}
"VipZabicieHeadShot"
{
"pl" "★ {lightred}[VIP]{default} Za zabicie z {darkred}HS {default}Otrzymujesz {green}+%i {default}HP"
}
"VipZabicie"
{
"pl" "★ {lightred}[VIP]{default} Za zabicie {darkred}gracza {default}Otrzymujesz {green}+%i {default}HP"
}
"VipPodlozenieBomby"
{
"pl" "★ {lightred}[VIP]{default} Za podłożenie bomby otrzymałeś {green}+%i$"
}
"VipRozbrojenieBomby"
{
"pl" "★ {lightred}[VIP]{default} Za rozbrojenie bomby otrzymałeś {green}+%i$"
}
"VipWygranaRunda"
{
"pl" "★ {lightred}[VIP]{default} Za wygranie rundy otrzymałeś {green}+%i$"
}
}

Can you help me fix this problem?

Last edited by Mesharsky How2Kill; 07-15-2017 at 00:13.
Mesharsky How2Kill is offline
CamerDisco
AlliedModders Donor
Join Date: Aug 2015
Location: Poland
Old 07-12-2017 , 12:45   Re: [CSGO] Problem with my VIP plugin
Reply With Quote #2

Try %T instead of %t on Format, OnClientDisconnect it should see
PHP Code:
CPrintToChatAll(PREFIX"%T""PorzegnanieVip"LANG_SERVERiClient); 
Ans pls "pożegnanie", not "porzegnanie" - polish language, hard language
__________________


Max-Play.pl - the best polish servers

Last edited by CamerDisco; 07-12-2017 at 12:49.
CamerDisco is offline
Mesharsky How2Kill
AlliedModders Donor
Join Date: May 2017
Old 07-12-2017 , 12:51   Re: [CSGO] Problem with my VIP plugin
Reply With Quote #3

Quote:
Originally Posted by CamerDisco View Post
Try %T instead of %t
PHP Code:
CPrintToChatAll(PREFIX"%T""PorzegnanieVip"LANG_SERVERiClient); 
Ans pls "pożegnanie", not "porzegnanie" - polish language, hard language

unfortunately
I used %T insted %t and no messages at all same error, i see you add now LANG_SERVER so i try it out and let you know.

And about pożegnanie i am from Ireland and i don't know Polish perfectly 100% XD, so sorry, but i fix it anyway

Last edited by Mesharsky How2Kill; 07-12-2017 at 12:51.
Mesharsky How2Kill is offline
CamerDisco
AlliedModders Donor
Join Date: Aug 2015
Location: Poland
Old 07-12-2017 , 12:59   Re: [CSGO] Problem with my VIP plugin
Reply With Quote #4

And translations PorzegnanieVip won't work, because you're using iClient, but you didn't format it. Learn it here: https://wiki.alliedmods.net/Translat...eMod_Scripting)
In your case it should see:
PHP Code:
    "PorzegnanieVip"
    
{
        
"#format"    "{1:N}"
        "pl"         "★ {lightred}[VIP] {green}» {darkred}{1} {default}Właśnie opuścił nasz serwer!"
    

__________________


Max-Play.pl - the best polish servers
CamerDisco is offline
Mesharsky How2Kill
AlliedModders Donor
Join Date: May 2017
Old 07-12-2017 , 13:04   Re: [CSGO] Problem with my VIP plugin
Reply With Quote #5

Quote:
Originally Posted by CamerDisco View Post
And translations PorzegnanieVip won't work, because you're using iClient, but you didn't format it. Learn it here: https://wiki.alliedmods.net/Translat...eMod_Scripting)
In your case it should see:
PHP Code:
    "PorzegnanieVip"
    
{
        
"#format"    "{1:N}"
        "pl"         "★ {lightred}[VIP] {green}» {darkred}{1} {default}Właśnie opuścił nasz serwer!"
    

So i have to use "#format" "{1:N}" eveyrywhere or just in line where is pozegnanie?
Mesharsky How2Kill is offline
CamerDisco
AlliedModders Donor
Join Date: Aug 2015
Location: Poland
Old 07-12-2017 , 13:10   Re: [CSGO] Problem with my VIP plugin
Reply With Quote #6

Everywhere where you are formatting something, like a int, string or client. And for example for a string it will se:
PHP Code:
"#format"    "{1:s}" 
If it still doesn't work please attach all files what you are using and I'll test it.
__________________


Max-Play.pl - the best polish servers

Last edited by CamerDisco; 07-12-2017 at 13:11.
CamerDisco is offline
Mesharsky How2Kill
AlliedModders Donor
Join Date: May 2017
Old 07-12-2017 , 13:13   Re: [CSGO] Problem with my VIP plugin
Reply With Quote #7

Add me on steam if you can then you can help me faster http://steamcommunity.com/id/mesharskyh2k/
Mesharsky How2Kill is offline
inklesspen
Member
Join Date: Nov 2015
Location: Russia, Moscow
Old 07-16-2017 , 09:46   Re: [CSGO] Problem with my VIP plugin
Reply With Quote #8

try add "en" translate. If client using not "pl" language, it throw error like "Language not found "NAME OF TRANSLATE" "
inklesspen is offline
Send a message via Skype™ to inklesspen
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:47.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode