08-29-2012, 14:40
That plugin supposed to change the team name and it dosend work :O...
help pls
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\"");
}
}
}