Resetscore does't work.
Hi, i've made a resetscore plugin and for some reason it does't work. It's for a friend a he said that only the messages apear; the score remains the same.
Here's the code: PHP Code:
P.S.: Sorry for any grammar mistakes or writing mistakes. |
Re: Resetscore does't work.
Instead of if( !dead && !kill ) you should check if( dead || kill ) aka if( dead != 0 || kill != 0 ).
Try this : PHP Code:
cs_set_user_deaths(id, 0) set_user_frags(id, 0) cs_set_user_deaths(id, 0) set_user_frags(id, 0) with set_user_frags(id, 0) cs_set_user_deaths(id, 0) // make sure to place that one in 2nd position. |
Re: Resetscore does't work.
I did't knew what was the problem because my friend haven't told me until today that the message shown was "your score is already 0-0" so I knew i had messed up that if.
Thanks for the alternative. I have a question about it: PHP Code:
|
Re: Resetscore does't work.
This is HL code but i think cs code is the same :
Code:
void CBasePlayer::AddPoints( int score, BOOL bAllowNegativeScore )So, as you can see : pev->frags += score; There, score is equal to -frags, so frags + -frags = 0. You we have previously set m_iDeaths to 0. |
Re: Resetscore does't work.
Got it. Thank you very much
|
| All times are GMT -4. The time now is 15:09. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.