Raised This Month: $180 Target: $400
 45% 

Steam Works Group Manager


Post New Thread Reply   
 
Thread Tools Display Modes
Obyboby
Veteran Member
Join Date: Sep 2013
Old 09-19-2017 , 11:42   Re: Steam Works Group Manager
Reply With Quote #21

Quote:
Originally Posted by Russian85 View Post
In this case I have SWGM VIP. Gives VIP to player if He participating in Steam group.
For VIP Core by R1KO, that has many modules.
Ok, gotcha. THanks for your work so far.

PHP Code:
"sm_swgm_bonus_money" "1.000000" def"150" min0.000000 max1.000000    Bonus money for Steam group users
Is this normal?

I've added sm_swgm_bonus_money 150 into my server.cfg but there seems to be a bug.
It says default 150 but the min and max values available are 0 and 1.

EDIT: ok I realized it's a bit pointless to add the cvar in my CFG since the default is already the desired amount (150) but still wanted to point out this "bug"
__________________

Last edited by Obyboby; 09-19-2017 at 11:46.
Obyboby is offline
Russian85
Junior Member
Join Date: Aug 2017
Old 09-19-2017 , 11:50   Re: Steam Works Group Manager
Reply With Quote #22

Quote:
Originally Posted by Obyboby View Post
Ok, gotcha. THanks for your work so far.

PHP Code:
"sm_swgm_bonus_money" "1.000000" def"150" min0.000000 max1.000000    Bonus money for Steam group users
Is this normal?

I've added sm_swgm_bonus_money 150 into my server.cfg but there seems to be a bug.
It says default 150 but the min and max values available are 0 and 1.

EDIT: ok I realized it's a bit pointless to add the cvar in my CFG since the default is already the desired amount (150) but still wanted to point out this "bug"
Fixed.
Attached Files
File Type: smx SWGM_Bonus_Money.smx (4.9 KB, 22 views)
File Type: sp Get Plugin or Get Source (SWGM_Bonus_Money.sp - 32 views - 2.1 KB)
Russian85 is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 09-19-2017 , 11:57   Re: Steam Works Group Manager
Reply With Quote #23

Quote:
Originally Posted by Russian85 View Post
Fixed.
Thanks dude!!

One question:

How can I add a phrases file for translations, but still be sure that the bonus is read from your plugin?

PHP Code:
PrintToChat(iClient"[SWGM] You got $%i bonus for participating in our Steam group."g_iBonus); 
I mean this phrase here.

If I move it to the phrases file, will the plugin still be able to read the cash bonus "g_iBonus"?
Hopefully I made myself clear, sorry for the terrible explanation :/


EDIT: here's what I'm trying to do. This would be my phrases file:

PHP Code:
"Phrases"
{
"mex_1"
{
"en" "[SWGM] You got {Green}$%i bonus {Default}for participating in our Steam group, thank you!"
"it" "[SWGM] Hai ricevuto {Green}$%i {Default}di bonus  di bonus per essere nel nostro gruppo Steam, grazie!"
}
"mex_2"
{
"en" "[SWGM] Join our Steam group for an in-game BONUS! Type {Green}!group {Default}to join now"
"it" "[SWGM] Usa la tag {Green}nudonudo{Default} per un BONUS in-game! Scrivi {Green}!group per unirti ora"
}

Would the "%i" be able to read from the plugin and display the correct bonus amount in game?
Yes I did add

PHP Code:
#include <multicolors> 
__________________

Last edited by Obyboby; 09-19-2017 at 12:28.
Obyboby is offline
Russian85
Junior Member
Join Date: Aug 2017
Old 09-19-2017 , 12:33   Re: Steam Works Group Manager
Reply With Quote #24

Quote:
Originally Posted by Obyboby View Post
Thanks dude!!

One question:

How can I add a phrases file for translations, but still be sure that the bonus is read from your plugin?

PHP Code:
PrintToChat(iClient"[SWGM] You got $%i bonus for participating in our Steam group."g_iBonus); 
I mean this phrase here.

If I move it to the phrases file, will the plugin still be able to read the cash bonus "g_iBonus"?
Hopefully I made myself clear, sorry for the terrible explanation :/


EDIT: here's what I'm trying to do. This would be my phrases file:

PHP Code:
"Phrases"
{
"mex_1"
{
"en" "[SWGM] You got {Green}$%i bonus {Default}for participating in our Steam group, thank you!"
"it" "[SWGM] Hai ricevuto {Green}$%i {Default}di bonus  di bonus per essere nel nostro gruppo Steam, grazie!"
}
"mex_2"
{
"en" "[SWGM] Join our Steam group for an in-game BONUS! Type {Green}!group {Default}to join now"
"it" "[SWGM] Usa la tag {Green}nudonudo{Default} per un BONUS in-game! Scrivi {Green}!group per unirti ora"
}

Would the "%i" be able to read from the plugin and display the correct bonus amount in game?
Yes I did add

PHP Code:
#include <multicolors> 
PHP Code:
"Phrases"
{
    
"mex_1"
    
{
        
"#format"        "{1:i}"
        "en" "[SWGM] You got {Green}
${1} bonus {Default}for participating in our Steam group, thank you!"
        "it" "[SWGM] Hai ricevuto {Green}
${1} {Default}di bonus  di bonus per essere nel nostro gruppo Steam, grazie!"
    
}
    
"mex_2"
    
{
        
"en" "[SWGM] Join our Steam group for an in-game BONUS! Type {Green}!group {Default}to join now"
        "it" "[SWGM] Usa la tag {Green}nudonudo{Default} per un BONUS in-game! Scrivi {Green}!group per unirti ora"
    
}

Russian85 is offline
Obyboby
Veteran Member
Join Date: Sep 2013
Old 09-19-2017 , 12:50   Re: Steam Works Group Manager
Reply With Quote #25

Quote:
Originally Posted by Russian85 View Post
PHP Code:
"Phrases"
{
    
"mex_1"
    
{
        
"#format"        "{1:i}"
        "en" "[SWGM] You got {Green}
${1} bonus {Default}for participating in our Steam group, thank you!"
        "it" "[SWGM] Hai ricevuto {Green}
${1} {Default}di bonus  di bonus per essere nel nostro gruppo Steam, grazie!"
    
}
    
"mex_2"
    
{
        
"en" "[SWGM] Join our Steam group for an in-game BONUS! Type {Green}!group {Default}to join now"
        "it" "[SWGM] Usa la tag {Green}nudonudo{Default} per un BONUS in-game! Scrivi {Green}!group per unirti ora"
    
}

Thanks!!

I'm afraid I need a server restart now, as it's not applying my changes :p will report back if it works


EDIT:

I've done something wrong because the plugin is not showing anything in chat now.

PHP Code:
#include <sdktools_gamerules>
#include <cstrike>
#include <swgm>
#include <multicolors>

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo 
{
    
name "[SWGM] Bonus Money",
    
author "Someone",
    
version "1.2",
    
url "http://hlmod.ru/"
};

int g_iBonusg_iFirst;

public 
void OnPluginStart()
{
    
LoadTranslations("ez_swgm_bonus.phrases.txt"); 
    
//HookEvent("player_spawn", Event_PlayerSpawn);
    
    
HookEvent("round_start"Event_RoundStart);
    
    
ConVar CVAR;
    (
CVAR    CreateConVar("sm_swgm_bonus_money""150""Bonus money for Steam group users."_true0.0)).AddChangeHook(ChangeCvar_Bonus);
    
g_iBonus CVAR.IntValue;
    
    (
CVAR    CreateConVar("sm_swgm_change_side_round""15""Ignore this round."_true0.0)).AddChangeHook(ChangeCvar_Round);
    
g_iFirst CVAR.IntValue;
}

public 
void ChangeCvar_Bonus(ConVar convar, const char[] oldValue, const char[] newValue)
{
    
g_iBonus convar.IntValue;
}

public 
void ChangeCvar_Round(ConVar convar, const char[] oldValue, const char[] newValue)
{
    
g_iFirst convar.IntValue;
}

/*
public void Event_PlayerSpawn(Event hEvent, const char[] sName, bool bDontBoradcast)
{
    int iScore;
    if(g_iBonus > 0 && GameRules_GetProp("m_bWarmupPeriod") == 0 && (iScore = CS_GetTeamScore(3) + CS_GetTeamScore(2)) != 1 && iScore != g_iFirst)    RequestFrame(FrameSpawn, GetClientOfUserId(hEvent.GetInt("userid")));
}
*/

public void Event_RoundStart(Event hEvent, const char[] sNamebool bDontBoradcast)
{
    
int iScore;
    if(
g_iBonus && GameRules_GetProp("m_bWarmupPeriod") == && (iScore CS_GetTeamScore(3) + CS_GetTeamScore(2)) != && iScore != g_iFirst)
    {
        
//int iScore = CS_GetTeamScore(3) + CS_GetTeamScore(2);
        
for(int i 1<= MaxClientsi++)    if(IsClientInGame(i) && !IsFakeClient(i))
        {
            
RequestFrame(FrameSpawni);
        }
    }
}

void FrameSpawn(int iClient)
{
    if(
SWGM_InGroup(iClient))
    {
        
SetEntProp(iClientProp_Send"m_iAccount"GetEntProp(iClientProp_Send"m_iAccount") + g_iBonus);
        
CPrintToChat(iClient"%t""mex_1");
        
//PrintToChat(iClient, "[SWGM] You got $%i bonus for participating in our Steam group.", g_iBonus);
    
}
    else 
CPrintToChat(iClient"%t""mex_2");
    
//else PrintToChat(iClient, "[SWGM] You can got $%i bonus for participating in our Steam group.", g_iBonus);

__________________

Last edited by Obyboby; 09-19-2017 at 13:27.
Obyboby is offline
Russian85
Junior Member
Join Date: Aug 2017
Old 09-19-2017 , 14:01   Re: Steam Works Group Manager
Reply With Quote #26

Quote:
Originally Posted by Obyboby View Post
Thanks!!

I'm afraid I need a server restart now, as it's not applying my changes :p will report back if it works


EDIT:

I've done something wrong because the plugin is not showing anything in chat now.

PHP Code:
#include <sdktools_gamerules>
#include <cstrike>
#include <swgm>
#include <multicolors>

#pragma semicolon 1
#pragma newdecls required

public Plugin myinfo 
{
    
name "[SWGM] Bonus Money",
    
author "Someone",
    
version "1.2",
    
url "http://hlmod.ru/"
};

int g_iBonusg_iFirst;

public 
void OnPluginStart()
{
    
LoadTranslations("ez_swgm_bonus.phrases.txt"); 
    
//HookEvent("player_spawn", Event_PlayerSpawn);
    
    
HookEvent("round_start"Event_RoundStart);
    
    
ConVar CVAR;
    (
CVAR    CreateConVar("sm_swgm_bonus_money""150""Bonus money for Steam group users."_true0.0)).AddChangeHook(ChangeCvar_Bonus);
    
g_iBonus CVAR.IntValue;
    
    (
CVAR    CreateConVar("sm_swgm_change_side_round""15""Ignore this round."_true0.0)).AddChangeHook(ChangeCvar_Round);
    
g_iFirst CVAR.IntValue;
}

public 
void ChangeCvar_Bonus(ConVar convar, const char[] oldValue, const char[] newValue)
{
    
g_iBonus convar.IntValue;
}

public 
void ChangeCvar_Round(ConVar convar, const char[] oldValue, const char[] newValue)
{
    
g_iFirst convar.IntValue;
}

/*
public void Event_PlayerSpawn(Event hEvent, const char[] sName, bool bDontBoradcast)
{
    int iScore;
    if(g_iBonus > 0 && GameRules_GetProp("m_bWarmupPeriod") == 0 && (iScore = CS_GetTeamScore(3) + CS_GetTeamScore(2)) != 1 && iScore != g_iFirst)    RequestFrame(FrameSpawn, GetClientOfUserId(hEvent.GetInt("userid")));
}
*/

public void Event_RoundStart(Event hEvent, const char[] sNamebool bDontBoradcast)
{
    
int iScore;
    if(
g_iBonus && GameRules_GetProp("m_bWarmupPeriod") == && (iScore CS_GetTeamScore(3) + CS_GetTeamScore(2)) != && iScore != g_iFirst)
    {
        
//int iScore = CS_GetTeamScore(3) + CS_GetTeamScore(2);
        
for(int i 1<= MaxClientsi++)    if(IsClientInGame(i) && !IsFakeClient(i))
        {
            
RequestFrame(FrameSpawni);
        }
    }
}

void FrameSpawn(int iClient)
{
    if(
SWGM_InGroup(iClient))
    {
        
SetEntProp(iClientProp_Send"m_iAccount"GetEntProp(iClientProp_Send"m_iAccount") + g_iBonus);
        
CPrintToChat(iClient"%t""mex_1");
        
//PrintToChat(iClient, "[SWGM] You got $%i bonus for participating in our Steam group.", g_iBonus);
    
}
    else 
CPrintToChat(iClient"%t""mex_2");
    
//else PrintToChat(iClient, "[SWGM] You can got $%i bonus for participating in our Steam group.", g_iBonus);

PHP Code:
CPrintToChat(iClient"%t""mex_1"g_iBonus); 
Russian85 is offline
Ultralord
Senior Member
Join Date: Oct 2008
Old 09-19-2017 , 14:40   Re: Steam Works Group Manager
Reply With Quote #27

Quote:
Originally Posted by Russian85 View Post
I don't understand your problem.

Did you mean "Admin" module ?
yes i on admin module i put the flag q to have the steam friends when is on group and on admin overrides i put the custom flag for steam friends group but they havent access on that command like the admin group isnt recognized something..
Ultralord is offline
Russian85
Junior Member
Join Date: Aug 2017
Old 09-20-2017 , 08:18   Re: Steam Works Group Manager
Reply With Quote #28

Quote:
Originally Posted by Ultralord View Post
yes i on admin module i put the flag q to have the steam friends when is on group and on admin overrides i put the custom flag for steam friends group but they havent access on that command like the admin group isnt recognized something..
If I understood correctly.
Attached Files
File Type: smx SWGM_Admin.smx (4.9 KB, 23 views)
File Type: sp Get Plugin or Get Source (SWGM_Admin.sp - 24 views - 1.9 KB)
Russian85 is offline
wjrrr
AlliedModders Donor
Join Date: May 2017
Old 10-02-2017 , 09:12   Re: Steam Works Group Manager
Reply With Quote #29

Only people who are in the group were allowed to give certain commands but this plugin is releasing all the functions of vip and not just those of the command listener. How to solve?

I want that when entering the group the players can give only the commands listed in the command_listener
wjrrr is offline
Russian85
Junior Member
Join Date: Aug 2017
Old 10-04-2017 , 13:32   Re: Steam Works Group Manager
Reply With Quote #30

Quote:
Originally Posted by wjrrr View Post
Only people who are in the group were allowed to give certain commands but this plugin is releasing all the functions of vip and not just those of the command listener. How to solve?

I want that when entering the group the players can give only the commands listed in the command_listener
No way, I think. But, if you are use VIP Core by R1KO I can post there module, that gives VIP status for group.
Russian85 is offline
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 15:52.


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