Jump to content
cops

Script help

Recommended Posts

Hi everyone for the San Diego I'm making a script for a lightpatern but when I turn it on it won't go off if I click again on the icon...

can anyone help me?


// 1.0
object VCmdAdditionalLight4 : CommandScript
{
VCmdAdditionalLight4()
{
SetIcon(IMG);
SetCursor(IMG);
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);

if (v.HasCommand(DUMMY_HASADDITIONALLIGHT4))
{
v.EnableSpecialLights(false);
v.RemoveCommand(DUMMY_HASADDITIONALLIGHT4);
} else if (!v.HasCommand(DUMMY_HASADDITIONALLIGHT4))
{
v.EnableSpecialLights(true);
v.AssignCommand(DUMMY_HASADDITIONALLIGHT4);
}
}
};

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...