05-30-2013, 18:28
hi all,
i have this as code: for the fx'es
so i have a question "how can i spawn for each map a different FX?"
like map dome = fx "fire/car_fire_mp"
and map lockdown = fx "smoke/battlefield_smokebank_S_warm_dense"
and this for each map how can i add that to my plugin?
i have this as code: for the fx'es
PHP Code:
using System;
using System.Collections.Generic;
using System.Text;
using Addon;
namespace Addon
{
public class FX : CPlugin
{
int fx = 0;
string map = "";
public override void OnPrecache()
{
fx = Extensions.LoadFX("fire/car_fire_mp");
}
public override void OnPlayerSpawned(ServerClient Client)
{
map = GetDvar("mapname");
if (map == "mp_dome")
{
Extensions.PlayFX(fx, new Vector(135.6009f, -261.9915f, 743.2084f));
Extensions.PlayFX(fx, new Vector(-24.5175f, -271.4558f, 721.1387f));
Extensions.PlayFX(fx, new Vector(80.38245f, -382.3839f, 663.1788f));
}
if (map == "mp_alpha")
{
Extensions.PlayFX(fx, new Vector(-683.41f, 1666.279f, 140.1256f));
Extensions.PlayFX(fx, new Vector(-693.41f, 1666.279f, 140.1256f));
Extensions.PlayFX(fx, new Vector(-703.41f, 1666.279f, 140.1256f));
}
}
}
}
so i have a question "how can i spawn for each map a different FX?"
like map dome = fx "fire/car_fire_mp"
and map lockdown = fx "smoke/battlefield_smokebank_S_warm_dense"
and this for each map how can i add that to my plugin?