Jump to content

Add Vehicles/Peds to duty menu


Stvxv.g

Recommended Posts

vor 8 Minuten schrieb firebuff101:

I don't know what you're trying to ask

Look. When I go onDuty, I can choose between LSPD, LSSD etc. and between Vehicles.

 

My question is, if I can code my callout that it will only appear if I am for example LSPD, but when I am LSSD the callout will not appear.

 

Perfectly it would be, if I can code callouts that they only appear if I am inside of an specific vehicle, but you said there is no way.

Link to comment
Share on other sites

vor 8 Minuten schrieb firebuff101:

Agency Callouts sort of does that, but only with its included callouts. @Stvxv.g. You could also try getting EUP and forcing duty.

I also want that only with my callouts. How can I implement that into my code? Is there somthing like "getPedOccupiedVehicle" what I can check for?

Link to comment
Share on other sites

7 minutes ago, Stvxv.g said:

I also want that only with my callouts. How can I implement that into my code? Is there somthing like "getPedOccupiedVehicle" what I can check for?

I don't write code, so I don't know

I don't understand the point of signatures on this site. What the fuck is the point?

Link to comment
Share on other sites

9 minutes ago, Stvxv.g said:

Brah. If you don't write code, then how you could have answered my first question?

Because I know how this works. You can't add shit to it because the mod wasn't written that way. Everyone knows that. That question has been answered over and over since LSPDFR was released.

Edited by firebuff101

I don't understand the point of signatures on this site. What the fuck is the point?

Link to comment
Share on other sites

@Stvxv.g you can't add peds/vehicles to the go on duty menu but when making your callout you can override the OnBeforeCalloutDisplayed() method and there check whatever you want, for example

public override bool OnBeforeCalloutDisplayed()
{
	if (Game.LocalPlayer.Character.Model != new Model("your_model"))
      	return false;  // if the player isn't the specified model, abort the callout
  
	if (!Game.LocalPlayer.Character.IsInAnyVehicle(false) || Game.LocalPlayer.Character.CurrentVehicle.Model != new Model("vehiclemodel"))
      	return false; // if the player isn't in a vehicle or the current vehicle isn't the specified model, abort the callout
  
  
  	// if all checks passed, continue...
}

 

Edited by alexguirre
Link to comment
Share on other sites

36 minutes ago, firebuff101 said:

Because I know how this works. You can't add shit to it because the mod wasn't written that way. Everyone knows that. That question has been answered over and over since LSPDFR was released.

 

I've told you time and time again, you don't have to be so angry when replying to topics. Tone it down, or don't reply at all.

Invenio, Investigatio, Imperium

Link to comment
Share on other sites

1 hour ago, alexguirre said:

@Stvxv.g you can't add peds/vehicles to the go on duty menu but when making your callout you can override the OnBeforeCalloutDisplayed() method and there check whatever you want, for example


public override bool OnBeforeCalloutDisplayed()
{
	if (Game.LocalPlayer.Character.Model != new Model("your_model"))
      	return false;  // if the player isn't the specified model, abort the callout
  
	if (!Game.LocalPlayer.Character.IsInAnyVehicle(false) || Game.LocalPlayer.Character.CurrentVehicle.Model != new Model("vehiclemodel"))
      	return false; // if the player isn't in a vehicle or the current vehicle isn't the specified model, abort the callout
  
  
  	// if all checks passed, continue...
}

 

 

In addition to what alex said, you can also check the vehicle type:

 

public override bool OnBeforeCalloutDisplayed()
{
  	// Returns false (cancelling the callout) if the player is not in a vehicle or is not in a plane
  	// Note that you have to check isInAnyVehicle first, because CurrentVehicle will be null if 
	// the player isn't in a vehicle, which would crash the plugin. 
	if (!Game.LocalPlayer.Character.IsInAnyVehicle(false) || !Game.LocalPlayer.Character.CurrentVehicle.IsPlane)
      	return false; 
  
}

 

[REL] Coastal Callouts: An action-packed mod with new vehicles, maps, capabilities, and callouts in and around the waters of Los Santos

[REL] Police Tape: Make your scenes more realistic while stopping peds and traffic

[REL] Better EMS: Realistic and dynamic EMS response

Join the Parks Benefactor Program to support my work and get early beta access!

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.

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