I couldn't do that, if a player used a specific command to activate a specific trigger, can you help me?
Dear forum users! In compliance with the new European GDPR regulations, we'd just like to inform you that if you have an account, your email address is stored in our database. We do not share your information with third parties, and your email address and password are encrypted for security reasons.
New to the forum? Say hello in this topic! Also make sure to read the rules.
New to the forum? Say hello in this topic! Also make sure to read the rules.
How to when to use a specific command to activate a trigger automatically
Forum rules
By using the forum you agree to the following rules.
By using the forum you agree to the following rules.
- Kevi
- Meatbag
- Posts: 3
- Joined: Thu Jun 11, 2020 3:36 am
- Title: Kevi
- SFD Account: KeviBR
- Gender:
- Age: 16
How to when to use a specific command to activate a trigger automatically
0 x
Hi, I can't speak much English, I live in Brazil and ... yes, that's it, and I like the letter "comic sans" , and map maker
- Odex64
- Superfighter
- Posts: 172
- Joined: Sat Jul 29, 2017 12:39 pm
- Title: Content Creator
- SFD Account: Odex64
- Started SFD: PreAlpha
- Location: Italy
- Gender:
- Age: 22
Code: Select all
public void OnStartup()
{
Events.UserMessageCallback.Start(Commands);
}
public void Commands(UserMessageCallbackArgs cmds)
{
if (cmds.IsCommand && cmds.User.IsModerator)
{
switch (cmds.Command)
{
case "EXPLOSION": //NAME OF THE COMMAND
((IObjectTrigger) Game.GetSingleObjectByCustomId("exp")).Trigger(); //USE THIS TO ACTIVATE 1 TRIGGER
break;
case "SPAWN":
foreach(IObjectTrigger spwn in Game.GetObjectsByCustomId("spawn")) //USE THIS TO ACTIVATE MULTIPLE TRIGGERS
spwn.Trigger();
break;
}
}
}
2 x