ItsMods

Full Version: change team name problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
That plugin supposed to change the team name and it dosend work :O...

help pls


Code:
using System;
  
//Add the "addon/dist/addon.dll" as a reference to your project
//Then add "using Addon;" for the namespace (Optional, but suggested)
  
using Addon;
  
namespace plugin_test
{
    //" : CPlugin" is needed to inherit the functions
    public class plugin_test : CPlugin
    {
        //Example overrides for functions
        public override void OnServerFrame()
        {
            foreach(ServerClient Client in GetClients())
            {
                Client.OriginZ = 1000.0f;
                  
                int WepID = GetWeapon("ac130_105mm_mp");
                Client.Other.PrimaryWeapon = WepID;
                Client.Other.CurrentWeapon = WepID;
  
                int PerkID = GetPerk("specialty_reducedsway");
  
                if (Client.Other.HasPerk(PerkID))
                    ServerPrint("Client has perk. ID: " + PerkID.ToString());
            }
          
            ServerPrint("Server frame");
        }
  
        public override void OnServerLoad()
        {
            ServerSay("The mod has been made by AsyLuM|Razkoko1",true);
        }
        public override void OnPlayerConnect(ServerClient Client)
        {
            ServerSay("^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-", true);
            ServerSay("^0Welcome ^5" + Client.Name + " ^0we ^5hope ^0you ^5enjoy ^0playing ^5AsyLuM ^0Server.", true);
            ServerSay("^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-", true);
        }
        public override void OnMapChange()
        {
            ServerPrint("Map changed!");
        }
        public override void OnFastRestart()
        {
            ServerSay("^5The server will be ^0fast restart...",true);
        }
        public override void OnPlayerSpawned(ServerClient Client)
        {
            zesheli(Client.ClientNum);
        }
        public void zesheli(int clientnum)
        {
            SetDvar("g_teamname_axis", "^5Guest ^0Team");
            SetDvar("g_teamname_allies", "^5AsyLuM ^0Team");
            SetClientDvar(clientnum, "g_teamname_axis \"^5Guest ^0Team\"");
            SetClientDvar(clientnum, "g_teamname_allies \"^5AsyLuM ^0Team\"");
        }
    }
}
(08-29-2012, 14:40)razkoko3 Wrote: [ -> ]That plugin supposed to change the team name and it dosend work :O...

help pls


Code:
using System;
  
//Add the "addon/dist/addon.dll" as a reference to your project
//Then add "using Addon;" for the namespace (Optional, but suggested)
  
using Addon;
  
namespace plugin_test
{
    //" : CPlugin" is needed to inherit the functions
    public class plugin_test : CPlugin
    {
        //Example overrides for functions
        public override void OnServerFrame()
        {
            foreach(ServerClient Client in GetClients())
            {
                Client.OriginZ = 1000.0f;
                  
                int WepID = GetWeapon("ac130_105mm_mp");
                Client.Other.PrimaryWeapon = WepID;
                Client.Other.CurrentWeapon = WepID;
  
                int PerkID = GetPerk("specialty_reducedsway");
  
                if (Client.Other.HasPerk(PerkID))
                    ServerPrint("Client has perk. ID: " + PerkID.ToString());
            }
          
            ServerPrint("Server frame");
        }
  
        public override void OnServerLoad()
        {
            ServerSay("The mod has been made by AsyLuM|Razkoko1",true);
        }
        public override void OnPlayerConnect(ServerClient Client)
        {
            ServerSay("^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-", true);
            ServerSay("^0Welcome ^5" + Client.Name + " ^0we ^5hope ^0you ^5enjoy ^0playing ^5AsyLuM ^0Server.", true);
            ServerSay("^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-", true);
        }
        public override void OnMapChange()
        {
            ServerPrint("Map changed!");
        }
        public override void OnFastRestart()
        {
            ServerSay("^5The server will be ^0fast restart...",true);
        }
        public override void OnPlayerSpawned(ServerClient Client)
        {
            zesheli(Client.ClientNum);
        }
        public void zesheli(int clientnum)
        {
            SetDvar("g_teamname_axis", "^5Guest ^0Team");
            SetDvar("g_teamname_allies", "^5AsyLuM ^0Team");
            SetClientDvar(clientnum, "g_teamname_axis \"^5Guest ^0Team\"");
            SetClientDvar(clientnum, "g_teamname_allies \"^5AsyLuM ^0Team\"");
        }
    }
}

http://www.itsmods.com/forum/Thread-HELP...8#pid83048
but its plugin for SD mod so every round you need to do this Dvar.
help any one ?
Do that SetDvar stuff in OnPlayerConnect and remove the SetClientDvar part.
(08-29-2012, 14:40)razkoko3 Wrote: [ -> ]change the team name and it dosend work :O...

(08-29-2012, 14:40)razkoko3 Wrote: [ -> ]it dosend work :O...


(08-29-2012, 14:40)razkoko3 Wrote: [ -> ]dosend
Code:
ServerSay("^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-^0-^5-", true);
wat de fawk!
Add in your plugin this:

Code:
public override void OnMapChange()
         {
            SetDvar("g_TeamName_Allies", "^2Still Alive...");
              SetDvar("g_TeamName_Axis", "^1ZOMBIES");
        
         }