Jump to content
Guest Dakati

Adding Commands

Recommended Posts

Hi,

I Have a little problem.

I've made a new script fr a command, put it in the right map etc.

When i go to the Editor to Add the command, it is'nt in the left list.

So, id do Assign new command SireneOn

I Leave the editor andt test the mod, but the command just is'nt there?

const char SIRENE_ON[]		= "VcmdSireneOn";
const char SIRENE_OFF[] = "VcmdSireneOff";

object SireneOn : CommandScript
{
VcmdSireneOn()
{
SetIcon("lighton");
SetCursor("lighton");
SetGroupID(DummyGroup);
SetGroupLeader(true);
SetRestrictions(RESTRICT_SELFEXECUTE);
}

bool CheckPossible(GameObject *Caller)
{
if (!Caller->IsValid())
return false;

if (Caller->GetType() == ACTOR_VEHICLE)
{
return true;
}

return false;
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID())
return false;

if (Caller->GetType() == ACTOR_VEHICLE)
{
return true;
}

return true;
}

void PushActions(GameObject *Caller, Actor *Target, int childID)
{
Vehicle v(Caller);

v.EnableBlueLights(true);
v.AssignCommand(SIRENE_OFF);
v.RemoveCommand(SIRENE_ON);
}
};

object SireneOff : CommandScript
{
VcmdSireneOff()
{
SetIcon("lightoff");
SetCursor("lightoff");
SetGroupID(DummyGroup);
SetGroupLeader(true);
SetRestrictions(RESTRICT_SELFEXECUTE);
}

bool CheckPossible(GameObject *Caller)
{
if (!Caller->IsValid())
return false;

if (Caller->GetType() == ACTOR_VEHICLE)
{
return true;
}

return false;
}

bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
if (!Caller->IsValid() || !Target->IsValid() || Target->GetID() != Caller->GetID())
return false;

if (Caller->GetType() == ACTOR_VEHICLE)
{
return true;
}

return true;
}

void PushActions(GameObject *Caller, Actor *Target, int childID)
{
Vehicle v(Caller);

v.EnableBlueLights(false);
v.AssignCommand(SIRENE_ON);
v.RemoveCommand(SIRENE_OFF);
}
};

Thanks!

Link to comment
Share on other sites

Hm... Have you saved it in the editor? Just asking, because I did the same thing once. And did you make sure it was a script done in 1. Wordpad, 2. It was saved as a .script file in your script file? Just make sure you have both of those, then i'll start looking into other possibilities too.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...