Post: Mw2 c++ code help needed (sprx)
03-01-2017, 11:49 PM #1
xPurpBoyyx
Bounty hunter
(adsbygoogle = window.adsbygoogle || []).push({}); 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.
03-02-2017, 12:13 AM #2
SC58
Former Staff
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.

The following user thanked SC58 for this useful post:

xPurpBoyyx
03-02-2017, 12:57 AM #3
xPurpBoyyx
Bounty hunter
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

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo