/// <summary> /// Raises the <see cref="PlayerRequestClass" /> event. /// </summary> /// <param name="player">The player triggering the event.</param> /// <param name="e">An <see cref="RequestClassEventArgs" /> that contains the event data. </param> protected virtual void OnPlayerRequestClass(GtaPlayer player, RequestClassEventArgs e) { if (PlayerRequestClass != null) PlayerRequestClass(player, e); }
internal bool OnPlayerRequestClass(int playerid, int classid) { var args = new RequestClassEventArgs(classid); OnPlayerRequestClass(GtaPlayer.FindOrCreate(playerid), args); return !args.PreventSpawning; }
/// <summary> /// Raises the <see cref="PlayerRequestClass" /> event. /// </summary> /// <param name="player">The player triggering the event.</param> /// <param name="e">An <see cref="RequestClassEventArgs" /> that contains the event data. </param> protected virtual void OnPlayerRequestClass(BasePlayer player, RequestClassEventArgs e) { PlayerRequestClass?.Invoke(player, e); }