Raised This Month: $ Target: $400
 0% 

Steam Works Group Manager


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Russian85
Junior Member
Join Date: Aug 2017
Old 09-19-2017 , 14:01   Re: Steam Works Group Manager
Reply With Quote #11

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
 



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 22:38.


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