Hello!
I've got another feature that I want to work on which blocks the player from switching teams, in a way that doesn't revert him to his old team, rather not switching him teams in the first place.
I found that in DoD, "PTeam" is an event that is called when the player tries to switch teams.
Is there a way to overwrite / block the default procedure of the event? So that a custom function that is registered on the event will block the team switch from happening?
PHP Code:
register_event("PTeam", "dod_onswitchteams", "", "")
public dod_onswitchteams(id)
{
if(variable == desired_value)
{
//In theory this will stop the event from proceeding and nothing will happen
return EVENT_BLOCKED
}
//If skipped, the event will continue and user will switch teams
return EVENT_CONTINUE
}
Could something like this be even possible with events? or could this be done with forwards? or with hamsandwich?
Because I've noticed that there are return types such as PLUGIN_HANDLED, PLUGIN_CONTINUE but I can't seem to get them to work. (At least with my past attempts) Though I feel like my problem could be solved with those returns values in someway