ItsMods
[Release] Thirdperson plugin - Printable Version

+- ItsMods (https://www.itsmods.com)
+-- Forum: Archive (https://www.itsmods.com/Forum-Archive.html)
+--- Forum: Archive (https://www.itsmods.com/Forum-Archive--64.html)
+--- Thread: [Release] Thirdperson plugin (/Thread-Release-Thirdperson-plugin.html)

Pages: 1 2


Thirdperson plugin - Nekochan - 01-06-2012

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:


.rar   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; } } }




RE: Thirdperson plugin - Pozzuh - 01-06-2012

Good job





RE: Thirdperson plugin - Nekochan - 01-06-2012

(01-06-2012, 13:38)Pozzuh Wrote: Good job



posted for you Superman


RE: Thirdperson plugin - iAegle - 01-06-2012

Why did you put in the list<t>? :p
also you won't need System.Net

bysides that, nice and simple.


RE: Thirdperson plugin - Nekochan - 01-06-2012

(01-06-2012, 13:48)iAegle Wrote: Why did you put in the list<t>? :p
also you won't need System.Net

bysides that, nice and simple.

thats was in my test plugin, forgot to delete


RE: Thirdperson plugin - iAegle - 01-06-2012

Here's one that forces thirdperson for the whole server

Code:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Addon; namespace mw3_svr_3rdperson { public class Class1 : CPlugin { int Timer = 0; public override void OnServerLoad() { ServerPrint( "3rd Person Mode Loaded." ); SetDvar( "scr_thirdperson", "1" ); SetDvar( "cg_thirdperson", "1" ); } public override void OnServerFrame() { if ( Timer++ == 5000 ) { foreach( ServerClient client in GetClients() ) SetClientDvar( client.ClientNum, "cg_thirdperson \"1\"" ); if ( GetDvar( "scr_thirdperson" ) != "1" ) { SetDvar( "scr_thirdperson", "1" ); SetDvar( "cg_thirdperson", "1" ); } Timer = 0; } } } }



RE: Thirdperson plugin - JariZ - 01-06-2012

here's one that does exactly the same as the post above me

Code:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Addon; namespace mw3_svr_3rdperson { public class Class1 : CPlugin { public override void OnServerLoad() { ServerPrint( "3rd Person Mode Loaded." ); SetDvar( "scr_thirdperson", "1" ); } } }



RE: Thirdperson plugin - iAegle - 01-06-2012

(01-06-2012, 14:08)jariz Wrote: here's one that does exactly the same as the post above me

Code:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Addon; namespace mw3_svr_3rdperson { public class Class1 : CPlugin { public override void OnServerLoad() { ServerPrint( "3rd Person Mode Loaded." ); SetDvar( "scr_thirdperson", "1" ); } } }

Hmm true, but does that actually work? :o


RE: Thirdperson plugin - JariZ - 01-06-2012

Yes, tested it a few days ago just type "scr_thirdperson 1;map_restart" and your server is thirdperson without any plugins


RE: Thirdperson plugin - Nekochan - 01-06-2012

(01-06-2012, 14:14)jariz Wrote: Yes, tested it a few days ago just type "scr_thirdperson 1;map_restart" and your server is thirdperson without any plugins

Your code without view switching like my :3