Jump to content
paulo ve

winch

Recommended Posts

error not pull the car!Help

 

Scritp.

 

object gf_winde : CommandScript
{
gf_winde()
{
SetIcon("winde");
SetCursor("winde");
SetGroupID(windegroup);
SetGroupLeader(true);
}
 
    bool CheckGroupVisibility(GameObject *Caller)
    {
bool ok=Caller->IsChildEnabled("winde");
return ok;
}
 
bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
Vehicle o(Target);
bool ok=(o.IsFlagSet(OF_RECOVERABLE) && Caller->GetID()!=Target->GetID());
if (Target->GetType()==ACTOR_VEHICLE)
ok=ok && !o.HasEnclosedPerson();
return ok;
}
 
void PushActions(GameObject *Caller, Actor *Target, int childID)
{
gf_tec::winde_installieren (Caller, Target, childID);
}
};
 
object gf_winde_stop : CommandScript
{
 
Actor a;
 
gf_winde_stop()
{
SetIcon("winde_stop");
SetCursor("winde_stop");
SetGroupID(windegroup);
SetGroupLeader(false);
SetPriority(100);
}
 
    bool CheckGroupVisibility(GameObject *Caller)
    {
bool ok=!Caller->IsChildEnabled("winde");
if (ok) {
a=Game::GetActor(Caller->GetUserData());
Vehicle v(&a);
ok=v.IsMoving() && v.IsPulling();
}
return ok;
}
 
bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
bool ok=true; // Target->GetID()!=Caller->GetID();
return ok;
}
 
void PushActions(GameObject *Caller, Actor *Target, int childID)
{
Vehicle v(&a);
v.PushActionWait (ACTION_NEWLIST,0.1);
}
};
 
object gf_winde_pull : CommandScript
{
 
Actor a;
 
gf_winde_pull()
{
SetIcon("winde_zug");
SetCursor("winde_zug");
SetGroupID(windegroup);
SetGroupLeader(false);
SetPriority(100);
}
 
    bool CheckGroupVisibility(GameObject *Caller)
    {
bool ok=!Caller->IsChildEnabled("winde");
if (ok) {
a=Game::GetActor(Caller->GetUserData());
Vehicle v(&a);
ok=!v.IsMoving() && v.IsPulling();
}
return ok;
}
 
bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
bool ok=Target->GetID()!=Caller->GetID();
return ok;
}
 
void PushActions(GameObject *Caller, Actor *Target, int childID)
{
gf_tec::rausziehen (Caller,Target);
}
};
 
object gf_winde_weg : CommandScript
{
 
gf_winde_weg()
{
SetIcon("winde");
SetCursor("winde");
SetGroupID(windegroup+1);
SetGroupLeader(false);
SetPriority(100);
SetRestrictions(RESTRICT_SELFEXECUTE);
}
 
    bool CheckGroupVisibility(GameObject *Caller)
    {
bool ok=!Caller->IsChildEnabled("winde");
if (ok) {
Actor a=Game::GetActor(Caller->GetUserData());
Vehicle v(&a);
ok=!v.IsMoving() && v.IsPulling();
}
return ok;
}
 
bool CheckTarget(GameObject *Caller, Actor *Target, int childID)
{
bool ok=Caller->GetID()==Target->GetID();
return ok;
}
 
void PushActions(GameObject *Caller, Actor *Target, int childID)
{
gf_tec::winde_abbauen (Caller);
}
};
 
Link to comment
Share on other sites

windegroup must point to an integer, which is simply a digit such as 27 or whatever GroupID is not being used by the same caller (in other scripts) yet.

 

Right now windegroup is not defined at all, so that results in an error. Add the following line on top of the script:

int windegroup = 27;

That should solve the error you wrote in your last post. Other than that, I have no idea what the script is supposed to do since there is no explanation. And because you didn't put the script in the code tags it's nearly unreadable as well. I'm guessing the script won't do anything.

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...