THREAD: Mw2 c++ code help needed (sprx)
  1. 03-01-2017, 11:49 PM
    xPurpBoyyx's Avatar
    xPurpBoyyx
    Bounty hunter
    xPurpBoyyx's Avatar
    xPurpBoyyx
    Bounty hunter
    161
    Posts
    463
    Reputation
    May 2014
    NextGenUpdate
    Okay, So I've been working on a SPRX for a pretty long time now. Trying to make it stable and more to my style. Functions use a bool for a True or False statement to know whether or not to make the command On or Off.

    Well my issue is that they stay as "TRUE" and do not reset to "FALSE" on disconnect or game end. Does anyone know how to fix this? I've tried making a false statement for each bool when the menu is opened. It works but it's annoying, then I've tried with onPlayerSpawned. It works, but every time someone joins. It resets the bools and makes me lag. So, I ask if someone can help me make them reset on disconnect or game end.
  2. 03-02-2017, 12:13 AM
    SC58's Avatar
    SC58
    Former Staff
    SC58's Avatar
    SC58
    Former Staff
    4,467
    Posts
    119,383
    Reputation
    Sep 2012
    NextGenUpdate
    Originally Posted by xPurpBoyyx View Post
    Okay, So I've been working on a SPRX for a pretty long time now. Trying to make it stable and more to my style. Functions use a bool for a True or False statement to know whether or not to make the command On or Off.

    Well my issue is that they stay as "TRUE" and do not reset to "FALSE" on disconnect or game end. Does anyone know how to fix this? I've tried making a false statement for each bool when the menu is opened. It works but it's annoying, then I've tried with onPlayerSpawned. It works, but every time someone joins. It resets the bools and makes me lag. So, I ask if someone can help me make them reset on disconnect or game end.


    hook G_InitGame and store all you stuff there as this function init the game like gentity, gclient and other shit on the start of the game when map is loading or map restart, this is what i use


    0x18A2B8 - void G_InitGame(int levelTime, unsigned int randomSeed, int restart, int registerDvars, int savegame)
    Last edited by SC58 ; 03-02-2017 at 12:16 AM.

  3. The Following User Thanked SC58 For This Useful Post:


  4. 03-02-2017, 12:57 AM
    xPurpBoyyx's Avatar
    xPurpBoyyx
    Bounty hunter
    xPurpBoyyx's Avatar
    xPurpBoyyx
    Bounty hunter
    161
    Posts
    463
    Reputation
    May 2014
    NextGenUpdate
    Originally Posted by SC58 View Post
    hook G_InitGame and store all you stuff there as this function init the game like gentity, gclient and other shit on the start of the game when map is loading or map restart, this is what i use


    0x18A2B8 - void G_InitGame(int levelTime, unsigned int randomSeed, int restart, int registerDvars, int savegame)


    Okay, Thank you!
    Thread can be closed, I got the help I needed <3