Jump to content
Lineman

(Help) Disable selecting role in lobby which has no tickets

Recommended Posts

Making a mission with 3 respawn locations and 1 ticket per role (selected from lobby screen). On death, the respawn button is disabled, as desired. However,  players can return to the lobby screen and respawn in a role which had lost it's ticket on death.

For example a player selects medic. He dies and cannot select respawn, and becomes a spectator. He rejoins the server, and is able to respawn as the medic. How can I prevent this?

 

My respawn scripts:

 

description.ext

respawn = "BASE";
disabledAI = 1;
respawnButton = 1;
respawnDelay = 3;
respawnTemplates[] = {"Tickets","EndMission","MenuPosition","Spectator"};

 

initPlayerLocal.sqf

[player, 1] call BIS_fnc_respawnTickets;

 

 

Share this post


Link to post
Share on other sites

You could check the last selected loadout as shown in the above linked thread. Then do some condition checks against it or something. Need more info to help you...

  • Like 1

Share this post


Link to post
Share on other sites
On 8/6/2018 at 8:18 AM, HazJ said:

You could check the last selected loadout as shown in the above linked thread. Then do some condition checks against it or something. Need more info to help you...

I could be wrong but I'm not sure if jwllorens and I have quite the same issue. I want to remove multiplayer slots in the lobby screen once tickets are exhausted. For example...

 

Alpha 1:

Medic

Machinegunner

AT Specialist

 

Problem:
(1) Player selects Medic.

(2) Spawns and dies 3 times, depleting 3 out of 3 tickets.

(3) Is restricted to spectator with the respawn button reading "Respawn Disabled", but...
(3) Clicks escape, abort, and returns to lobby screen.
(4) Is able to select Medic again and has 3 fresh tickets.

Share this post


Link to post
Share on other sites

You cannot change the slots available in the lobby.

One way you could possibly handle this is, when a player joins check if this slot has used all of its respawns tickets and kick the player back to the lobby (endMission) with a message describing why, so they can choose another slot. Similar to this but instead of checking the player uid your are checking that slots available respawn tickets.

You will need to remove the adding of tickets away from the initPlayerLocal.sqf and instead use the server to apply and monitor.

  • Like 1

Share this post


Link to post
Share on other sites

Or be all fancy and go OTT with skipLobby param in description.ext then make your whole new UI for lobby. Not recommended, all depends on the project and what you want, etc...

  • Like 1

Share this post


Link to post
Share on other sites
10 minutes ago, HazJ said:

Or be all fancy and go OTT with skipLobby param in description.ext then make your whole new UI for lobby. Not recommended, all depends on the project and what you want, etc...

New UI might be a bit much for me.

 

8 hours ago, Larrow said:

You cannot change the slots available in the lobby.

One way you could possibly handle this is, when a player joins check if this slot has used all of its respawns tickets and kick the player back to the lobby (endMission) with a message describing why, so they can choose another slot. Similar to this but instead of checking the player uid your are checking that slots available respawn tickets.

You will need to remove the adding of tickets away from the initPlayerLocal.sqf and instead use the server to apply and monitor.

That would work. But what about "attaching" tickets to unique player ID after they choose a slot? For example, player would be restricted to spectator upon losing 3 of 3 tickets and can no longer spawn in any multiplayer slot.

  • Like 2

Share this post


Link to post
Share on other sites

 

3 minutes ago, Lineman said:

That would work. But what about "attaching" tickets to unique player ID after they choose a slot? For example, player would be restricted to spectator upon losing 3 of 3 tickets and can no longer spawn in any multiplayer slot.

 

definitely? With no mean to play again?

 

Share this post


Link to post
Share on other sites
Just now, pierremgi said:

 

 

definitely? With no mean to play again?

 

Yeah. Until the mission is restarted.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×