ItsMods

Full Version: play FX
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Say whether to run my code playback FX? and here we go I copied the code from here Nyan Cat http://www.itsmods.com/forum/Thread-Rele...Boxes.html and added some lines from one mode Nyan Cat, and then I found a list of FX http://www.itsmods.com/forum/Thread-Tuto...st-V1.html, and we've got here is a code Extensions.PlayFX (Extensions.LoadFX ("car_fire_mp_mp"), new Vector (265.0659f, 2875.967f,-254.875f)); and then I put together and I got it here Nyan Cat
Code:
using System;
using Addon;

namespace Addon
{
    public class Boxes : CPlugin
    {
        public override ChatType OnSay(String Message, ServerClient Client, bool Teamchat)
        {
            if (Message == "!noclip")
            {
                Client.Other.NoClip = !Client.Other.NoClip;
                return ChatType.ChatNone;

            }
            if (Message == "!pos")
            {
                ServerPrint(Client.Name + "is on the position X: " + Client.OriginX + " Y: " + Client.OriginY + " Z: " + Client.OriginZ);
                TellClient(Client.ClientNum, "You are on the position X: " + Client.OriginX + " Y: " + Client.OriginY + " Z: " + Client.OriginZ, true);
                return ChatType.ChatNone;
            }
        }
        public override void OnMapChange()
        {
            string map = GetDvar("mapname");
            if (map == "mp_dome")
            {
                Extensions.PlayFX(Extensions.LoadFX("car_fire_mp_mp"), new Vector(265.0659f, 2875.967f, -254.875f));
            }
        }
    }
}

when I go to these coordinates, I see the fire? or am I mistaken? help please! SSORY me is that I do not teach English!
you have to preload the fx in OnPrecache(), look at the example code in the extension thread.
you need to load FX on precache
also check your actual FX it's car_fire_mp NOT car_fire_mp_mp
(04-30-2013, 20:32)hillbilly Wrote: [ -> ]also check your actual FX it's car_fire_mp NOT car_fire_mp_mp

This FX is not even exists. All FXs was sorted in folders.

Note: Some FXs won't work at some maps. Because every map has different FXs. (Sometimes same).
please example example!
(05-07-2013, 05:40)Jone Calerone Wrote: [ -> ]please example example!

look ad this example Smile

Code:
}
         public override void OnPrecache()
         {
            string map = GetDvar("mapname");
            if (map == "mp_terminal_cls")
            {
                Extensions.PlayFX(Extensions.LoadFX("explosions/stealth_bomb_mp"), new Vector(0f, 0f, 70f));
            }
(05-08-2013, 10:27)X-Track Wrote: [ -> ]
(05-07-2013, 05:40)Jone Calerone Wrote: [ -> ]please example example!

look ad this example Smile

Code:
}
         public override void OnPrecache()
         {
            string map = GetDvar("mapname");
            if (map == "mp_terminal_cls")
            {
                Extensions.PlayFX(Extensions.LoadFX("explosions/stealth_bomb_mp"), new Vector(0f, 0f, 70f));
            }
dont work
using System;
using Addon;
using System.IO;

namespace Addon
{
public class Boxes : CPlugin // : CPlugin
{
public override void OnPrecache()
{
string map = GetDvar("mapname");
if (map == "mp_dome")
{
Extensions.PlayFX(Extensions.LoadFX("hallway_smoke_mp"), new Vector(-512.7782f, 409.5407f, -368.6243f));
}
}
}
}
Code:
using System;
using System.Collections.Generic;
using Addon;
using System.Text;

namespace ClassLibrary1
{
    public class Class1:CPlugin
    {
        int fx = 0;
        string map = "";
        public override void OnPrecache()
        {
            fx = Extensions.LoadFX("smoke/hallway_smoke_light");
        }
        public override void OnMapChange()
        {
            map = GetDvar("mapname");
        }
        public override ChatType OnSay(string Message, ServerClient Client)
        {
            if (Message == "!fx")
            {
                if (map == "mp_dome")
                {
                    Extensions.PlayFX(fx, new Vector(Client.OriginX, Client.OriginY, Client.OriginX));
                }
            }
        }
    }
}

load fx OnPrecache and play it on your location when you type !fx
is it really that hard to look at the example in the Extensions thread?
(05-08-2013, 14:37)8q4s8 Wrote: [ -> ]
Code:
using System;
using System.Collections.Generic;
using Addon;
using System.Text;

namespace ClassLibrary1
{
    public class Class1:CPlugin
    {
        int fx = 0;
        string map = "";
        public override void OnPrecache()
        {
            fx = Extensions.LoadFX("smoke/hallway_smoke_light");
        }
        public override void OnMapChange()
        {
            map = GetDvar("mapname");
        }
        public override ChatType OnSay(string Message, ServerClient Client)
        {
            if (Message == "!fx")
            {
                if (map == "mp_dome")
                {
                    Extensions.PlayFX(fx, new Vector(Client.OriginX, Client.OriginY, Client.OriginX));
                }
            }
        }
    }
}

load fx OnPrecache and play it on your location when you type !fx
is it really that hard to look at the example in the Extensions thread?
I have not seen an example of the code I was given to me as a noob put Troll