Raised This Month: $76 Target: $400
 19% 

[MVP] MVP Of the Round + Custom Sounds (reAPI Support)


Post New Thread Reply   
 
Thread Tools Display Modes
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 06-04-2021 , 09:45   Re: MVP Of the Round + Custom SoundTracks (reAPI Support)
Reply With Quote #51

Quote:
Originally Posted by SoulWeaver16 View Post
Where can I find AMX mod x 1.9+?
I only know 1.8.2 :/
Here we go:
https://www.amxmodx.org/downloads-new.php
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders

CSGO REMAKE ~ CSGO MOD [STABLE]
Shadows Adi is offline
lexzor
Senior Member
Join Date: Nov 2020
Old 07-16-2021 , 12:19   Re: [MVP] MVP Of the Round + Custom SoundTracks (reAPI Support)
Reply With Quote #52

Code:
L 07/16/2021 - 19:08:22: [AMXX] Displaying debug trace (plugin "most_valuable_player.amxx", version "2.0")
L 07/16/2021 - 19:08:22: [AMXX] Run time error 10: native error (native "ArrayGetArray")
L 07/16/2021 - 19:08:22: [AMXX]    [0] most_valuable_player.sma::PlayTrack (line 985)
L 07/16/2021 - 19:08:22: [AMXX]    [1] most_valuable_player.sma::CalculateTopKiller (line 855)
L 07/16/2021 - 19:08:22: [AMXX]    [2] most_valuable_player.sma::task_check_scenario (line 775)
lexzor is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 07-17-2021 , 09:04   Re: [MVP] MVP Of the Round + Custom SoundTracks (reAPI Support)
Reply With Quote #53

Quote:
Originally Posted by lexzor View Post
Code:
L 07/16/2021 - 19:08:22: [AMXX] Displaying debug trace (plugin "most_valuable_player.amxx", version "2.0")
L 07/16/2021 - 19:08:22: [AMXX] Run time error 10: native error (native "ArrayGetArray")
L 07/16/2021 - 19:08:22: [AMXX]    [0] most_valuable_player.sma::PlayTrack (line 985)
L 07/16/2021 - 19:08:22: [AMXX]    [1] most_valuable_player.sma::CalculateTopKiller (line 855)
L 07/16/2021 - 19:08:22: [AMXX]    [2] most_valuable_player.sma::task_check_scenario (line 775)
Can't figure out too much from this error, but I made a small change to code, to check if arraysize - 1 is smaller than UserSelectedTrack.

Show one more line from above which provides the error.
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders

CSGO REMAKE ~ CSGO MOD [STABLE]
Shadows Adi is offline
lexzor
Senior Member
Join Date: Nov 2020
Old 07-22-2021 , 14:59   Re: [MVP] MVP Of the Round + Custom SoundTracks (reAPI Support)
Reply With Quote #54

the error does not always occur. from what I noticed, it appears when there are 2 players and the round ends very quickly (in the mode one mvp does not end and the other must start).

update idea: how to find the mvp: after how many kills the player made or after the damage given in that round


EDIT: The plugin don t save the data correct (nvault)

Last edited by lexzor; 07-24-2021 at 06:25.
lexzor is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 07-29-2021 , 04:29   Re: [MVP] MVP Of the Round + Custom SoundTracks (reAPI Support)
Reply With Quote #55

Update!
Version 2.1

  • Fixed a small bug when playing a track.
  • Implemented plugin compilation through GitHub. Thanks fysiks
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders

CSGO REMAKE ~ CSGO MOD [STABLE]
Shadows Adi is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 08-11-2021 , 15:11   Re: [MVP] MVP Of the Round + Custom SoundTracks (reAPI Support)
Reply With Quote #56

BugFix
  • Revert the change made in previous update
  • Fixed saving / loading ignore for Bots / HLTV's

Edit: as an extra, here is some good romanian music enjoy, I'm vibing, Idk : ) ( https://www.youtube.com/watch?v=tqRK0CqwBKw )
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders

CSGO REMAKE ~ CSGO MOD [STABLE]

Last edited by Shadows Adi; 08-11-2021 at 15:14. Reason: Added some romanian music :))
Shadows Adi is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 08-14-2021 , 14:30   Re: [MVP] MVP Of the Round + Custom SoundTracks (reAPI Support)
Reply With Quote #57

Update!
Version 2.2
  • Fixed a bug when displaying a message to all players using ML ( see the screenshot ) thanks lexzor
  • Implemented automatically connect to SqLite database if the MySQL database connection fails
  • Code style improvements

__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders

CSGO REMAKE ~ CSGO MOD [STABLE]

Last edited by Shadows Adi; 08-14-2021 at 14:32.
Shadows Adi is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-18-2021 , 11:08   Re: [MVP] MVP Of the Round + Custom SoundTracks (reAPI Support)
Reply With Quote #58

I don't really see the point of using reAPI in this plugin. Everything can be achieved by using the default amxx module(which you already did when reapi is turned off). But, since you already did the work, it's okay to leave this as it is, with only one change. In my opinion, USE_REAPI should not be defined by default. This way, if people have no idea what reapi is or don't know how to edit the source code they can still use the plugin.
Remember that code without reapi works both in hlds and regamedll/rehlds, but code with reapi doesn't. The default should be the setting with wider coverage.
__________________

Last edited by HamletEagle; 08-18-2021 at 11:11.
HamletEagle is online now
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 08-18-2021 , 17:11   Re: [MVP] MVP Of the Round + Custom SoundTracks (reAPI Support)
Reply With Quote #59

Thank you for feedback, just changed the default method.
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders

CSGO REMAKE ~ CSGO MOD [STABLE]
Shadows Adi is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-19-2021 , 13:09   Re: [MVP] MVP Of the Round + Custom SoundTracks (reAPI Support)
Reply With Quote #60

1.
PHP Code:
#define IsPlayer(%1)                    (1 <= %1 <= MAX_PLAYERS) 
You should ideally check against get_maxplayers(cached in a global variable).

2. CreateMultiForward returns -1 on failure so you should probably check that before executing the forward.

3. if(g_iSaveType) at line 223
While this is functionally correct it is hard to read and understand. You should explicitly check if g_iSaveType != NVAULT. It's easier to understand what is going on(freeing handles based on the saving system that's currently used).

4.
PHP Code:
new szConfigsDir[64], szFileName[64
I would suggest increasing the size to 256, just in case the configs dir path is changed(to avoid an index out of bounds error).

5.
PHP Code:
while(!feof(iFile)) 
It is better to use while(!fgets(...)) instead of feof. This is because you can't absolutely be sure there is no more data unless you try to read it and see the file is empty. Otherwise, things could change and cause an error. However, it is not likely to happen in a server where the file is usually only processed by the server.

6. Inside
PHP Code:
if(szData[0] == '['
(line 258 ) you can add continue to skip the line, after the section counter is increased. Then you can remove the checks for '[' from the switch.

7. In TRACKS_SECTION you may want to do ArrayPushArray only if the file exists. Otherwise, you are storing invalid data.

8. Regarding strtok2, if this is the only 1.8.3+ specific function then you can replace it with strtok, do not use it for trimming, and manually call trim on left and right. It would be great if the plugin would support amxx 1.8.2 as well.

9. if(szValue[0] == EOS || !szValue[0])
This is redundant, both conditions check the same thing. EOS is basically 0: if the first character in a string is 0(EOS) then the string is empty. if(szValue[0] == EOS) is enough.

10. if(0 <= str_to_num(szValue) <= 2)
You have definitions, use them. NVAULT is 0, SQL_LITE is 2. Same thing below: g_iSaveType = 0 should be g_iSaveType = NVAULT.

11.
PHP Code:
str_to_num(szValue) == g_bAuthData == true g_bAuthData == false 
This is not right. Did you mean to use "=" instead of "=="? Otherwise, this line does nothing, it just checks if the value is 1 and then checks if g_bAuthData is true or false, without actually doing anything.

12.
PHP Code:
g_iSaveInstant str_to_num(szValue
Should you validate szValue before(negative numbers, something else besides 0 and 1)? If not valid then default to either 0 or 1, whichever value you think is best.

13. fclose(iFile) should be inside if(iFile) check, if the handle is not valid then nothing needs to be closed.

14.
PHP Code:
if(iTry)
                {
                    
DetectSaveType()
                } 
iTry starts at 0 and can only increase. What is the point of checking if(iTry)?

15. For the record, I'm not a fan of caching the player name in a global variable because you have to account for name changing(using ClientUserInfoChanged). Calling get_user_name directly isn't going to cause any performance issues and trying to keep the cache up to date can be a pain in the ass and it's more error-prone(as is the case here since if the player is going to change his name your code will fail).

I think it's enough for now.
__________________

Last edited by HamletEagle; 08-19-2021 at 13:10.
HamletEagle is online now
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:15.


Powered by vBulletin®
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Theme made by Freecode