Jump to content

[Question] Checking when player leaves team


kieran

Recommended Posts

I have a script for a job which spawns a marker, but when my player changes team I want to be able to destroy that marker, I know one way is make a command in each resource to set the players team to nil, then if the player is not in the team from that resource, just return the script, but it get's annoying for players because they have to type that command and leave their team all the time... xD 

So my question is, does anyone know of a handler that's triggered when a player changes team?  If not...  is there a way to add a custom event and trigger it across different resources?  For example, if I made 2 resources, Resource 1 and Resource 2 and I added a triggerClientEvent in Resource 1 for a custom event in Resource 2, it would be able to find the custom event in resource 2 and execute it...

Basically I want to find a way to trigger a custom event outwith the resource.

Link to comment
  • Moderators

@kieran

Oh and one last thing:

bool addEvent ( string eventName [, bool allowRemoteTrigger = false ] )   

 

If you use the addEvent function, you can allow and disallow triggers from different sides(client/server)

TRUE = enabled

 

I recommend you to add this function to the resource where you are also triggering from, because if you trigger an event which isn't added yet, you would receive warnings.

 

Edited by IIYAMA
  • Thanks 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...