Hey guys,
This is my first plugin, you can toggle thirdperson view by !thirdperson X
X = 1 - Enable
X = 0 - Disable
Created by me, thanks to Jariz for small tuts about C#
Fixed:
3rdperson_plug.rar (Size: 2.16 KB / Downloads: 148)
SOURCE: C#
This is my first plugin, you can toggle thirdperson view by !thirdperson X
X = 1 - Enable
X = 0 - Disable
Created by me, thanks to Jariz for small tuts about C#
Fixed:
3rdperson_plug.rar (Size: 2.16 KB / Downloads: 148)
SOURCE: C#
Code:
using Addon;
using System.Collections.Generic;
namespace plugin_test
{
public class plugin_test : CPlugin
{
public override void OnServerLoad()
{
ServerPrint("\n THIRDPERSON PLUGIN LOADED \n AUTHOR: x7'se7en");
}
public override ChatType OnSay(string Message, ServerClient Client)
{
List<string> lines = new List<string>();
if (Message.StartsWith("!thirdperson"))
{
if (Message.Substring(13) == "1")
{
SetClientDvar(Client.ClientNum, "cg_thirdPerson \"1\"");
TellClient(Client.ClientNum, "^3Thirdperson enabled.", true);
}
else if (Message.Substring(13) == "0")
{
SetClientDvar(Client.ClientNum, "cg_thirdPerson \"0\"");
TellClient(Client.ClientNum, "^3Thirdperson disabled.", true);
}
if (Message.Substring(13) != "0" && Message.Substring(13) != "1")
{
TellClient(Client.ClientNum, "^1Wrong value", true);
}
}
return ChatType.ChatContinue;
}
}
}
