09-28-2012, 08:13
Source code:
Screenshot:
Creator: [Z00MBY] Alex
Spoiler (Click to View)
CSHARP Code
- using Addon;
- using System;
- using System.Collections.Generic;
-
- namespace randomtext
- {
- public class randomtext : CPlugin
- {
-
- int Counter = -1;
-
- public void RandomText()
- {
- switch (rand.Next(0, 4))
- {
- case 0:
- rndtxt = "random text";
- break;
- case 1:
- rndtxt = "random text 2";
- break;
- case 2:
- rndtxt = "random text 3";
- break;
- case 3:
- rndtxt = "random text 4";
- break;
- }
- }
-
- string rndtxt = string.Empty;
-
- public override void OnMapChange()
- {
- Counter = 0;
- RandomText();
- }
-
- private void CreateRndtext()
- {
- HudElem txt = CreateNewHudElem();
- txt.Type = HudElementTypes.Text;
- txt.ShowToEnt = Entity_World;
- txt.HideInMenu = true;
- txt.Font = HudElementFonts.Default;
- txt.FontScale = 1.1f;
- txt.PointType = 82;
- txt.OriginY = 220f;
- txt.OriginX = 700f;
- txt.SetString(rndtxt);
- }
-
-
- public override void OnAddonFrame()
- {
- if (Counter >= 0)
- {
- Counter++;
- if (Counter >= (1000 / AddonFrameInterval))
- {
- CreateRndtext();
- Counter = -1;
- }
- }
- }
-
-
-
- }
- }
Spoiler (Click to View)