Results 1 to 7 of 7

Thread: Keeping a player on one team even if they leave and rejoin

  1. #1
    Private
    Join Date
    Jul 2015
    Posts
    44
    Thanks
    7
    Thanked 2 Times in 2 Posts

    Keeping a player on one team even if they leave and rejoin

    I'm extremely sorry for making threads that most people couldn't understand what I was trying to say, but there's an issue I really want to try and get rid of.
    I'm trying to make an MW3 gametype in cod4, which is Infected.
    A feature I want to add into the mod gametype is how to make it so that if a player gets infected, they can't leave and rejoin to become a survivor again. Because at the moment, if a player gets killed and becomes infected, they can simply leave the game and rejoin to become a survivor, which isn't fair on the other infected players.
    Last edited by akuma2099; 21st September 2015 at 09:23.

  2. #2
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by akuma2099 View Post
    I'm extremely sorry for making threads that most people couldn't understand what I was trying to say, but there's an issue I really want to try and get rid of.
    I'm trying to make an MW3 gametype in cod4, which is Infected.
    A feature I want to add into the mod gametype is how to make it so that if a player gets infected, they can't leave and rejoin to become a survivor again. Because at the moment, if a player gets killed and becomes infected, they can simply leave the game and rejoin to become a survivor, which isn't fair on the other infected players.
    I don't think you can disable console for players in COD4, which makes it impossible to stop anyone leaving - [console key] > TAB > ENTER - the player left!

    So, you will need to write a method which remembers a player leaving who is the infected, and if they come back, make them the infected again. It will soon put them off leaving and trying to return.

  3. #3
    Private
    Join Date
    Jul 2015
    Posts
    44
    Thanks
    7
    Thanked 2 Times in 2 Posts
    I didn't write that right, I didn't want to stop people from leaving, I just wanted it so if they got infected, left the game and rejoined, they wouldn't be put back on the survivor team, which is why I made this thread, i'm not sure how to make that happen.

  4. #4
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    At the player disconnect method - get the player's GUID if they are infected, and save it as a level struct (e.g. level.wasInfected)

    At the player connect method - get every player's GUID, and if one matches your level struct (level.wasInfected) make them the infected again.

  5. #5
    Private
    Join Date
    Jul 2015
    Posts
    44
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Any specific functions, or possible a gametype that uses this method I could try and base off?

  6. #6
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    Why are you allowing players that connect during a round to go survivor anyway? Shouldnt they be zombies then anyway?

    Just disable all user-based team switching and you should be fine (ofc keep spectate stuffs, but rejoining a team during a round should ALWAYS result in becoming a zombie)
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  7. #7
    Private
    Join Date
    Jul 2015
    Posts
    44
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Good idea, i'll do that, although, I will keep at trying to make the getguid work to hopefully get it working at one point

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •